Skip to content

Linter Rules

This page contains documentation for all Herb Linter rules.

Available Rules

Contributing

To add a new linter rule you can scaffold a new rule by running:

bash
cd javascript/packages/linter

scripts/generate-rule

The script creates the documentation, rule stub, and test stub based on the GitHub issue (requires the linter label and a Rule name: [rule-name] line).

Alternatively, you can create one manually:

  1. Create the rule class implementing the Rule interface
  2. Add comprehensive tests in test/rules/
  3. Add documentation in docs/rules/
  4. Update the main linter to include the rule by default (if appropriate)

See html-tag-name-lowercase.ts for an example implementation.

Released under the MIT License.