@herb-tools/linter 0.8.5 → 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 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.5::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
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.5::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
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'