@herb-tools/linter 0.8.6 → 0.8.7
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.md +28 -2
- package/dist/herb-lint.js +37406 -41271
- package/dist/herb-lint.js.map +1 -1
- package/dist/index.cjs +92 -2076
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +92 -2076
- package/dist/index.js.map +1 -1
- package/dist/loader.cjs +7808 -5610
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.js +7808 -5610
- package/dist/loader.js.map +1 -1
- package/dist/package.json +9 -8
- package/dist/src/cli/argument-parser.js +14 -1
- package/dist/src/cli/argument-parser.js.map +1 -1
- package/dist/src/cli.js +12 -3
- package/dist/src/cli.js.map +1 -1
- package/dist/src/linter.js +2 -2
- package/dist/src/linter.js.map +1 -1
- package/dist/src/rules/html-no-duplicate-attributes.js +91 -21
- package/dist/src/rules/html-no-duplicate-attributes.js.map +1 -1
- package/dist/types/cli/argument-parser.d.ts +2 -0
- package/dist/types/src/cli/argument-parser.d.ts +2 -0
- package/package.json +9 -8
- package/src/cli/argument-parser.ts +16 -1
- package/src/cli.ts +17 -4
- package/src/linter.ts +2 -2
- package/src/rules/html-no-duplicate-attributes.ts +141 -26
package/README.md
CHANGED
|
@@ -192,6 +192,28 @@ npx @herb-tools/linter template.html.erb --format=simple --github
|
|
|
192
192
|
npx @herb-tools/linter template.html.erb --no-github
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
+
**Exit Behavior:** <Badge type="info" text="v0.8.7+" />
|
|
196
|
+
```bash
|
|
197
|
+
# Exit with error code when warnings or higher are present
|
|
198
|
+
npx @herb-tools/linter template.html.erb --fail-level warning
|
|
199
|
+
|
|
200
|
+
# Exit with error code when info diagnostics or higher are present
|
|
201
|
+
npx @herb-tools/linter template.html.erb --fail-level info
|
|
202
|
+
|
|
203
|
+
# Exit with error code when any diagnostic (including hints) is present
|
|
204
|
+
npx @herb-tools/linter template.html.erb --fail-level hint
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
By default, the linter exits with code `1` only when errors are present. The `--fail-level` option allows you to control this behavior for CI/CD pipelines where you want stricter enforcement. Valid values are: `error` (default), `warning`, `info`, `hint`.
|
|
208
|
+
|
|
209
|
+
This can also be configured in `.herb.yml`:
|
|
210
|
+
```yaml [.herb.yml]
|
|
211
|
+
linter:
|
|
212
|
+
failLevel: warning
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The CLI flag takes precedence over the configuration file.
|
|
216
|
+
|
|
195
217
|
**Help and Version:**
|
|
196
218
|
```bash
|
|
197
219
|
# Show help
|
|
@@ -219,7 +241,7 @@ npx @herb-tools/linter --format=simple --github
|
|
|
219
241
|
|
|
220
242
|
**Example: `--github` (GitHub annotations + detailed format)**
|
|
221
243
|
```
|
|
222
|
-
::error file=template.html.erb,line=3,col=3,title=html-img-require-alt • @herb-tools/linter@0.8.
|
|
244
|
+
::error file=template.html.erb,line=3,col=3,title=html-img-require-alt • @herb-tools/linter@0.8.7::Missing required `alt` attribute on `<img>` tag [html-img-require-alt]%0A%0A%0Atemplate.html.erb:3:3%0A%0A 1 │ <div>%0A 2 │ <span>Test content</span>%0A → 3 │ <img src="test.jpg">%0A │ ~~~%0A 4 │ </div>%0A
|
|
223
245
|
|
|
224
246
|
[error] Missing required `alt` attribute on `<img>` tag [html-img-require-alt]
|
|
225
247
|
|
|
@@ -234,7 +256,7 @@ template.html.erb:3:3
|
|
|
234
256
|
|
|
235
257
|
**Example: `--format=simple --github` (GitHub annotations + simple format)**
|
|
236
258
|
```
|
|
237
|
-
::error file=template.html.erb,line=3,col=3,title=html-img-require-alt • @herb-tools/linter@0.8.
|
|
259
|
+
::error file=template.html.erb,line=3,col=3,title=html-img-require-alt • @herb-tools/linter@0.8.7::Missing required `alt` attribute on `<img>` tag [html-img-require-alt]%0A%0A%0Atemplate.html.erb:3:3%0A%0A 1 │ <div>%0A 2 │ <span>Test content</span>%0A → 3 │ <img src="test.jpg">%0A │ ~~~%0A 4 │ </div>%0A
|
|
238
260
|
|
|
239
261
|
template.html.erb:
|
|
240
262
|
3:3 ✗ Missing required `alt` attribute on `<img>` tag [html-img-require-alt]
|
|
@@ -393,6 +415,10 @@ npx @herb-tools/linter --init
|
|
|
393
415
|
linter:
|
|
394
416
|
enabled: true
|
|
395
417
|
|
|
418
|
+
# # Exit with error code when diagnostics of this severity or higher are present
|
|
419
|
+
# # Valid values: error (default), warning, info, hint
|
|
420
|
+
# failLevel: warning
|
|
421
|
+
|
|
396
422
|
# Additional glob patterns to include (additive to defaults)
|
|
397
423
|
include:
|
|
398
424
|
- '**/*.xml.erb'
|