@wcstack/lint 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +62 -0
- package/README.md +62 -0
- package/dist/cli.cjs +3550 -0
- package/package.json +41 -0
package/README.ja.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# @wcstack/lint
|
|
2
|
+
|
|
3
|
+
[wcstack](https://github.com/wcstack/wcstack) の静的契約検査 CLI。HTML の `data-wcs` バインディングと `wcstack.manifest.json`(sidecar)を headless に検査します。WcStack IntelliSense(VS Code 拡張)と**同一の validator core** を使うため、IDE と CLI の diagnostic code / range は完全に一致します。
|
|
4
|
+
|
|
5
|
+
[English README is here](./README.md)
|
|
6
|
+
|
|
7
|
+
## 使い方
|
|
8
|
+
|
|
9
|
+
インストール不要で一行:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx @wcstack/lint --errors-only index.html wcstack.manifest.json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
またはインストールして `wcs-validate` コマンドとして:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm i -D @wcstack/lint
|
|
19
|
+
npx wcs-validate --errors-only src/**/*.html
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`.manifest.json` で終わるファイルは sidecar manifest として、それ以外は `data-wcs` バインディングを含む HTML として検査されます。
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
wcs-validate [--attr=data-wcs] [--state-tag=wcs-state] [--lang=ja|en] [--errors-only] <file> [<file> ...]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
| オプション | 説明 |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `--attr=<name>` | バインド属性名(既定 `data-wcs`) |
|
|
31
|
+
| `--state-tag=<name>` | state カスタム要素のタグ名(既定 `wcs-state`) |
|
|
32
|
+
| `--lang=ja\|en` | 診断メッセージの言語。未指定時は環境ロケール(`LC_ALL` / `LC_MESSAGES` / `LANG` → OS ロケール)に従う。code / range は言語に依らず不変 |
|
|
33
|
+
| `--errors-only`(別名 `--quiet`) | error severity の行だけ表示。warning / info の件数と exit code は不変 |
|
|
34
|
+
|
|
35
|
+
## 出力と exit code
|
|
36
|
+
|
|
37
|
+
診断は安定した順序で 1 行ずつ出力されます:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
index.html:12:8 warning wcs/path-nonexistent Path "user.nam" does not exist ...
|
|
41
|
+
app.manifest.json:1:3 error wcs/manifest-broken Broken manifest JSON: ...
|
|
42
|
+
|
|
43
|
+
1 error(s), 1 warning(s), 0 info
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
| exit code | 意味 |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `0` | error severity の診断なし(warning / info はあってもよい) |
|
|
49
|
+
| `1` | error severity の診断が 1 件以上 |
|
|
50
|
+
| `2` | usage エラー、またはファイル読み取り失敗 |
|
|
51
|
+
|
|
52
|
+
## 生成 → 検証 → 修正ループでの利用
|
|
53
|
+
|
|
54
|
+
安定した diagnostic code・`source:line:col` range・exit code 契約により、CI のゲートにも AI コード生成フローにもそのまま組み込めます: HTML を生成 → `npx @wcstack/lint --errors-only` → 診断を読んで修正 → exit code `0` になるまで再実行。
|
|
55
|
+
|
|
56
|
+
## VS Code 拡張との関係
|
|
57
|
+
|
|
58
|
+
このパッケージは薄い配布ラッパーです。[`wcstack-intellisense`](https://github.com/wcstack/wcstack/tree/main/packages/vscode-wcs) の validator core からビルドされた自己完結の CLI バンドルを同梱します(runtime dependencies ゼロ)。sidecar manifest は tooling 専用で、ランタイム挙動を変えることはありません。規範スキーマは [`docs/wcstack-manifest-schema.md`](https://github.com/wcstack/wcstack/blob/main/docs/wcstack-manifest-schema.md) を参照してください。
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
MIT
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# @wcstack/lint
|
|
2
|
+
|
|
3
|
+
Static-contract validator CLI for [wcstack](https://github.com/wcstack/wcstack): checks HTML `data-wcs` bindings and `wcstack.manifest.json` sidecars headlessly, with the **same validator core** as the WcStack IntelliSense VS Code extension — the IDE and this CLI report identical diagnostic codes and ranges.
|
|
4
|
+
|
|
5
|
+
[日本語版 README はこちら](./README.ja.md)
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
No install required:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx @wcstack/lint --errors-only index.html wcstack.manifest.json
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or install and use the `wcs-validate` command:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm i -D @wcstack/lint
|
|
19
|
+
npx wcs-validate --errors-only src/**/*.html
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Files ending in `.manifest.json` are validated as sidecar manifests; everything else is validated as HTML with `data-wcs` bindings.
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
wcs-validate [--attr=data-wcs] [--state-tag=wcs-state] [--lang=ja|en] [--errors-only] <file> [<file> ...]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
| Option | Description |
|
|
29
|
+
|---|---|
|
|
30
|
+
| `--attr=<name>` | Bind attribute name (default `data-wcs`) |
|
|
31
|
+
| `--state-tag=<name>` | State custom-element tag name (default `wcs-state`) |
|
|
32
|
+
| `--lang=ja\|en` | Diagnostic message language. Defaults to the environment locale (`LC_ALL` / `LC_MESSAGES` / `LANG`, then the OS locale); codes and ranges are language-independent |
|
|
33
|
+
| `--errors-only` (alias `--quiet`) | Print only error-severity lines; warning/info counts and the exit code are unchanged |
|
|
34
|
+
|
|
35
|
+
## Output & exit codes
|
|
36
|
+
|
|
37
|
+
One line per diagnostic, in a stable order:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
index.html:12:8 warning wcs/path-nonexistent Path "user.nam" does not exist ...
|
|
41
|
+
app.manifest.json:1:3 error wcs/manifest-broken Broken manifest JSON: ...
|
|
42
|
+
|
|
43
|
+
1 error(s), 1 warning(s), 0 info
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
| Exit code | Meaning |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `0` | No error-severity diagnostics (warnings/info may exist) |
|
|
49
|
+
| `1` | At least one error-severity diagnostic |
|
|
50
|
+
| `2` | Usage error or unreadable file |
|
|
51
|
+
|
|
52
|
+
## Use in generate–validate–fix loops
|
|
53
|
+
|
|
54
|
+
Stable diagnostic codes, `source:line:col` ranges, and the exit-code contract make this CLI a drop-in gate for CI and for AI code-generation flows: generate HTML → `npx @wcstack/lint --errors-only` → read the diagnostics, fix, and re-run until exit code `0`.
|
|
55
|
+
|
|
56
|
+
## Relationship to the VS Code extension
|
|
57
|
+
|
|
58
|
+
This package is a thin distribution wrapper: it ships the self-contained CLI bundle built from the [`wcstack-intellisense`](https://github.com/wcstack/wcstack/tree/main/packages/vscode-wcs) validator core (zero runtime dependencies). The sidecar manifest is tooling-only and never changes runtime behavior; the normative schema lives in [`docs/wcstack-manifest-schema.md`](https://github.com/wcstack/wcstack/blob/main/docs/wcstack-manifest-schema.md).
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
MIT
|