@herb-tools/linter 0.4.2 → 0.4.3
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 +16 -2
- package/dist/herb-lint.js +426 -116
- package/dist/herb-lint.js.map +1 -1
- package/dist/index.cjs +322 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +317 -63
- package/dist/index.js.map +1 -1
- package/dist/package.json +4 -4
- package/dist/src/cli/file-processor.js +2 -4
- package/dist/src/cli/file-processor.js.map +1 -1
- package/dist/src/default-rules.js +6 -0
- package/dist/src/default-rules.js.map +1 -1
- package/dist/src/linter.js +37 -6
- package/dist/src/linter.js.map +1 -1
- package/dist/src/rules/erb-no-empty-tags.js +4 -3
- package/dist/src/rules/erb-no-empty-tags.js.map +1 -1
- package/dist/src/rules/erb-no-output-control-flow.js +4 -3
- package/dist/src/rules/erb-no-output-control-flow.js.map +1 -1
- package/dist/src/rules/erb-prefer-image-tag-helper.js +93 -0
- package/dist/src/rules/erb-prefer-image-tag-helper.js.map +1 -0
- package/dist/src/rules/erb-require-whitespace-inside-tags.js +4 -3
- package/dist/src/rules/erb-require-whitespace-inside-tags.js.map +1 -1
- package/dist/src/rules/erb-requires-trailing-newline.js +22 -0
- package/dist/src/rules/erb-requires-trailing-newline.js.map +1 -0
- package/dist/src/rules/html-anchor-require-href.js +4 -3
- package/dist/src/rules/html-anchor-require-href.js.map +1 -1
- package/dist/src/rules/html-aria-attribute-must-be-valid.js +4 -3
- package/dist/src/rules/html-aria-attribute-must-be-valid.js.map +1 -1
- package/dist/src/rules/html-aria-level-must-be-valid.js +27 -0
- package/dist/src/rules/html-aria-level-must-be-valid.js.map +1 -0
- package/dist/src/rules/html-aria-role-heading-requires-level.js +4 -3
- 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 +4 -3
- package/dist/src/rules/html-aria-role-must-be-valid.js.map +1 -1
- package/dist/src/rules/html-attribute-double-quotes.js +4 -3
- package/dist/src/rules/html-attribute-double-quotes.js.map +1 -1
- package/dist/src/rules/html-attribute-values-require-quotes.js +4 -3
- package/dist/src/rules/html-attribute-values-require-quotes.js.map +1 -1
- package/dist/src/rules/html-boolean-attributes-no-value.js +4 -3
- package/dist/src/rules/html-boolean-attributes-no-value.js.map +1 -1
- package/dist/src/rules/html-img-require-alt.js +4 -3
- package/dist/src/rules/html-img-require-alt.js.map +1 -1
- package/dist/src/rules/html-no-block-inside-inline.js +4 -3
- package/dist/src/rules/html-no-block-inside-inline.js.map +1 -1
- package/dist/src/rules/html-no-duplicate-attributes.js +4 -3
- package/dist/src/rules/html-no-duplicate-attributes.js.map +1 -1
- package/dist/src/rules/html-no-duplicate-ids.js +4 -3
- package/dist/src/rules/html-no-duplicate-ids.js.map +1 -1
- package/dist/src/rules/html-no-empty-headings.js +4 -3
- package/dist/src/rules/html-no-empty-headings.js.map +1 -1
- package/dist/src/rules/html-no-nested-links.js +4 -3
- package/dist/src/rules/html-no-nested-links.js.map +1 -1
- package/dist/src/rules/html-tag-name-lowercase.js +4 -3
- package/dist/src/rules/html-tag-name-lowercase.js.map +1 -1
- package/dist/src/rules/index.js +3 -0
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/rule-utils.js +125 -2
- package/dist/src/rules/rule-utils.js.map +1 -1
- package/dist/src/rules/svg-tag-name-capitalization.js +4 -3
- package/dist/src/rules/svg-tag-name-capitalization.js.map +1 -1
- package/dist/src/types.js +15 -1
- package/dist/src/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/linter.d.ts +20 -5
- package/dist/types/rules/erb-no-empty-tags.d.ts +4 -3
- package/dist/types/rules/erb-no-output-control-flow.d.ts +4 -3
- package/dist/types/rules/erb-prefer-image-tag-helper.d.ts +7 -0
- package/dist/types/rules/erb-require-whitespace-inside-tags.d.ts +4 -3
- package/dist/types/rules/erb-requires-trailing-newline.d.ts +6 -0
- package/dist/types/rules/html-anchor-require-href.d.ts +4 -3
- package/dist/types/rules/html-aria-attribute-must-be-valid.d.ts +4 -3
- package/dist/types/rules/html-aria-level-must-be-valid.d.ts +7 -0
- package/dist/types/rules/html-aria-role-heading-requires-level.d.ts +4 -3
- package/dist/types/rules/html-aria-role-must-be-valid.d.ts +4 -3
- package/dist/types/rules/html-attribute-double-quotes.d.ts +4 -3
- package/dist/types/rules/html-attribute-values-require-quotes.d.ts +4 -3
- package/dist/types/rules/html-boolean-attributes-no-value.d.ts +4 -3
- package/dist/types/rules/html-img-require-alt.d.ts +4 -3
- package/dist/types/rules/html-no-block-inside-inline.d.ts +4 -3
- package/dist/types/rules/html-no-duplicate-attributes.d.ts +4 -3
- package/dist/types/rules/html-no-duplicate-ids.d.ts +4 -3
- package/dist/types/rules/html-no-empty-headings.d.ts +4 -3
- package/dist/types/rules/html-no-nested-links.d.ts +4 -3
- package/dist/types/rules/html-tag-name-lowercase.d.ts +4 -3
- package/dist/types/rules/index.d.ts +3 -0
- package/dist/types/rules/rule-utils.d.ts +73 -4
- package/dist/types/rules/svg-tag-name-capitalization.d.ts +4 -3
- package/dist/types/src/linter.d.ts +20 -5
- package/dist/types/src/rules/erb-no-empty-tags.d.ts +4 -3
- package/dist/types/src/rules/erb-no-output-control-flow.d.ts +4 -3
- package/dist/types/src/rules/erb-prefer-image-tag-helper.d.ts +7 -0
- package/dist/types/src/rules/erb-require-whitespace-inside-tags.d.ts +4 -3
- package/dist/types/src/rules/erb-requires-trailing-newline.d.ts +6 -0
- package/dist/types/src/rules/html-anchor-require-href.d.ts +4 -3
- package/dist/types/src/rules/html-aria-attribute-must-be-valid.d.ts +4 -3
- package/dist/types/src/rules/html-aria-level-must-be-valid.d.ts +7 -0
- package/dist/types/src/rules/html-aria-role-heading-requires-level.d.ts +4 -3
- package/dist/types/src/rules/html-aria-role-must-be-valid.d.ts +4 -3
- package/dist/types/src/rules/html-attribute-double-quotes.d.ts +4 -3
- package/dist/types/src/rules/html-attribute-values-require-quotes.d.ts +4 -3
- package/dist/types/src/rules/html-boolean-attributes-no-value.d.ts +4 -3
- package/dist/types/src/rules/html-img-require-alt.d.ts +4 -3
- package/dist/types/src/rules/html-no-block-inside-inline.d.ts +4 -3
- package/dist/types/src/rules/html-no-duplicate-attributes.d.ts +4 -3
- package/dist/types/src/rules/html-no-duplicate-ids.d.ts +4 -3
- package/dist/types/src/rules/html-no-empty-headings.d.ts +4 -3
- package/dist/types/src/rules/html-no-nested-links.d.ts +4 -3
- package/dist/types/src/rules/html-tag-name-lowercase.d.ts +4 -3
- package/dist/types/src/rules/index.d.ts +3 -0
- package/dist/types/src/rules/rule-utils.d.ts +73 -4
- package/dist/types/src/rules/svg-tag-name-capitalization.d.ts +4 -3
- package/dist/types/src/types.d.ts +49 -6
- package/dist/types/types.d.ts +49 -6
- package/docs/rules/README.md +4 -1
- package/docs/rules/erb-prefer-image-tag-helper.md +65 -0
- package/docs/rules/erb-requires-trailing-newline.md +37 -0
- package/docs/rules/html-anchor-require-href.md +1 -1
- package/docs/rules/html-aria-level-must-be-valid.md +37 -0
- package/package.json +4 -4
- package/src/cli/file-processor.ts +2 -4
- package/src/default-rules.ts +6 -0
- package/src/linter.ts +42 -8
- package/src/rules/erb-no-empty-tags.ts +5 -4
- package/src/rules/erb-no-output-control-flow.ts +6 -4
- package/src/rules/erb-prefer-image-tag-helper.ts +124 -0
- package/src/rules/erb-require-whitespace-inside-tags.ts +5 -4
- package/src/rules/erb-requires-trailing-newline.ts +27 -0
- package/src/rules/html-anchor-require-href.ts +5 -4
- package/src/rules/html-aria-attribute-must-be-valid.ts +5 -5
- package/src/rules/html-aria-level-must-be-valid.ts +42 -0
- package/src/rules/html-aria-role-heading-requires-level.ts +5 -4
- package/src/rules/html-aria-role-must-be-valid.ts +5 -4
- package/src/rules/html-attribute-double-quotes.ts +5 -4
- package/src/rules/html-attribute-values-require-quotes.ts +5 -4
- package/src/rules/html-boolean-attributes-no-value.ts +5 -4
- package/src/rules/html-img-require-alt.ts +5 -4
- package/src/rules/html-no-block-inside-inline.ts +5 -4
- package/src/rules/html-no-duplicate-attributes.ts +5 -4
- package/src/rules/html-no-duplicate-ids.ts +5 -5
- package/src/rules/html-no-empty-headings.ts +5 -4
- package/src/rules/html-no-nested-links.ts +5 -4
- package/src/rules/html-tag-name-lowercase.ts +5 -4
- package/src/rules/index.ts +3 -0
- package/src/rules/rule-utils.ts +156 -4
- package/src/rules/svg-tag-name-capitalization.ts +5 -4
- package/src/types.ts +60 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule-utils.js","sourceRoot":"","sources":["../../../src/rules/rule-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACR,MAAM,kBAAkB,CAAA;AAczB;;GAEG;AACH,MAAM,OAAgB,eAAgB,SAAQ,OAAO;IACnC,QAAQ,GAAkB,EAAE,CAAA;IAClC,QAAQ,CAAQ;IAE1B,YAAY,QAAgB;QAC1B,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,OAAe,EAAE,QAAkB,EAAE,WAAyB,OAAO;QAC3F,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,QAAQ;YACnB,IAAI,EAAE,IAAI,CAAC,QAAQ;YACnB,MAAM,EAAE,aAAa;YACrB,OAAO;YACP,QAAQ;YACR,QAAQ;SACT,CAAA;IACH,CAAC;IAED;;OAEG;IACO,UAAU,CAAC,OAAe,EAAE,QAAkB,EAAE,WAAyB,OAAO;QACxF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAA;IACrE,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAA4C;IACxE,OAAO,IAAI,CAAC,IAAI,KAAK,8BAA8B;QACjD,CAAC,CAAE,IAA6B,CAAC,UAAU;QAC3C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AC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAA;IACrE,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAc;QAClB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,CAAC;IAQD;;OAEG;IACO,gBAAgB,CAAC,MAAc,EAAE,QAAgB;QACzD,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;QACpD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACxC,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAA;QACzB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;QAEjD,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QACxC,MAAM,GAAG,GAAG,IAAI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAEtC,OAAO,IAAI,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACjC,CAAC;CACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseRuleVisitor, SVG_CAMEL_CASE_ELEMENTS, SVG_LOWERCASE_TO_CAMELCASE } from "./rule-utils.js";
|
|
2
|
+
import { ParserRule } from "../types.js";
|
|
2
3
|
class SVGTagNameCapitalizationVisitor extends BaseRuleVisitor {
|
|
3
4
|
insideSVG = false;
|
|
4
5
|
visitHTMLElementNode(node) {
|
|
@@ -46,10 +47,10 @@ class SVGTagNameCapitalizationVisitor extends BaseRuleVisitor {
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
export class SVGTagNameCapitalizationRule {
|
|
50
|
+
export class SVGTagNameCapitalizationRule extends ParserRule {
|
|
50
51
|
name = "svg-tag-name-capitalization";
|
|
51
|
-
check(node) {
|
|
52
|
-
const visitor = new SVGTagNameCapitalizationVisitor(this.name);
|
|
52
|
+
check(node, context) {
|
|
53
|
+
const visitor = new SVGTagNameCapitalizationVisitor(this.name, context);
|
|
53
54
|
visitor.visit(node);
|
|
54
55
|
return visitor.offenses;
|
|
55
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg-tag-name-capitalization.js","sourceRoot":"","sources":["../../../src/rules/svg-tag-name-capitalization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"svg-tag-name-capitalization.js","sourceRoot":"","sources":["../../../src/rules/svg-tag-name-capitalization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAEtG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAIxC,MAAM,+BAAgC,SAAQ,eAAe;IACnD,SAAS,GAAG,KAAK,CAAA;IAEzB,oBAAoB,CAAC,IAAqB;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAA;QAEpC,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;YACvD,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAA;YACnC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;YACrB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;YAC1B,IAAI,CAAC,SAAS,GAAG,YAAY,CAAA;YAC7B,OAAM;QACR,CAAC;QAED,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,QAA2B,CAAC,CAAA;Y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AA6B,SAAQ,UAAU;IAC1D,IAAI,GAAG,6BAA6B,CAAA;IAEpC,KAAK,CAAC,IAAU,EAAE,OAA8B;QAC9C,MAAM,OAAO,GAAG,IAAI,+BAA+B,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;QACvE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACnB,OAAO,OAAO,CAAC,QAAQ,CAAA;IACzB,CAAC;CACF"}
|
package/dist/src/types.js
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export class ParserRule {
|
|
2
|
+
static type = "parser";
|
|
3
|
+
}
|
|
4
|
+
export class LexerRule {
|
|
5
|
+
static type = "lexer";
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Default context object with all keys defined but set to undefined
|
|
9
|
+
*/
|
|
10
|
+
export const DEFAULT_LINT_CONTEXT = {
|
|
11
|
+
fileName: undefined
|
|
12
|
+
};
|
|
13
|
+
export class SourceRule {
|
|
14
|
+
static type = "source";
|
|
15
|
+
}
|
|
2
16
|
//# sourceMappingURL=types.js.map
|
package/dist/src/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAsBA,MAAM,OAAgB,UAAU;IAC9B,MAAM,CAAC,IAAI,GAAG,QAAiB,CAAA;;AAKjC,MAAM,OAAgB,SAAS;IAC7B,MAAM,CAAC,IAAI,GAAG,OAAgB,CAAA;;AAkBhC;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC/C,QAAQ,EAAE,SAAS;CACX,CAAA;AAEV,MAAM,OAAgB,UAAU;IAC9B,MAAM,CAAC,IAAI,GAAG,QAAiB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/cli.ts","../src/default-rules.ts","../src/herb-lint.ts","../src/index.ts","../src/linter.ts","../src/types.ts","../src/cli/argument-parser.ts","../src/cli/file-processor.ts","../src/cli/index.ts","../src/cli/summary-reporter.ts","../src/cli/formatters/base-formatter.ts","../src/cli/formatters/detailed-formatter.ts","../src/cli/formatters/index.ts","../src/cli/formatters/simple-formatter.ts","../src/rules/erb-no-empty-tags.ts","../src/rules/erb-no-output-control-flow.ts","../src/rules/erb-require-whitespace-inside-tags.ts","../src/rules/html-anchor-require-href.ts","../src/rules/html-aria-attribute-must-be-valid.ts","../src/rules/html-aria-role-heading-requires-level.ts","../src/rules/html-aria-role-must-be-valid.ts","../src/rules/html-attribute-double-quotes.ts","../src/rules/html-attribute-values-require-quotes.ts","../src/rules/html-boolean-attributes-no-value.ts","../src/rules/html-img-require-alt.ts","../src/rules/html-no-block-inside-inline.ts","../src/rules/html-no-duplicate-attributes.ts","../src/rules/html-no-duplicate-ids.ts","../src/rules/html-no-empty-headings.ts","../src/rules/html-no-nested-links.ts","../src/rules/html-tag-name-lowercase.ts","../src/rules/index.ts","../src/rules/rule-utils.ts","../src/rules/svg-tag-name-capitalization.ts"],"version":"5.8.3"}
|
|
1
|
+
{"root":["../src/cli.ts","../src/default-rules.ts","../src/herb-lint.ts","../src/index.ts","../src/linter.ts","../src/types.ts","../src/cli/argument-parser.ts","../src/cli/file-processor.ts","../src/cli/index.ts","../src/cli/summary-reporter.ts","../src/cli/formatters/base-formatter.ts","../src/cli/formatters/detailed-formatter.ts","../src/cli/formatters/index.ts","../src/cli/formatters/simple-formatter.ts","../src/rules/erb-no-empty-tags.ts","../src/rules/erb-no-output-control-flow.ts","../src/rules/erb-prefer-image-tag-helper.ts","../src/rules/erb-require-whitespace-inside-tags.ts","../src/rules/erb-requires-trailing-newline.ts","../src/rules/html-anchor-require-href.ts","../src/rules/html-aria-attribute-must-be-valid.ts","../src/rules/html-aria-level-must-be-valid.ts","../src/rules/html-aria-role-heading-requires-level.ts","../src/rules/html-aria-role-must-be-valid.ts","../src/rules/html-attribute-double-quotes.ts","../src/rules/html-attribute-values-require-quotes.ts","../src/rules/html-boolean-attributes-no-value.ts","../src/rules/html-img-require-alt.ts","../src/rules/html-no-block-inside-inline.ts","../src/rules/html-no-duplicate-attributes.ts","../src/rules/html-no-duplicate-ids.ts","../src/rules/html-no-empty-headings.ts","../src/rules/html-no-nested-links.ts","../src/rules/html-tag-name-lowercase.ts","../src/rules/index.ts","../src/rules/rule-utils.ts","../src/rules/svg-tag-name-capitalization.ts"],"version":"5.8.3"}
|
package/dist/types/linter.d.ts
CHANGED
|
@@ -1,18 +1,33 @@
|
|
|
1
|
-
import type { RuleClass, LintResult } from "./types.js";
|
|
2
|
-
import type {
|
|
1
|
+
import type { RuleClass, LintResult, LintContext } from "./types.js";
|
|
2
|
+
import type { HerbBackend } from "@herb-tools/core";
|
|
3
3
|
export declare class Linter {
|
|
4
4
|
private rules;
|
|
5
|
+
private herb;
|
|
5
6
|
private offenses;
|
|
6
7
|
/**
|
|
7
8
|
* Creates a new Linter instance.
|
|
8
|
-
* @param
|
|
9
|
+
* @param herb - The Herb backend instance for parsing and lexing
|
|
10
|
+
* @param rules - Array of rule classes (Parser/AST or Lexer) to use. If not provided, uses default rules.
|
|
9
11
|
*/
|
|
10
|
-
constructor(rules?: RuleClass[]);
|
|
12
|
+
constructor(herb: HerbBackend, rules?: RuleClass[]);
|
|
11
13
|
/**
|
|
12
14
|
* Returns the default set of rule classes used by the linter.
|
|
13
15
|
* @returns Array of rule classes
|
|
14
16
|
*/
|
|
15
17
|
private getDefaultRules;
|
|
16
18
|
getRuleCount(): number;
|
|
17
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Type guard to check if a rule is a LexerRule
|
|
21
|
+
*/
|
|
22
|
+
private isLexerRule;
|
|
23
|
+
/**
|
|
24
|
+
* Type guard to check if a rule is a SourceRule
|
|
25
|
+
*/
|
|
26
|
+
private isSourceRule;
|
|
27
|
+
/**
|
|
28
|
+
* Lint source code using Parser/AST, Lexer, and Source rules.
|
|
29
|
+
* @param source - The source code to lint
|
|
30
|
+
* @param context - Optional context for linting (e.g., fileName for distinguishing files vs snippets)
|
|
31
|
+
*/
|
|
32
|
+
lint(source: string, context?: Partial<LintContext>): LintResult;
|
|
18
33
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class ERBNoEmptyTagsRule
|
|
4
|
+
export declare class ERBNoEmptyTagsRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Node } from "@herb-tools/core";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { ParserRule } from "../types.js";
|
|
3
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
4
|
+
export declare class ERBNoOutputControlFlowRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
3
|
+
import type { Node } from "@herb-tools/core";
|
|
4
|
+
export declare class ERBPreferImageTagHelperRule extends ParserRule {
|
|
5
|
+
name: string;
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
7
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Node } from "@herb-tools/core";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { ParserRule } from "../types.js";
|
|
3
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
4
|
+
export declare class ERBRequireWhitespaceRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SourceRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
3
|
+
export declare class ERBRequiresTrailingNewlineRule extends SourceRule {
|
|
4
|
+
name: string;
|
|
5
|
+
check(source: string, context?: Partial<LintContext>): LintOffense[];
|
|
6
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLAnchorRequireHrefRule
|
|
4
|
+
export declare class HTMLAnchorRequireHrefRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLAriaAttributeMustBeValid
|
|
4
|
+
export declare class HTMLAriaAttributeMustBeValid extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
3
|
+
import type { Node } from "@herb-tools/core";
|
|
4
|
+
export declare class HTMLAriaLevelMustBeValidRule extends ParserRule {
|
|
5
|
+
name: string;
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
7
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLAriaRoleHeadingRequiresLevelRule
|
|
4
|
+
export declare class HTMLAriaRoleHeadingRequiresLevelRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLAriaRoleMustBeValidRule
|
|
4
|
+
export declare class HTMLAriaRoleMustBeValidRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLAttributeDoubleQuotesRule
|
|
4
|
+
export declare class HTMLAttributeDoubleQuotesRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLAttributeValuesRequireQuotesRule
|
|
4
|
+
export declare class HTMLAttributeValuesRequireQuotesRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLBooleanAttributesNoValueRule
|
|
4
|
+
export declare class HTMLBooleanAttributesNoValueRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLImgRequireAltRule
|
|
4
|
+
export declare class HTMLImgRequireAltRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLNoBlockInsideInlineRule
|
|
4
|
+
export declare class HTMLNoBlockInsideInlineRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLNoDuplicateAttributesRule
|
|
4
|
+
export declare class HTMLNoDuplicateAttributesRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ParserRule } from "../types";
|
|
1
2
|
import type { Node } from "@herb-tools/core";
|
|
2
|
-
import type { LintOffense,
|
|
3
|
-
export declare class HTMLNoDuplicateIdsRule
|
|
3
|
+
import type { LintOffense, LintContext } from "../types";
|
|
4
|
+
export declare class HTMLNoDuplicateIdsRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLNoEmptyHeadingsRule
|
|
4
|
+
export declare class HTMLNoEmptyHeadingsRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLNoNestedLinksRule
|
|
4
|
+
export declare class HTMLNoNestedLinksRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLTagNameLowercaseRule
|
|
4
|
+
export declare class HTMLTagNameLowercaseRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from "./erb-no-empty-tags.js";
|
|
2
2
|
export * from "./erb-no-output-control-flow.js";
|
|
3
|
+
export * from "./erb-prefer-image-tag-helper.js";
|
|
4
|
+
export * from "./erb-requires-trailing-newline.js";
|
|
3
5
|
export * from "./html-anchor-require-href.js";
|
|
6
|
+
export * from "./html-aria-level-must-be-valid.js";
|
|
4
7
|
export * from "./html-aria-role-heading-requires-level.js";
|
|
5
8
|
export * from "./html-aria-role-must-be-valid.js";
|
|
6
9
|
export * from "./html-attribute-double-quotes.js";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { Visitor } from "@herb-tools/core";
|
|
2
|
-
import type { HTMLAttributeNode, HTMLOpenTagNode, HTMLSelfCloseTagNode,
|
|
3
|
-
import type { LintOffense, LintSeverity } from "../types.js";
|
|
1
|
+
import { Visitor, Location } from "@herb-tools/core";
|
|
2
|
+
import type { HTMLAttributeNode, HTMLOpenTagNode, HTMLSelfCloseTagNode, LexResult, Token } from "@herb-tools/core";
|
|
3
|
+
import type { LintOffense, LintSeverity, LintContext } from "../types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Base visitor class that provides common functionality for rule visitors
|
|
6
6
|
*/
|
|
7
7
|
export declare abstract class BaseRuleVisitor extends Visitor {
|
|
8
8
|
readonly offenses: LintOffense[];
|
|
9
9
|
protected ruleName: string;
|
|
10
|
-
|
|
10
|
+
protected context: LintContext;
|
|
11
|
+
constructor(ruleName: string, context?: Partial<LintContext>);
|
|
11
12
|
/**
|
|
12
13
|
* Helper method to create a lint offense
|
|
13
14
|
*/
|
|
@@ -67,6 +68,10 @@ export declare const SVG_CAMEL_CASE_ELEMENTS: Set<string>;
|
|
|
67
68
|
export declare const SVG_LOWERCASE_TO_CAMELCASE: Map<string, string>;
|
|
68
69
|
export declare const VALID_ARIA_ROLES: Set<string>;
|
|
69
70
|
export declare const ARIA_ATTRIBUTES: Set<string>;
|
|
71
|
+
/**
|
|
72
|
+
* Helper function to create a location at the end of the source with a 1-character range
|
|
73
|
+
*/
|
|
74
|
+
export declare function createEndOfFileLocation(source: string): Location;
|
|
70
75
|
/**
|
|
71
76
|
* Checks if an element is inline
|
|
72
77
|
*/
|
|
@@ -85,6 +90,7 @@ export declare function isBooleanAttribute(attributeName: string): boolean;
|
|
|
85
90
|
* and attribute iteration logic. Provides simplified interface with extracted attribute info.
|
|
86
91
|
*/
|
|
87
92
|
export declare abstract class AttributeVisitorMixin extends BaseRuleVisitor {
|
|
93
|
+
constructor(ruleName: string, context?: Partial<LintContext>);
|
|
88
94
|
visitHTMLOpenTagNode(node: HTMLOpenTagNode): void;
|
|
89
95
|
visitHTMLSelfCloseTagNode(node: HTMLSelfCloseTagNode): void;
|
|
90
96
|
private checkAttributesOnNode;
|
|
@@ -98,3 +104,66 @@ export declare function isAttributeValueQuoted(attributeNode: HTMLAttributeNode)
|
|
|
98
104
|
* Iterates over all attributes of a tag node, calling the callback for each attribute
|
|
99
105
|
*/
|
|
100
106
|
export declare function forEachAttribute(node: HTMLOpenTagNode | HTMLSelfCloseTagNode, callback: (attributeNode: HTMLAttributeNode) => void): void;
|
|
107
|
+
/**
|
|
108
|
+
* Base lexer visitor class that provides common functionality for lexer-based rule visitors
|
|
109
|
+
*/
|
|
110
|
+
export declare abstract class BaseLexerRuleVisitor {
|
|
111
|
+
readonly offenses: LintOffense[];
|
|
112
|
+
protected ruleName: string;
|
|
113
|
+
protected context: LintContext;
|
|
114
|
+
constructor(ruleName: string, context?: Partial<LintContext>);
|
|
115
|
+
/**
|
|
116
|
+
* Helper method to create a lint offense for lexer rules
|
|
117
|
+
*/
|
|
118
|
+
protected createOffense(message: string, location: Location, severity?: LintSeverity): LintOffense;
|
|
119
|
+
/**
|
|
120
|
+
* Helper method to add an offense to the offenses array
|
|
121
|
+
*/
|
|
122
|
+
protected addOffense(message: string, location: Location, severity?: LintSeverity): void;
|
|
123
|
+
/**
|
|
124
|
+
* Main entry point for lexer rule visitors
|
|
125
|
+
* @param lexResult - The lexer result containing tokens and source
|
|
126
|
+
*/
|
|
127
|
+
visit(lexResult: LexResult): void;
|
|
128
|
+
/**
|
|
129
|
+
* Visit all tokens
|
|
130
|
+
* Override this method to implement token-level checks
|
|
131
|
+
*/
|
|
132
|
+
protected visitTokens(tokens: Token[]): void;
|
|
133
|
+
/**
|
|
134
|
+
* Visit individual tokens
|
|
135
|
+
* Override this method to implement per-token checks
|
|
136
|
+
*/
|
|
137
|
+
protected visitToken(_token: Token): void;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Base source visitor class that provides common functionality for source-based rule visitors
|
|
141
|
+
*/
|
|
142
|
+
export declare abstract class BaseSourceRuleVisitor {
|
|
143
|
+
readonly offenses: LintOffense[];
|
|
144
|
+
protected ruleName: string;
|
|
145
|
+
protected context: LintContext;
|
|
146
|
+
constructor(ruleName: string, context?: Partial<LintContext>);
|
|
147
|
+
/**
|
|
148
|
+
* Helper method to create a lint offense for source rules
|
|
149
|
+
*/
|
|
150
|
+
protected createOffense(message: string, location: Location, severity?: LintSeverity): LintOffense;
|
|
151
|
+
/**
|
|
152
|
+
* Helper method to add an offense to the offenses array
|
|
153
|
+
*/
|
|
154
|
+
protected addOffense(message: string, location: Location, severity?: LintSeverity): void;
|
|
155
|
+
/**
|
|
156
|
+
* Main entry point for source rule visitors
|
|
157
|
+
* @param source - The raw source code
|
|
158
|
+
*/
|
|
159
|
+
visit(source: string): void;
|
|
160
|
+
/**
|
|
161
|
+
* Visit the source code directly
|
|
162
|
+
* Override this method to implement source-level checks
|
|
163
|
+
*/
|
|
164
|
+
protected abstract visitSource(source: string): void;
|
|
165
|
+
/**
|
|
166
|
+
* Helper method to create a location for a specific position in the source
|
|
167
|
+
*/
|
|
168
|
+
protected createLocationAt(source: string, position: number): Location;
|
|
169
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class SVGTagNameCapitalizationRule
|
|
4
|
+
export declare class SVGTagNameCapitalizationRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,18 +1,33 @@
|
|
|
1
|
-
import type { RuleClass, LintResult } from "./types.js";
|
|
2
|
-
import type {
|
|
1
|
+
import type { RuleClass, LintResult, LintContext } from "./types.js";
|
|
2
|
+
import type { HerbBackend } from "@herb-tools/core";
|
|
3
3
|
export declare class Linter {
|
|
4
4
|
private rules;
|
|
5
|
+
private herb;
|
|
5
6
|
private offenses;
|
|
6
7
|
/**
|
|
7
8
|
* Creates a new Linter instance.
|
|
8
|
-
* @param
|
|
9
|
+
* @param herb - The Herb backend instance for parsing and lexing
|
|
10
|
+
* @param rules - Array of rule classes (Parser/AST or Lexer) to use. If not provided, uses default rules.
|
|
9
11
|
*/
|
|
10
|
-
constructor(rules?: RuleClass[]);
|
|
12
|
+
constructor(herb: HerbBackend, rules?: RuleClass[]);
|
|
11
13
|
/**
|
|
12
14
|
* Returns the default set of rule classes used by the linter.
|
|
13
15
|
* @returns Array of rule classes
|
|
14
16
|
*/
|
|
15
17
|
private getDefaultRules;
|
|
16
18
|
getRuleCount(): number;
|
|
17
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Type guard to check if a rule is a LexerRule
|
|
21
|
+
*/
|
|
22
|
+
private isLexerRule;
|
|
23
|
+
/**
|
|
24
|
+
* Type guard to check if a rule is a SourceRule
|
|
25
|
+
*/
|
|
26
|
+
private isSourceRule;
|
|
27
|
+
/**
|
|
28
|
+
* Lint source code using Parser/AST, Lexer, and Source rules.
|
|
29
|
+
* @param source - The source code to lint
|
|
30
|
+
* @param context - Optional context for linting (e.g., fileName for distinguishing files vs snippets)
|
|
31
|
+
*/
|
|
32
|
+
lint(source: string, context?: Partial<LintContext>): LintResult;
|
|
18
33
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class ERBNoEmptyTagsRule
|
|
4
|
+
export declare class ERBNoEmptyTagsRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Node } from "@herb-tools/core";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { ParserRule } from "../types.js";
|
|
3
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
4
|
+
export declare class ERBNoOutputControlFlowRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
3
|
+
import type { Node } from "@herb-tools/core";
|
|
4
|
+
export declare class ERBPreferImageTagHelperRule extends ParserRule {
|
|
5
|
+
name: string;
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
7
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Node } from "@herb-tools/core";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { ParserRule } from "../types.js";
|
|
3
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
4
|
+
export declare class ERBRequireWhitespaceRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SourceRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
3
|
+
export declare class ERBRequiresTrailingNewlineRule extends SourceRule {
|
|
4
|
+
name: string;
|
|
5
|
+
check(source: string, context?: Partial<LintContext>): LintOffense[];
|
|
6
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParserRule } from "../types.js";
|
|
2
|
+
import type { LintOffense, LintContext } from "../types.js";
|
|
2
3
|
import type { Node } from "@herb-tools/core";
|
|
3
|
-
export declare class HTMLAnchorRequireHrefRule
|
|
4
|
+
export declare class HTMLAnchorRequireHrefRule extends ParserRule {
|
|
4
5
|
name: string;
|
|
5
|
-
check(node: Node): LintOffense[];
|
|
6
|
+
check(node: Node, context?: Partial<LintContext>): LintOffense[];
|
|
6
7
|
}
|