@herb-tools/linter 0.7.5 → 0.8.0
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 +253 -13
- package/dist/herb-lint.js +26023 -3424
- package/dist/herb-lint.js.map +1 -1
- package/dist/index.cjs +5759 -1583
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5727 -1584
- package/dist/index.js.map +1 -1
- package/dist/loader.cjs +17010 -0
- package/dist/loader.cjs.map +1 -0
- package/dist/loader.js +16879 -0
- package/dist/loader.js.map +1 -0
- package/dist/package.json +13 -5
- package/dist/src/cli/argument-parser.js +38 -33
- package/dist/src/cli/argument-parser.js.map +1 -1
- package/dist/src/cli/file-processor.js +124 -23
- package/dist/src/cli/file-processor.js.map +1 -1
- package/dist/src/cli/formatters/detailed-formatter.js +18 -3
- package/dist/src/cli/formatters/detailed-formatter.js.map +1 -1
- package/dist/src/cli/formatters/github-actions-formatter.js +15 -1
- package/dist/src/cli/formatters/github-actions-formatter.js.map +1 -1
- package/dist/src/cli/formatters/json-formatter.js +3 -0
- package/dist/src/cli/formatters/json-formatter.js.map +1 -1
- package/dist/src/cli/formatters/simple-formatter.js +20 -7
- package/dist/src/cli/formatters/simple-formatter.js.map +1 -1
- package/dist/src/cli/output-manager.js +22 -3
- package/dist/src/cli/output-manager.js.map +1 -1
- package/dist/src/cli/summary-reporter.js +26 -3
- package/dist/src/cli/summary-reporter.js.map +1 -1
- package/dist/src/cli.js +107 -42
- package/dist/src/cli.js.map +1 -1
- package/dist/src/custom-rule-loader.js +139 -0
- package/dist/src/custom-rule-loader.js.map +1 -0
- package/dist/src/herb-disable-comment-utils.js +129 -0
- package/dist/src/herb-disable-comment-utils.js.map +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/linter.js +369 -34
- package/dist/src/linter.js.map +1 -1
- package/dist/src/loader.js +17 -0
- package/dist/src/loader.js.map +1 -0
- package/dist/src/rules/erb-comment-syntax.js +31 -2
- package/dist/src/rules/erb-comment-syntax.js.map +1 -1
- package/dist/src/rules/erb-no-case-node-children.js +52 -0
- package/dist/src/rules/erb-no-case-node-children.js.map +1 -0
- package/dist/src/rules/erb-no-empty-tags.js +7 -1
- package/dist/src/rules/erb-no-empty-tags.js.map +1 -1
- package/dist/src/rules/erb-no-extra-newline.js +65 -0
- package/dist/src/rules/erb-no-extra-newline.js.map +1 -0
- package/dist/src/rules/erb-no-extra-whitespace-inside-tags.js +95 -0
- package/dist/src/rules/erb-no-extra-whitespace-inside-tags.js.map +1 -0
- package/dist/src/rules/erb-no-output-control-flow.js +7 -1
- package/dist/src/rules/erb-no-output-control-flow.js.map +1 -1
- package/dist/src/rules/erb-no-silent-tag-in-attribute-name.js +7 -1
- package/dist/src/rules/erb-no-silent-tag-in-attribute-name.js.map +1 -1
- package/dist/src/rules/erb-prefer-image-tag-helper.js +7 -1
- package/dist/src/rules/erb-prefer-image-tag-helper.js.map +1 -1
- package/dist/src/rules/erb-require-trailing-newline.js +35 -0
- package/dist/src/rules/erb-require-trailing-newline.js.map +1 -0
- package/dist/src/rules/erb-require-whitespace-inside-tags.js +69 -11
- package/dist/src/rules/erb-require-whitespace-inside-tags.js.map +1 -1
- package/dist/src/rules/erb-right-trim.js +26 -9
- package/dist/src/rules/erb-right-trim.js.map +1 -1
- package/dist/src/rules/herb-disable-comment-base.js +51 -0
- package/dist/src/rules/herb-disable-comment-base.js.map +1 -0
- package/dist/src/rules/herb-disable-comment-malformed.js +51 -0
- package/dist/src/rules/herb-disable-comment-malformed.js.map +1 -0
- package/dist/src/rules/herb-disable-comment-missing-rules.js +29 -0
- package/dist/src/rules/herb-disable-comment-missing-rules.js.map +1 -0
- package/dist/src/rules/herb-disable-comment-no-duplicate-rules.js +32 -0
- package/dist/src/rules/herb-disable-comment-no-duplicate-rules.js.map +1 -0
- package/dist/src/rules/herb-disable-comment-no-redundant-all.js +31 -0
- package/dist/src/rules/herb-disable-comment-no-redundant-all.js.map +1 -0
- package/dist/src/rules/herb-disable-comment-unnecessary.js +65 -0
- package/dist/src/rules/herb-disable-comment-unnecessary.js.map +1 -0
- package/dist/src/rules/herb-disable-comment-valid-rule-name.js +44 -0
- package/dist/src/rules/herb-disable-comment-valid-rule-name.js.map +1 -0
- package/dist/src/rules/html-anchor-require-href.js +7 -1
- package/dist/src/rules/html-anchor-require-href.js.map +1 -1
- package/dist/src/rules/html-aria-attribute-must-be-valid.js +7 -1
- package/dist/src/rules/html-aria-attribute-must-be-valid.js.map +1 -1
- package/dist/src/rules/html-aria-label-is-well-formatted.js +9 -3
- package/dist/src/rules/html-aria-label-is-well-formatted.js.map +1 -1
- package/dist/src/rules/html-aria-level-must-be-valid.js +6 -0
- package/dist/src/rules/html-aria-level-must-be-valid.js.map +1 -1
- package/dist/src/rules/html-aria-role-heading-requires-level.js +7 -1
- package/dist/src/rules/html-aria-role-heading-requires-level.js.map +1 -1
- package/dist/src/rules/html-aria-role-must-be-valid.js +7 -1
- package/dist/src/rules/html-aria-role-must-be-valid.js.map +1 -1
- package/dist/src/rules/html-attribute-double-quotes.js +29 -2
- package/dist/src/rules/html-attribute-double-quotes.js.map +1 -1
- package/dist/src/rules/html-attribute-equals-spacing.js +18 -2
- package/dist/src/rules/html-attribute-equals-spacing.js.map +1 -1
- package/dist/src/rules/html-attribute-values-require-quotes.js +39 -3
- package/dist/src/rules/html-attribute-values-require-quotes.js.map +1 -1
- package/dist/src/rules/html-avoid-both-disabled-and-aria-disabled.js +7 -1
- package/dist/src/rules/html-avoid-both-disabled-and-aria-disabled.js.map +1 -1
- package/dist/src/rules/html-body-only-elements.js +46 -0
- package/dist/src/rules/html-body-only-elements.js.map +1 -0
- package/dist/src/rules/html-boolean-attributes-no-value.js +18 -1
- package/dist/src/rules/html-boolean-attributes-no-value.js.map +1 -1
- package/dist/src/rules/html-head-only-elements.js +51 -0
- package/dist/src/rules/html-head-only-elements.js.map +1 -0
- package/dist/src/rules/html-iframe-has-title.js +8 -2
- package/dist/src/rules/html-iframe-has-title.js.map +1 -1
- package/dist/src/rules/html-img-require-alt.js +7 -1
- package/dist/src/rules/html-img-require-alt.js.map +1 -1
- package/dist/src/rules/html-input-require-autocomplete.js +70 -0
- package/dist/src/rules/html-input-require-autocomplete.js.map +1 -0
- package/dist/src/rules/html-navigation-has-label.js +7 -1
- package/dist/src/rules/html-navigation-has-label.js.map +1 -1
- package/dist/src/rules/html-no-aria-hidden-on-focusable.js +7 -1
- package/dist/src/rules/html-no-aria-hidden-on-focusable.js.map +1 -1
- package/dist/src/rules/html-no-block-inside-inline.js +7 -1
- package/dist/src/rules/html-no-block-inside-inline.js.map +1 -1
- package/dist/src/rules/html-no-duplicate-attributes.js +7 -1
- package/dist/src/rules/html-no-duplicate-attributes.js.map +1 -1
- package/dist/src/rules/html-no-duplicate-ids.js +9 -3
- package/dist/src/rules/html-no-duplicate-ids.js.map +1 -1
- package/dist/src/rules/html-no-duplicate-meta-names.js +136 -0
- package/dist/src/rules/html-no-duplicate-meta-names.js.map +1 -0
- package/dist/src/rules/html-no-empty-attributes.js +45 -7
- package/dist/src/rules/html-no-empty-attributes.js.map +1 -1
- package/dist/src/rules/html-no-empty-headings.js +7 -6
- package/dist/src/rules/html-no-empty-headings.js.map +1 -1
- package/dist/src/rules/html-no-nested-links.js +7 -1
- package/dist/src/rules/html-no-nested-links.js.map +1 -1
- package/dist/src/rules/html-no-positive-tab-index.js +7 -1
- package/dist/src/rules/html-no-positive-tab-index.js.map +1 -1
- package/dist/src/rules/html-no-self-closing.js +48 -3
- package/dist/src/rules/html-no-self-closing.js.map +1 -1
- package/dist/src/rules/html-no-space-in-tag.js +173 -0
- package/dist/src/rules/html-no-space-in-tag.js.map +1 -0
- package/dist/src/rules/html-no-title-attribute.js +7 -1
- package/dist/src/rules/html-no-title-attribute.js.map +1 -1
- package/dist/src/rules/html-no-underscores-in-attribute-names.js +7 -1
- package/dist/src/rules/html-no-underscores-in-attribute-names.js.map +1 -1
- package/dist/src/rules/html-tag-name-lowercase.js +23 -5
- package/dist/src/rules/html-tag-name-lowercase.js.map +1 -1
- package/dist/src/rules/index.js +19 -3
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/parser-no-errors.js +6 -0
- package/dist/src/rules/parser-no-errors.js.map +1 -1
- package/dist/src/rules/rule-utils.js +211 -31
- package/dist/src/rules/rule-utils.js.map +1 -1
- package/dist/src/rules/svg-tag-name-capitalization.js +22 -2
- package/dist/src/rules/svg-tag-name-capitalization.js.map +1 -1
- package/dist/src/{default-rules.js → rules.js} +44 -16
- package/dist/src/rules.js.map +1 -0
- package/dist/src/types.js +34 -1
- package/dist/src/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/cli/argument-parser.d.ts +8 -2
- package/dist/types/cli/file-processor.d.ts +15 -0
- package/dist/types/cli/formatters/json-formatter.d.ts +6 -0
- package/dist/types/cli/formatters/simple-formatter.d.ts +1 -0
- package/dist/types/cli/summary-reporter.d.ts +6 -0
- package/dist/types/cli.d.ts +9 -4
- package/dist/types/custom-rule-loader.d.ts +62 -0
- package/dist/types/herb-disable-comment-utils.d.ts +69 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/linter.d.ts +99 -3
- package/dist/types/loader.d.ts +20 -0
- package/dist/types/rules/erb-comment-syntax.d.ts +12 -5
- package/dist/types/rules/erb-no-case-node-children.d.ts +8 -0
- package/dist/types/rules/erb-no-empty-tags.d.ts +3 -2
- package/dist/types/rules/erb-no-extra-newline.d.ts +14 -0
- package/dist/types/rules/erb-no-extra-whitespace-inside-tags.d.ts +18 -0
- package/dist/types/rules/erb-no-output-control-flow.d.ts +3 -2
- package/dist/types/rules/erb-no-silent-tag-in-attribute-name.d.ts +3 -2
- package/dist/types/rules/erb-prefer-image-tag-helper.d.ts +3 -2
- package/dist/types/rules/erb-require-trailing-newline.d.ts +9 -0
- package/dist/types/rules/erb-require-whitespace-inside-tags.d.ts +16 -5
- package/dist/types/rules/erb-right-trim.d.ts +12 -5
- package/dist/types/rules/herb-disable-comment-base.d.ts +37 -0
- package/dist/types/rules/herb-disable-comment-malformed.d.ts +8 -0
- package/dist/types/rules/herb-disable-comment-missing-rules.d.ts +8 -0
- package/dist/types/rules/herb-disable-comment-no-duplicate-rules.d.ts +8 -0
- package/dist/types/rules/herb-disable-comment-no-redundant-all.d.ts +8 -0
- package/dist/types/rules/herb-disable-comment-unnecessary.d.ts +8 -0
- package/dist/types/rules/herb-disable-comment-valid-rule-name.d.ts +8 -0
- package/dist/types/rules/html-anchor-require-href.d.ts +3 -2
- package/dist/types/rules/html-aria-attribute-must-be-valid.d.ts +3 -2
- package/dist/types/rules/html-aria-label-is-well-formatted.d.ts +3 -2
- package/dist/types/rules/html-aria-level-must-be-valid.d.ts +3 -2
- package/dist/types/rules/html-aria-role-heading-requires-level.d.ts +3 -2
- package/dist/types/rules/html-aria-role-must-be-valid.d.ts +3 -2
- package/dist/types/rules/html-attribute-double-quotes.d.ts +13 -5
- package/dist/types/rules/html-attribute-equals-spacing.d.ts +12 -5
- package/dist/types/rules/html-attribute-values-require-quotes.d.ts +13 -5
- package/dist/types/rules/html-avoid-both-disabled-and-aria-disabled.d.ts +3 -2
- package/dist/types/rules/html-body-only-elements.d.ts +9 -0
- package/dist/types/rules/html-boolean-attributes-no-value.d.ts +12 -5
- package/dist/types/rules/html-head-only-elements.d.ts +9 -0
- package/dist/types/rules/html-iframe-has-title.d.ts +3 -2
- package/dist/types/rules/html-img-require-alt.d.ts +3 -2
- package/dist/types/rules/html-input-require-autocomplete.d.ts +8 -0
- package/dist/types/rules/html-navigation-has-label.d.ts +3 -2
- package/dist/types/rules/html-no-aria-hidden-on-focusable.d.ts +3 -2
- package/dist/types/rules/html-no-block-inside-inline.d.ts +3 -2
- package/dist/types/rules/html-no-duplicate-attributes.d.ts +3 -2
- package/dist/types/rules/html-no-duplicate-ids.d.ts +3 -2
- package/dist/types/rules/html-no-duplicate-meta-names.d.ts +9 -0
- package/dist/types/rules/html-no-empty-attributes.d.ts +3 -2
- package/dist/types/rules/html-no-empty-headings.d.ts +3 -2
- package/dist/types/rules/html-no-nested-links.d.ts +3 -2
- package/dist/types/rules/html-no-positive-tab-index.d.ts +3 -2
- package/dist/types/rules/html-no-self-closing.d.ts +14 -5
- package/dist/types/rules/html-no-space-in-tag.d.ts +16 -0
- package/dist/types/rules/html-no-title-attribute.d.ts +3 -2
- package/dist/types/rules/html-no-underscores-in-attribute-names.d.ts +3 -2
- package/dist/types/rules/html-tag-name-lowercase.d.ts +16 -6
- package/dist/types/rules/index.d.ts +19 -3
- package/dist/types/rules/parser-no-errors.d.ts +2 -1
- package/dist/types/rules/rule-utils.d.ts +72 -25
- package/dist/types/rules/svg-tag-name-capitalization.d.ts +13 -4
- package/dist/types/rules.d.ts +2 -0
- package/dist/types/src/cli/argument-parser.d.ts +8 -2
- package/dist/types/src/cli/file-processor.d.ts +15 -0
- package/dist/types/src/cli/formatters/json-formatter.d.ts +6 -0
- package/dist/types/src/cli/formatters/simple-formatter.d.ts +1 -0
- package/dist/types/src/cli/summary-reporter.d.ts +6 -0
- package/dist/types/src/cli.d.ts +9 -4
- package/dist/types/src/custom-rule-loader.d.ts +62 -0
- package/dist/types/src/herb-disable-comment-utils.d.ts +69 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/linter.d.ts +99 -3
- package/dist/types/src/loader.d.ts +20 -0
- package/dist/types/src/rules/erb-comment-syntax.d.ts +12 -5
- package/dist/types/src/rules/erb-no-case-node-children.d.ts +8 -0
- package/dist/types/src/rules/erb-no-empty-tags.d.ts +3 -2
- package/dist/types/src/rules/erb-no-extra-newline.d.ts +14 -0
- package/dist/types/src/rules/erb-no-extra-whitespace-inside-tags.d.ts +18 -0
- package/dist/types/src/rules/erb-no-output-control-flow.d.ts +3 -2
- package/dist/types/src/rules/erb-no-silent-tag-in-attribute-name.d.ts +3 -2
- package/dist/types/src/rules/erb-prefer-image-tag-helper.d.ts +3 -2
- package/dist/types/src/rules/erb-require-trailing-newline.d.ts +9 -0
- package/dist/types/src/rules/erb-require-whitespace-inside-tags.d.ts +16 -5
- package/dist/types/src/rules/erb-right-trim.d.ts +12 -5
- package/dist/types/src/rules/herb-disable-comment-base.d.ts +37 -0
- package/dist/types/src/rules/herb-disable-comment-malformed.d.ts +8 -0
- package/dist/types/src/rules/herb-disable-comment-missing-rules.d.ts +8 -0
- package/dist/types/src/rules/herb-disable-comment-no-duplicate-rules.d.ts +8 -0
- package/dist/types/src/rules/herb-disable-comment-no-redundant-all.d.ts +8 -0
- package/dist/types/src/rules/herb-disable-comment-unnecessary.d.ts +8 -0
- package/dist/types/src/rules/herb-disable-comment-valid-rule-name.d.ts +8 -0
- package/dist/types/src/rules/html-anchor-require-href.d.ts +3 -2
- package/dist/types/src/rules/html-aria-attribute-must-be-valid.d.ts +3 -2
- package/dist/types/src/rules/html-aria-label-is-well-formatted.d.ts +3 -2
- package/dist/types/src/rules/html-aria-level-must-be-valid.d.ts +3 -2
- package/dist/types/src/rules/html-aria-role-heading-requires-level.d.ts +3 -2
- package/dist/types/src/rules/html-aria-role-must-be-valid.d.ts +3 -2
- package/dist/types/src/rules/html-attribute-double-quotes.d.ts +13 -5
- package/dist/types/src/rules/html-attribute-equals-spacing.d.ts +12 -5
- package/dist/types/src/rules/html-attribute-values-require-quotes.d.ts +13 -5
- package/dist/types/src/rules/html-avoid-both-disabled-and-aria-disabled.d.ts +3 -2
- package/dist/types/src/rules/html-body-only-elements.d.ts +9 -0
- package/dist/types/src/rules/html-boolean-attributes-no-value.d.ts +12 -5
- package/dist/types/src/rules/html-head-only-elements.d.ts +9 -0
- package/dist/types/src/rules/html-iframe-has-title.d.ts +3 -2
- package/dist/types/src/rules/html-img-require-alt.d.ts +3 -2
- package/dist/types/src/rules/html-input-require-autocomplete.d.ts +8 -0
- package/dist/types/src/rules/html-navigation-has-label.d.ts +3 -2
- package/dist/types/src/rules/html-no-aria-hidden-on-focusable.d.ts +3 -2
- package/dist/types/src/rules/html-no-block-inside-inline.d.ts +3 -2
- package/dist/types/src/rules/html-no-duplicate-attributes.d.ts +3 -2
- package/dist/types/src/rules/html-no-duplicate-ids.d.ts +3 -2
- package/dist/types/src/rules/html-no-duplicate-meta-names.d.ts +9 -0
- package/dist/types/src/rules/html-no-empty-attributes.d.ts +3 -2
- package/dist/types/src/rules/html-no-empty-headings.d.ts +3 -2
- package/dist/types/src/rules/html-no-nested-links.d.ts +3 -2
- package/dist/types/src/rules/html-no-positive-tab-index.d.ts +3 -2
- package/dist/types/src/rules/html-no-self-closing.d.ts +14 -5
- package/dist/types/src/rules/html-no-space-in-tag.d.ts +16 -0
- package/dist/types/src/rules/html-no-title-attribute.d.ts +3 -2
- package/dist/types/src/rules/html-no-underscores-in-attribute-names.d.ts +3 -2
- package/dist/types/src/rules/html-tag-name-lowercase.d.ts +16 -6
- package/dist/types/src/rules/index.d.ts +19 -3
- package/dist/types/src/rules/parser-no-errors.d.ts +2 -1
- package/dist/types/src/rules/rule-utils.d.ts +72 -25
- package/dist/types/src/rules/svg-tag-name-capitalization.d.ts +13 -4
- package/dist/types/src/rules.d.ts +2 -0
- package/dist/types/src/types.d.ts +102 -11
- package/dist/types/types.d.ts +102 -11
- package/docs/rules/README.md +16 -2
- package/docs/rules/erb-no-case-node-children.md +50 -0
- package/docs/rules/erb-no-extra-newline.md +74 -0
- package/docs/rules/erb-no-extra-whitespace-inside-tags.md +39 -0
- package/docs/rules/{erb-requires-trailing-newline.md → erb-require-trailing-newline.md} +1 -1
- package/docs/rules/erb-right-trim.md +5 -10
- package/docs/rules/herb-disable-comment-malformed.md +45 -0
- package/docs/rules/herb-disable-comment-missing-rules.md +60 -0
- package/docs/rules/herb-disable-comment-no-duplicate-rules.md +49 -0
- package/docs/rules/herb-disable-comment-no-redundant-all.md +53 -0
- package/docs/rules/herb-disable-comment-unnecessary.md +44 -0
- package/docs/rules/herb-disable-comment-valid-rule-name.md +41 -0
- package/docs/rules/html-aria-attribute-must-be-valid.md +2 -5
- package/docs/rules/html-aria-label-is-well-formatted.md +1 -1
- package/docs/rules/html-attribute-double-quotes.md +2 -2
- package/docs/rules/html-attribute-equals-spacing.md +2 -2
- package/docs/rules/html-attribute-values-require-quotes.md +3 -3
- package/docs/rules/html-avoid-both-disabled-and-aria-disabled.md +2 -2
- package/docs/rules/html-body-only-elements.md +99 -0
- package/docs/rules/html-boolean-attributes-no-value.md +2 -2
- package/docs/rules/html-head-only-elements.md +81 -0
- package/docs/rules/html-input-require-autocomplete.md +64 -0
- package/docs/rules/html-no-aria-hidden-on-focusable.md +2 -2
- package/docs/rules/html-no-duplicate-attributes.md +2 -2
- package/docs/rules/html-no-duplicate-meta-names.md +64 -0
- package/docs/rules/html-no-empty-attributes.md +3 -3
- package/docs/rules/html-no-empty-headings.md +4 -26
- package/docs/rules/html-no-positive-tab-index.md +1 -2
- package/docs/rules/html-no-self-closing.md +17 -2
- package/docs/rules/html-no-space-in-tag.md +66 -0
- package/docs/rules/html-no-title-attribute.md +2 -2
- package/docs/rules/html-no-underscores-in-attribute-names.md +2 -2
- package/docs/rules/html-tag-name-lowercase.md +2 -2
- package/package.json +13 -5
- package/src/cli/argument-parser.ts +46 -37
- package/src/cli/file-processor.ts +159 -28
- package/src/cli/formatters/detailed-formatter.ts +21 -3
- package/src/cli/formatters/github-actions-formatter.ts +17 -1
- package/src/cli/formatters/json-formatter.ts +9 -0
- package/src/cli/formatters/simple-formatter.ts +24 -8
- package/src/cli/output-manager.ts +23 -3
- package/src/cli/summary-reporter.ts +40 -3
- package/src/cli.ts +134 -51
- package/src/custom-rule-loader.ts +189 -0
- package/src/herb-disable-comment-utils.ts +175 -0
- package/src/index.ts +2 -0
- package/src/linter.ts +501 -36
- package/src/loader.ts +30 -0
- package/src/rules/erb-comment-syntax.ts +53 -10
- package/src/rules/erb-no-case-node-children.ts +68 -0
- package/src/rules/erb-no-empty-tags.ts +9 -3
- package/src/rules/erb-no-extra-newline.ts +91 -0
- package/src/rules/erb-no-extra-whitespace-inside-tags.ts +147 -0
- package/src/rules/erb-no-output-control-flow.ts +9 -3
- package/src/rules/erb-no-silent-tag-in-attribute-name.ts +9 -3
- package/src/rules/erb-prefer-image-tag-helper.ts +9 -3
- package/src/rules/erb-require-trailing-newline.ts +47 -0
- package/src/rules/erb-require-whitespace-inside-tags.ts +94 -16
- package/src/rules/erb-right-trim.ts +45 -22
- package/src/rules/herb-disable-comment-base.ts +76 -0
- package/src/rules/herb-disable-comment-malformed.ts +66 -0
- package/src/rules/herb-disable-comment-missing-rules.ts +41 -0
- package/src/rules/herb-disable-comment-no-duplicate-rules.ts +46 -0
- package/src/rules/herb-disable-comment-no-redundant-all.ts +40 -0
- package/src/rules/herb-disable-comment-unnecessary.ts +103 -0
- package/src/rules/herb-disable-comment-valid-rule-name.ts +62 -0
- package/src/rules/html-anchor-require-href.ts +9 -3
- package/src/rules/html-aria-attribute-must-be-valid.ts +9 -3
- package/src/rules/html-aria-label-is-well-formatted.ts +9 -5
- package/src/rules/html-aria-level-must-be-valid.ts +9 -2
- package/src/rules/html-aria-role-heading-requires-level.ts +9 -3
- package/src/rules/html-aria-role-must-be-valid.ts +9 -3
- package/src/rules/html-attribute-double-quotes.ts +42 -8
- package/src/rules/html-attribute-equals-spacing.ts +31 -7
- package/src/rules/html-attribute-values-require-quotes.ts +56 -10
- package/src/rules/html-avoid-both-disabled-and-aria-disabled.ts +9 -3
- package/src/rules/html-body-only-elements.ts +60 -0
- package/src/rules/html-boolean-attributes-no-value.ts +31 -6
- package/src/rules/html-head-only-elements.ts +65 -0
- package/src/rules/html-iframe-has-title.ts +9 -4
- package/src/rules/html-img-require-alt.ts +10 -4
- package/src/rules/html-input-require-autocomplete.ts +85 -0
- package/src/rules/html-navigation-has-label.ts +9 -3
- package/src/rules/html-no-aria-hidden-on-focusable.ts +9 -3
- package/src/rules/html-no-block-inside-inline.ts +9 -3
- package/src/rules/html-no-duplicate-attributes.ts +9 -3
- package/src/rules/html-no-duplicate-ids.ts +11 -7
- package/src/rules/html-no-duplicate-meta-names.ts +188 -0
- package/src/rules/html-no-empty-attributes.ts +58 -10
- package/src/rules/html-no-empty-headings.ts +10 -8
- package/src/rules/html-no-nested-links.ts +10 -4
- package/src/rules/html-no-positive-tab-index.ts +9 -3
- package/src/rules/html-no-self-closing.ts +69 -9
- package/src/rules/html-no-space-in-tag.ts +221 -0
- package/src/rules/html-no-title-attribute.ts +9 -3
- package/src/rules/html-no-underscores-in-attribute-names.ts +12 -4
- package/src/rules/html-tag-name-lowercase.ts +41 -10
- package/src/rules/index.ts +23 -3
- package/src/rules/parser-no-errors.ts +8 -1
- package/src/rules/rule-utils.ts +248 -42
- package/src/rules/svg-tag-name-capitalization.ts +39 -6
- package/src/{default-rules.ts → rules.ts} +51 -15
- package/src/types.ts +133 -15
- package/dist/src/default-rules.js.map +0 -1
- package/dist/src/rules/erb-requires-trailing-newline.js +0 -22
- package/dist/src/rules/erb-requires-trailing-newline.js.map +0 -1
- package/dist/types/default-rules.d.ts +0 -2
- package/dist/types/rules/erb-requires-trailing-newline.d.ts +0 -6
- package/dist/types/src/default-rules.d.ts +0 -2
- package/dist/types/src/rules/erb-requires-trailing-newline.d.ts +0 -6
- package/src/rules/erb-requires-trailing-newline.ts +0 -29
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLAriaRoleHeadingRequiresLevelRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLAriaRoleMustBeValidRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { ParserRule } from "../types.js";
|
|
2
|
-
import type { LintOffense, LintContext } from "../types.js";
|
|
3
|
-
import type { ParseResult } from "@herb-tools/core";
|
|
4
|
-
|
|
1
|
+
import { ParserRule, BaseAutofixContext, Mutable } from "../types.js";
|
|
2
|
+
import type { UnboundLintOffense, LintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
|
+
import type { ParseResult, HTMLAttributeNode } from "@herb-tools/core";
|
|
4
|
+
interface AttributeDoubleQuotesAutofixContext extends BaseAutofixContext {
|
|
5
|
+
node: Mutable<HTMLAttributeNode>;
|
|
6
|
+
valueContent: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class HTMLAttributeDoubleQuotesRule extends ParserRule<AttributeDoubleQuotesAutofixContext> {
|
|
9
|
+
static autocorrectable: boolean;
|
|
5
10
|
name: string;
|
|
6
|
-
|
|
11
|
+
get defaultConfig(): FullRuleConfig;
|
|
12
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense<AttributeDoubleQuotesAutofixContext>[];
|
|
13
|
+
autofix(offense: LintOffense<AttributeDoubleQuotesAutofixContext>, result: ParseResult, _context?: Partial<LintContext>): ParseResult | null;
|
|
7
14
|
}
|
|
15
|
+
export {};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import { ParserRule } from "../types.js";
|
|
2
|
-
import type { LintOffense, LintContext } from "../types.js";
|
|
3
|
-
import type { ParseResult } from "@herb-tools/core";
|
|
4
|
-
|
|
1
|
+
import { ParserRule, BaseAutofixContext, Mutable } from "../types.js";
|
|
2
|
+
import type { UnboundLintOffense, LintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
|
+
import type { ParseResult, HTMLAttributeNode } from "@herb-tools/core";
|
|
4
|
+
interface AttributeEqualsSpacingAutofixContext extends BaseAutofixContext {
|
|
5
|
+
node: Mutable<HTMLAttributeNode>;
|
|
6
|
+
}
|
|
7
|
+
export declare class HTMLAttributeEqualsSpacingRule extends ParserRule<AttributeEqualsSpacingAutofixContext> {
|
|
8
|
+
static autocorrectable: boolean;
|
|
5
9
|
name: string;
|
|
6
|
-
|
|
10
|
+
get defaultConfig(): FullRuleConfig;
|
|
11
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense<AttributeEqualsSpacingAutofixContext>[];
|
|
12
|
+
autofix(offense: LintOffense<AttributeEqualsSpacingAutofixContext>, result: ParseResult, _context?: Partial<LintContext>): ParseResult | null;
|
|
7
13
|
}
|
|
14
|
+
export {};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import { ParserRule } from "../types.js";
|
|
2
|
-
import type { LintOffense, LintContext } from "../types.js";
|
|
3
|
-
import type { ParseResult } from "@herb-tools/core";
|
|
4
|
-
|
|
1
|
+
import { ParserRule, BaseAutofixContext, Mutable } from "../types.js";
|
|
2
|
+
import type { UnboundLintOffense, LintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
|
+
import type { HTMLAttributeNode, ParseResult } from "@herb-tools/core";
|
|
4
|
+
interface AttributeValuesRequireQuotesAutofixContext extends BaseAutofixContext {
|
|
5
|
+
node: Mutable<HTMLAttributeNode>;
|
|
6
|
+
unquotedValue: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class HTMLAttributeValuesRequireQuotesRule extends ParserRule<AttributeValuesRequireQuotesAutofixContext> {
|
|
9
|
+
static autocorrectable: boolean;
|
|
5
10
|
name: string;
|
|
6
|
-
|
|
11
|
+
get defaultConfig(): FullRuleConfig;
|
|
12
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense<AttributeValuesRequireQuotesAutofixContext>[];
|
|
13
|
+
autofix(offense: LintOffense<AttributeValuesRequireQuotesAutofixContext>, result: ParseResult, _context?: Partial<LintContext>): ParseResult | null;
|
|
7
14
|
}
|
|
15
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLAvoidBothDisabledAndAriaDisabledRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
|
+
import type { ParseResult } from "@herb-tools/core";
|
|
4
|
+
export declare class HTMLBodyOnlyElementsRule extends ParserRule {
|
|
5
|
+
static autocorrectable: boolean;
|
|
6
|
+
name: string;
|
|
7
|
+
get defaultConfig(): FullRuleConfig;
|
|
8
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
9
|
+
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import { ParserRule } from "../types.js";
|
|
2
|
-
import type { LintOffense, LintContext } from "../types.js";
|
|
3
|
-
import type { ParseResult } from "@herb-tools/core";
|
|
4
|
-
|
|
1
|
+
import { ParserRule, BaseAutofixContext, Mutable } from "../types.js";
|
|
2
|
+
import type { UnboundLintOffense, LintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
|
+
import type { ParseResult, HTMLAttributeNode } from "@herb-tools/core";
|
|
4
|
+
interface BooleanAttributeAutofixContext extends BaseAutofixContext {
|
|
5
|
+
node: Mutable<HTMLAttributeNode>;
|
|
6
|
+
}
|
|
7
|
+
export declare class HTMLBooleanAttributesNoValueRule extends ParserRule<BooleanAttributeAutofixContext> {
|
|
8
|
+
static autocorrectable: boolean;
|
|
5
9
|
name: string;
|
|
6
|
-
|
|
10
|
+
get defaultConfig(): FullRuleConfig;
|
|
11
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense<BooleanAttributeAutofixContext>[];
|
|
12
|
+
autofix(offense: LintOffense<BooleanAttributeAutofixContext>, result: ParseResult, _context?: Partial<LintContext>): ParseResult | null;
|
|
7
13
|
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ParserRule } from "../types";
|
|
2
|
+
import type { ParseResult } from "@herb-tools/core";
|
|
3
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types";
|
|
4
|
+
export declare class HTMLHeadOnlyElementsRule extends ParserRule {
|
|
5
|
+
static autocorrectable: boolean;
|
|
6
|
+
name: string;
|
|
7
|
+
get defaultConfig(): FullRuleConfig;
|
|
8
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
9
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLIframeHasTitleRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLImgRequireAltRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
|
+
import type { ParseResult } from "@herb-tools/core";
|
|
4
|
+
export declare class HTMLInputRequireAutocompleteRule extends ParserRule {
|
|
5
|
+
name: string;
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
8
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLNavigationHasLabelRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLNoAriaHiddenOnFocusableRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLNoBlockInsideInlineRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLNoDuplicateAttributesRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types";
|
|
2
2
|
import type { ParseResult } from "@herb-tools/core";
|
|
3
|
-
import type {
|
|
3
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types";
|
|
4
4
|
export declare class HTMLNoDuplicateIdsRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ParserRule } from "../types";
|
|
2
|
+
import type { ParseResult } from "@herb-tools/core";
|
|
3
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types";
|
|
4
|
+
export declare class HTMLNoDuplicateMetaNamesRule extends ParserRule {
|
|
5
|
+
static autocorrectable: boolean;
|
|
6
|
+
name: string;
|
|
7
|
+
get defaultConfig(): FullRuleConfig;
|
|
8
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
9
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLNoEmptyAttributesRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLNoEmptyHeadingsRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLNoNestedLinksRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLNoPositiveTabIndexRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import { ParserRule } from "../types.js";
|
|
2
|
-
import type { LintContext, LintOffense } from "../types.js";
|
|
3
|
-
import type { ParseResult } from "@herb-tools/core";
|
|
4
|
-
|
|
1
|
+
import { ParserRule, BaseAutofixContext, Mutable } from "../types.js";
|
|
2
|
+
import type { UnboundLintOffense, LintContext, LintOffense, FullRuleConfig } from "../types.js";
|
|
3
|
+
import type { HTMLOpenTagNode, ParseResult } from "@herb-tools/core";
|
|
4
|
+
interface NoSelfClosingAutofixContext extends BaseAutofixContext {
|
|
5
|
+
node: Mutable<HTMLOpenTagNode>;
|
|
6
|
+
tagName: string;
|
|
7
|
+
isVoid: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class HTMLNoSelfClosingRule extends ParserRule<NoSelfClosingAutofixContext> {
|
|
10
|
+
static autocorrectable: boolean;
|
|
5
11
|
name: string;
|
|
6
|
-
|
|
12
|
+
get defaultConfig(): FullRuleConfig;
|
|
13
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense<NoSelfClosingAutofixContext>[];
|
|
14
|
+
autofix(offense: LintOffense<NoSelfClosingAutofixContext>, result: ParseResult, _context?: Partial<LintContext>): ParseResult | null;
|
|
7
15
|
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { WhitespaceNode } from "@herb-tools/core";
|
|
2
|
+
import { ParserRule, BaseAutofixContext } from "../types.js";
|
|
3
|
+
import type { ParseResult, HTMLOpenTagNode } from "@herb-tools/core";
|
|
4
|
+
import type { UnboundLintOffense, LintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
5
|
+
interface HTMLNoSpaceInTagAutofixContext extends BaseAutofixContext {
|
|
6
|
+
node: WhitespaceNode | HTMLOpenTagNode;
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class HTMLNoSpaceInTagRule extends ParserRule<HTMLNoSpaceInTagAutofixContext> {
|
|
10
|
+
static autocorrectable: boolean;
|
|
11
|
+
name: string;
|
|
12
|
+
get defaultConfig(): FullRuleConfig;
|
|
13
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense<HTMLNoSpaceInTagAutofixContext>[];
|
|
14
|
+
autofix(offense: LintOffense<HTMLNoSpaceInTagAutofixContext>, result: ParseResult, _context?: Partial<LintContext>): ParseResult | null;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLNoTitleAttributeRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type { LintContext,
|
|
2
|
+
import type { UnboundLintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class HTMLNoUnderscoresInAttributeNamesRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
-
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
7
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense[];
|
|
7
8
|
}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
import { ParserRule } from "../types.js";
|
|
2
|
-
import {
|
|
3
|
-
import type { LintOffense, LintContext } from "../types.js";
|
|
4
|
-
|
|
1
|
+
import { ParserRule, BaseAutofixContext, Mutable } from "../types.js";
|
|
2
|
+
import { HTMLOpenTagNode } from "@herb-tools/core";
|
|
3
|
+
import type { UnboundLintOffense, LintOffense, LintContext, FullRuleConfig } from "../types.js";
|
|
4
|
+
import type { HTMLCloseTagNode, ParseResult } from "@herb-tools/core";
|
|
5
|
+
interface TagNameAutofixContext extends BaseAutofixContext {
|
|
6
|
+
node: Mutable<HTMLOpenTagNode | HTMLCloseTagNode>;
|
|
7
|
+
tagName: string;
|
|
8
|
+
correctedTagName: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class HTMLTagNameLowercaseRule extends ParserRule<TagNameAutofixContext> {
|
|
11
|
+
static autocorrectable: boolean;
|
|
5
12
|
name: string;
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
get defaultConfig(): FullRuleConfig;
|
|
14
|
+
isEnabled(result: ParseResult, _context?: Partial<LintContext>): boolean;
|
|
15
|
+
check(result: ParseResult, context?: Partial<LintContext>): UnboundLintOffense<TagNameAutofixContext>[];
|
|
16
|
+
autofix(offense: LintOffense<TagNameAutofixContext>, result: ParseResult, _context?: Partial<LintContext>): ParseResult | null;
|
|
8
17
|
}
|
|
18
|
+
export {};
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
export * from "./rule-utils.js";
|
|
2
|
+
export * from "./herb-disable-comment-base.js";
|
|
2
3
|
export * from "./erb-comment-syntax.js";
|
|
4
|
+
export * from "./erb-no-case-node-children.js";
|
|
3
5
|
export * from "./erb-no-empty-tags.js";
|
|
6
|
+
export * from "./erb-no-extra-newline.js";
|
|
7
|
+
export * from "./erb-no-extra-whitespace-inside-tags.js";
|
|
4
8
|
export * from "./erb-no-output-control-flow.js";
|
|
5
9
|
export * from "./erb-no-silent-tag-in-attribute-name.js";
|
|
6
10
|
export * from "./erb-prefer-image-tag-helper.js";
|
|
7
|
-
export * from "./erb-
|
|
11
|
+
export * from "./erb-require-trailing-newline.js";
|
|
12
|
+
export * from "./erb-require-whitespace-inside-tags.js";
|
|
13
|
+
export * from "./erb-right-trim.js";
|
|
14
|
+
export * from "./herb-disable-comment-valid-rule-name.js";
|
|
15
|
+
export * from "./herb-disable-comment-no-redundant-all.js";
|
|
16
|
+
export * from "./herb-disable-comment-no-duplicate-rules.js";
|
|
17
|
+
export * from "./herb-disable-comment-missing-rules.js";
|
|
18
|
+
export * from "./herb-disable-comment-malformed.js";
|
|
19
|
+
export * from "./herb-disable-comment-unnecessary.js";
|
|
8
20
|
export * from "./html-anchor-require-href.js";
|
|
9
21
|
export * from "./html-aria-label-is-well-formatted.js";
|
|
10
22
|
export * from "./html-aria-level-must-be-valid.js";
|
|
@@ -14,21 +26,25 @@ export * from "./html-attribute-double-quotes.js";
|
|
|
14
26
|
export * from "./html-attribute-equals-spacing.js";
|
|
15
27
|
export * from "./html-attribute-values-require-quotes.js";
|
|
16
28
|
export * from "./html-avoid-both-disabled-and-aria-disabled.js";
|
|
29
|
+
export * from "./html-body-only-elements.js";
|
|
17
30
|
export * from "./html-boolean-attributes-no-value.js";
|
|
31
|
+
export * from "./html-head-only-elements.js";
|
|
18
32
|
export * from "./html-iframe-has-title.js";
|
|
19
33
|
export * from "./html-img-require-alt.js";
|
|
34
|
+
export * from "./html-input-require-autocomplete.js";
|
|
20
35
|
export * from "./html-navigation-has-label.js";
|
|
21
36
|
export * from "./html-no-aria-hidden-on-focusable.js";
|
|
22
37
|
export * from "./html-no-block-inside-inline.js";
|
|
23
38
|
export * from "./html-no-duplicate-attributes.js";
|
|
24
39
|
export * from "./html-no-duplicate-ids.js";
|
|
40
|
+
export * from "./html-no-duplicate-meta-names.js";
|
|
25
41
|
export * from "./html-no-empty-attributes.js";
|
|
26
42
|
export * from "./html-no-empty-headings.js";
|
|
27
43
|
export * from "./html-no-nested-links.js";
|
|
28
44
|
export * from "./html-no-positive-tab-index.js";
|
|
29
45
|
export * from "./html-no-self-closing.js";
|
|
46
|
+
export * from "./html-no-space-in-tag.js";
|
|
30
47
|
export * from "./html-no-title-attribute.js";
|
|
48
|
+
export * from "./html-no-underscores-in-attribute-names.js";
|
|
31
49
|
export * from "./html-tag-name-lowercase.js";
|
|
32
50
|
export * from "./svg-tag-name-capitalization.js";
|
|
33
|
-
export * from "./html-no-underscores-in-attribute-names.js";
|
|
34
|
-
export * from "./erb-right-trim.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ParserRule } from "../types.js";
|
|
2
|
-
import type { LintOffense } from "../types.js";
|
|
2
|
+
import type { LintOffense, FullRuleConfig } from "../types.js";
|
|
3
3
|
import type { ParseResult } from "@herb-tools/core";
|
|
4
4
|
export declare class ParserNoErrorsRule extends ParserRule {
|
|
5
5
|
name: string;
|
|
6
|
+
get defaultConfig(): FullRuleConfig;
|
|
6
7
|
check(result: ParseResult): LintOffense[];
|
|
7
8
|
private herbErrorToLintOffense;
|
|
8
9
|
}
|