@html-eslint/eslint-plugin 0.35.1 → 0.36.0-alpha.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.
Files changed (143) hide show
  1. package/lib/exports.ts +2 -0
  2. package/lib/index.js +6 -1
  3. package/lib/types/{rule.d.ts → rule.ts} +1 -1
  4. package/package.json +10 -8
  5. package/types/configs/recommended.d.ts +20 -0
  6. package/types/configs/recommended.d.ts.map +1 -0
  7. package/types/constants/index.d.ts +5 -0
  8. package/types/constants/index.d.ts.map +1 -0
  9. package/types/constants/obsolete-tags.d.ts +3 -0
  10. package/types/constants/obsolete-tags.d.ts.map +1 -0
  11. package/types/constants/rule-category.d.ts +5 -0
  12. package/types/constants/rule-category.d.ts.map +1 -0
  13. package/types/constants/svg-camel-case-attributes.d.ts +3 -0
  14. package/types/constants/svg-camel-case-attributes.d.ts.map +1 -0
  15. package/types/constants/void-elements.d.ts +3 -0
  16. package/types/constants/void-elements.d.ts.map +1 -0
  17. package/types/exports.d.ts +3 -0
  18. package/types/exports.d.ts.map +1 -0
  19. package/types/index.d.ts +89 -0
  20. package/types/index.d.ts.map +1 -0
  21. package/types/rules/attrs-newline.d.ts +17 -0
  22. package/types/rules/attrs-newline.d.ts.map +1 -0
  23. package/types/rules/element-newline.d.ts +22 -0
  24. package/types/rules/element-newline.d.ts.map +1 -0
  25. package/types/rules/id-naming-convention.d.ts +15 -0
  26. package/types/rules/id-naming-convention.d.ts.map +1 -0
  27. package/types/rules/indent/indent-level.d.ts +55 -0
  28. package/types/rules/indent/indent-level.d.ts.map +1 -0
  29. package/types/rules/indent/indent.d.ts +38 -0
  30. package/types/rules/indent/indent.d.ts.map +1 -0
  31. package/types/rules/indent/index.d.ts +3 -0
  32. package/types/rules/indent/index.d.ts.map +1 -0
  33. package/types/rules/index.d.ts +68 -0
  34. package/types/rules/index.d.ts.map +1 -0
  35. package/types/rules/lowercase.d.ts +10 -0
  36. package/types/rules/lowercase.d.ts.map +1 -0
  37. package/types/rules/max-element-depth.d.ts +13 -0
  38. package/types/rules/max-element-depth.d.ts.map +1 -0
  39. package/types/rules/no-abstract-roles.d.ts +10 -0
  40. package/types/rules/no-abstract-roles.d.ts.map +1 -0
  41. package/types/rules/no-accesskey-attrs.d.ts +10 -0
  42. package/types/rules/no-accesskey-attrs.d.ts.map +1 -0
  43. package/types/rules/no-aria-hidden-body.d.ts +7 -0
  44. package/types/rules/no-aria-hidden-body.d.ts.map +1 -0
  45. package/types/rules/no-duplicate-attrs.d.ts +10 -0
  46. package/types/rules/no-duplicate-attrs.d.ts.map +1 -0
  47. package/types/rules/no-duplicate-id.d.ts +11 -0
  48. package/types/rules/no-duplicate-id.d.ts.map +1 -0
  49. package/types/rules/no-extra-spacing-attrs.d.ts +24 -0
  50. package/types/rules/no-extra-spacing-attrs.d.ts.map +1 -0
  51. package/types/rules/no-extra-spacing-text.d.ts +16 -0
  52. package/types/rules/no-extra-spacing-text.d.ts.map +1 -0
  53. package/types/rules/no-heading-inside-button.d.ts +7 -0
  54. package/types/rules/no-heading-inside-button.d.ts.map +1 -0
  55. package/types/rules/no-inline-styles.d.ts +7 -0
  56. package/types/rules/no-inline-styles.d.ts.map +1 -0
  57. package/types/rules/no-invalid-role.d.ts +7 -0
  58. package/types/rules/no-invalid-role.d.ts.map +1 -0
  59. package/types/rules/no-multiple-empty-lines.d.ts +14 -0
  60. package/types/rules/no-multiple-empty-lines.d.ts.map +1 -0
  61. package/types/rules/no-multiple-h1.d.ts +8 -0
  62. package/types/rules/no-multiple-h1.d.ts.map +1 -0
  63. package/types/rules/no-nested-interactive.d.ts +8 -0
  64. package/types/rules/no-nested-interactive.d.ts.map +1 -0
  65. package/types/rules/no-non-scalable-viewport.d.ts +7 -0
  66. package/types/rules/no-non-scalable-viewport.d.ts.map +1 -0
  67. package/types/rules/no-obsolete-tags.d.ts +7 -0
  68. package/types/rules/no-obsolete-tags.d.ts.map +1 -0
  69. package/types/rules/no-positive-tabindex.d.ts +10 -0
  70. package/types/rules/no-positive-tabindex.d.ts.map +1 -0
  71. package/types/rules/no-restricted-attr-values.d.ts +16 -0
  72. package/types/rules/no-restricted-attr-values.d.ts.map +1 -0
  73. package/types/rules/no-restricted-attrs.d.ts +16 -0
  74. package/types/rules/no-restricted-attrs.d.ts.map +1 -0
  75. package/types/rules/no-script-style-type.d.ts +10 -0
  76. package/types/rules/no-script-style-type.d.ts.map +1 -0
  77. package/types/rules/no-skip-heading-levels.d.ts +8 -0
  78. package/types/rules/no-skip-heading-levels.d.ts.map +1 -0
  79. package/types/rules/no-target-blank.d.ts +7 -0
  80. package/types/rules/no-target-blank.d.ts.map +1 -0
  81. package/types/rules/no-trailing-spaces.d.ts +9 -0
  82. package/types/rules/no-trailing-spaces.d.ts.map +1 -0
  83. package/types/rules/prefer-https.d.ts +11 -0
  84. package/types/rules/prefer-https.d.ts.map +1 -0
  85. package/types/rules/quotes.d.ts +13 -0
  86. package/types/rules/quotes.d.ts.map +1 -0
  87. package/types/rules/require-attrs.d.ts +15 -0
  88. package/types/rules/require-attrs.d.ts.map +1 -0
  89. package/types/rules/require-button-type.d.ts +7 -0
  90. package/types/rules/require-button-type.d.ts.map +1 -0
  91. package/types/rules/require-closing-tags.d.ts +12 -0
  92. package/types/rules/require-closing-tags.d.ts.map +1 -0
  93. package/types/rules/require-doctype.d.ts +7 -0
  94. package/types/rules/require-doctype.d.ts.map +1 -0
  95. package/types/rules/require-explicit-size.d.ts +13 -0
  96. package/types/rules/require-explicit-size.d.ts.map +1 -0
  97. package/types/rules/require-form-method.d.ts +7 -0
  98. package/types/rules/require-form-method.d.ts.map +1 -0
  99. package/types/rules/require-frame-title.d.ts +7 -0
  100. package/types/rules/require-frame-title.d.ts.map +1 -0
  101. package/types/rules/require-img-alt.d.ts +11 -0
  102. package/types/rules/require-img-alt.d.ts.map +1 -0
  103. package/types/rules/require-input-label.d.ts +8 -0
  104. package/types/rules/require-input-label.d.ts.map +1 -0
  105. package/types/rules/require-lang.d.ts +7 -0
  106. package/types/rules/require-lang.d.ts.map +1 -0
  107. package/types/rules/require-li-container.d.ts +7 -0
  108. package/types/rules/require-li-container.d.ts.map +1 -0
  109. package/types/rules/require-meta-charset.d.ts +9 -0
  110. package/types/rules/require-meta-charset.d.ts.map +1 -0
  111. package/types/rules/require-meta-description.d.ts +9 -0
  112. package/types/rules/require-meta-description.d.ts.map +1 -0
  113. package/types/rules/require-meta-viewport.d.ts +9 -0
  114. package/types/rules/require-meta-viewport.d.ts.map +1 -0
  115. package/types/rules/require-open-graph-protocol.d.ts +10 -0
  116. package/types/rules/require-open-graph-protocol.d.ts.map +1 -0
  117. package/types/rules/require-title.d.ts +10 -0
  118. package/types/rules/require-title.d.ts.map +1 -0
  119. package/types/rules/sort-attrs.d.ts +13 -0
  120. package/types/rules/sort-attrs.d.ts.map +1 -0
  121. package/types/rules/utils/array.d.ts +17 -0
  122. package/types/rules/utils/array.d.ts.map +1 -0
  123. package/types/rules/utils/naming.d.ts +25 -0
  124. package/types/rules/utils/naming.d.ts.map +1 -0
  125. package/types/rules/utils/node.d.ts +119 -0
  126. package/types/rules/utils/node.d.ts.map +1 -0
  127. package/types/rules/utils/settings.d.ts +19 -0
  128. package/types/rules/utils/settings.d.ts.map +1 -0
  129. package/types/rules/utils/source-code.d.ts +14 -0
  130. package/types/rules/utils/source-code.d.ts.map +1 -0
  131. package/types/rules/utils/visitors.d.ts +10 -0
  132. package/types/rules/utils/visitors.d.ts.map +1 -0
  133. package/types/types/ast.d.ts +16 -0
  134. package/types/types/ast.d.ts.map +1 -0
  135. package/types/types/index.d.ts +4 -0
  136. package/types/types/index.d.ts.map +1 -0
  137. package/types/types/rule.d.ts +97 -0
  138. package/types/types/rule.d.ts.map +1 -0
  139. package/types/types/settings.d.ts +13 -0
  140. package/types/types/settings.d.ts.map +1 -0
  141. /package/lib/types/{ast.d.ts → ast.ts} +0 -0
  142. /package/lib/types/{index.d.ts → index.ts} +0 -0
  143. /package/lib/types/{settings.d.ts → settings.ts} +0 -0
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Checks a given name follows `kebab-case` or not.
3
+ * @param {string} name name to check
4
+ * @returns {boolean} `true` if a name follows `kebab-case`, otherwise `false`.
5
+ */
6
+ export function isKebabCase(name: string): boolean;
7
+ /**
8
+ * Checks a given name follows `snake_case` or not.
9
+ * @param {string} name name to check
10
+ * @returns {boolean} `true` if a name follows `snake_case`, otherwise `false`.
11
+ */
12
+ export function isSnakeCase(name: string): boolean;
13
+ /**
14
+ * Checks a given name follows `PascalCase` or not.
15
+ * @param {string} name name to check
16
+ * @returns {boolean} `true` if a name follows `PascalCase`, otherwise `false`.
17
+ */
18
+ export function isPascalCase(name: string): boolean;
19
+ /**
20
+ * Checks a given name follows `camelCase` or not.
21
+ * @param {string} name name to check
22
+ * @returns {boolean} `true` if a name follows `camelCase`, otherwise `false`.
23
+ */
24
+ export function isCamelCase(name: string): boolean;
25
+ //# sourceMappingURL=naming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../../../lib/rules/utils/naming.js"],"names":[],"mappings":"AAOE;;;;GAIG;AACH,kCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;GAIG;AACH,kCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;GAIG;AACH,mCAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;GAIG;AACH,kCAHW,MAAM,GACJ,OAAO,CAInB"}
@@ -0,0 +1,119 @@
1
+ export type Attribute = import("@html-eslint/types").Attribute;
2
+ export type Tag = import("@html-eslint/types").Tag;
3
+ export type ScriptTag = import("@html-eslint/types").ScriptTag;
4
+ export type StyleTag = import("@html-eslint/types").StyleTag;
5
+ export type AnyNode = import("@html-eslint/types").AnyNode;
6
+ export type Line = import("../../types").Line;
7
+ export type BaseNode = import("../../types").BaseNode;
8
+ export type Text = import("@html-eslint/types").Text;
9
+ export type CommentContent = import("@html-eslint/types").CommentContent;
10
+ export type Comment = import("@html-eslint/types").Comment;
11
+ export type AttributeValue = import("@html-eslint/types").AttributeValue;
12
+ export type AttributeKey = import("@html-eslint/types").AttributeKey;
13
+ export type TemplateText = import("@html-eslint/types").TemplateText;
14
+ export type OpenTemplate = import("@html-eslint/types").OpenTemplate;
15
+ export type CloseTemplate = import("@html-eslint/types").CloseTemplate;
16
+ export type Range = import("eslint").AST.Range;
17
+ export type SourceLocation = import("eslint").AST.SourceLocation;
18
+ export type AnyToken = import("es-html-parser").AnyToken;
19
+ /**
20
+ * @param {Tag | ScriptTag | StyleTag} node
21
+ * @param {string} key
22
+ * @returns {Attribute | undefined}
23
+ */
24
+ export function findAttr(node: Tag | ScriptTag | StyleTag, key: string): Attribute | undefined;
25
+ /**
26
+ * Checks whether a node's attributes is empty or not.
27
+ * @param {Tag | ScriptTag | StyleTag} node
28
+ * @returns {boolean}
29
+ */
30
+ export function isAttributesEmpty(node: Tag | ScriptTag | StyleTag): boolean;
31
+ /**
32
+ * Checks whether a node's all tokens are on the same line or not.
33
+ * @param {AnyNode} node A node to check
34
+ * @returns {boolean} `true` if a node's tokens are on the same line, otherwise `false`.
35
+ */
36
+ export function isNodeTokensOnSameLine(node: AnyNode): boolean;
37
+ /**
38
+ *
39
+ * @param {Text | CommentContent} node
40
+ * @returns {Line[]}
41
+ */
42
+ export function splitToLineNodes(node: Text | CommentContent): Line[];
43
+ /**
44
+ * Get location between two nodes.
45
+ * @param {{loc: SourceLocation}} before A node placed in before
46
+ * @param {{loc: SourceLocation}} after A node placed in after
47
+ * @returns {SourceLocation} location between two nodes.
48
+ */
49
+ export function getLocBetween(before: {
50
+ loc: SourceLocation;
51
+ }, after: {
52
+ loc: SourceLocation;
53
+ }): SourceLocation;
54
+ /**
55
+ * @param {AnyNode} node
56
+ * @param {(node: AnyNode) => boolean} predicate
57
+ * @returns {null | AnyNode}
58
+ */
59
+ export function findParent(node: AnyNode, predicate: (node: AnyNode) => boolean): null | AnyNode;
60
+ /**
61
+ * @param {BaseNode} node
62
+ * @returns {node is Tag}
63
+ */
64
+ export function isTag(node: BaseNode): node is Tag;
65
+ /**
66
+ * @param {BaseNode} node
67
+ * @returns {node is Comment}
68
+ */
69
+ export function isComment(node: BaseNode): node is Comment;
70
+ /**
71
+ * @param {BaseNode} node
72
+ * @returns {node is Text}
73
+ */
74
+ export function isText(node: BaseNode): node is Text;
75
+ /**
76
+ * @param {BaseNode} node
77
+ * @returns {node is Line}
78
+ */
79
+ export function isLine(node: BaseNode): node is Line;
80
+ /**
81
+ * @param {BaseNode} node
82
+ * @returns {node is ScriptTag}
83
+ */
84
+ export function isScript(node: BaseNode): node is ScriptTag;
85
+ /**
86
+ * @param {BaseNode} node
87
+ * @returns {node is StyleTag}
88
+ */
89
+ export function isStyle(node: BaseNode): node is StyleTag;
90
+ /**
91
+ * @param {(Text | CommentContent)['parts']} parts
92
+ * @param {Range} range
93
+ * @returns {boolean}
94
+ */
95
+ export function isOverlapWithTemplates(parts: (Text | CommentContent)["parts"], range: Range): boolean;
96
+ /**
97
+ * @param {string} source
98
+ * @returns {string[]}
99
+ */
100
+ export function codeToLines(source: string): string[];
101
+ /**
102
+ *
103
+ * @param {Range} rangeA
104
+ * @param {Range} rangeB
105
+ * @returns {boolean}
106
+ */
107
+ export function isRangesOverlap(rangeA: Range, rangeB: Range): boolean;
108
+ /**
109
+ *
110
+ * @param {AnyToken[]} tokens
111
+ * @returns {((CommentContent | Text)['parts'][number])[]}
112
+ */
113
+ export function getTemplateTokens(tokens: AnyToken[]): ((CommentContent | Text)["parts"][number])[];
114
+ /**
115
+ * @param {AttributeKey | AttributeValue | Text | CommentContent} node
116
+ * @returns {boolean}
117
+ */
118
+ export function hasTemplate(node: AttributeKey | AttributeValue | Text | CommentContent): boolean;
119
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../lib/rules/utils/node.js"],"names":[],"mappings":"wBACc,OAAO,oBAAoB,EAAE,SAAS;kBACtC,OAAO,oBAA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AI,OAAO,CAI3B;AAED;;;GAGG;AACH,6BAHW,QAAQ,GACN,IAAI,IAAI,IAAI,CAIxB;AAED;;;GAGG;AACH,6BAHW,QAAQ,GACN,IAAI,IAAI,IAAI,CAIxB;AAtCD;;;GAGG;AACH,+BAHW,QAAQ,GACN,IAAI,IAAI,SAAS,CAI7B;AAED;;;GAGG;AACH,8BAHW,QAAQ,GACN,IAAI,IAAI,QAAQ,CAI5B;AAnHD;;;;GAIG;AACH,8CAJW,CAAC,IAAI,GAAG,cAAc,CAAC,CAAC,OAAO,CAAC,SAChC,KAAK,GACH,OAAO,CAMnB;AAsID;;;GAGG;AACH,oCAHW,MAAM,GACJ,MAAM,EAAE,CAIpB;AA/JD;;;;;GAKG;AACH,wCAJW,KAAK,UACL,KAAK,GACH,OAAO,CAInB;AA+KD;;;;GAIG;AACH,0CAHW,QAAQ,EAAE,GACR,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAaxD;AAlLD;;;GAGG;AACH,kCAHW,YAAY,GAAG,cAAc,GAAG,IAAI,GAAG,cAAc,GACnD,OAAO,CAInB"}
@@ -0,0 +1,19 @@
1
+ export type MaybeHTMLSettings = import("../../types").MaybeHTMLSettings;
2
+ export type HTMLSettings = import("../../types").HTMLSettings;
3
+ export type Context = import("../../types").Context<any[]>;
4
+ export type TaggedTemplateExpression = import("@html-eslint/types").TaggedTemplateExpression;
5
+ export type TemplateLiteral = import("@html-eslint/types").TemplateLiteral;
6
+ /**
7
+ *
8
+ * @param {TemplateLiteral} node
9
+ * @param {Context} context
10
+ * @returns {boolean}
11
+ */
12
+ export function shouldCheckTemplateLiteral(node: TemplateLiteral, context: Context): boolean;
13
+ /**
14
+ * @param {TaggedTemplateExpression} node
15
+ * @param {Context} context
16
+ * @returns {boolean}
17
+ */
18
+ export function shouldCheckTaggedTemplateExpression(node: TaggedTemplateExpression, context: Context): boolean;
19
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../lib/rules/utils/settings.js"],"names":[],"mappings":"gCACa,OAAO,aAAa,EAAE,iBAAiB;2BACvC,OAAO,aAAa,EAAE,YAAY;sBAClC,OAAO,aAAa,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;uCACpC,OAAO,oBAAoB,EAAE,wBAAwB;8BACrD,OAAO,oBAAoB,EAAE,eAAe;AA8DzD;;;;;GAKG;AACH,iDAJW,eAAe,WACf,OAAO,GACL,OAAO,CAWnB;AA7BD;;;;GAIG;AACH,0DAJW,wBAAwB,WACxB,OAAO,GACL,OAAO,CASnB"}
@@ -0,0 +1,14 @@
1
+ export type Context = import("../../types").Context<any[]>;
2
+ /**
3
+ * @typedef {import("../../types").Context<any[]>} Context
4
+ */
5
+ /**
6
+ * @param {Context} context
7
+ */
8
+ export function getSourceCode(context: Context): import("@eslint/core").SourceCode<{
9
+ LangOptions: import("@eslint/core").LanguageOptions;
10
+ RootNode: unknown;
11
+ SyntaxElementWithLoc: unknown;
12
+ ConfigNode: unknown;
13
+ }> & import("eslint").SourceCode;
14
+ //# sourceMappingURL=source-code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-code.d.ts","sourceRoot":"","sources":["../../../lib/rules/utils/source-code.js"],"names":[],"mappings":"sBACa,OAAO,aAAa,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;AADjD;;GAEG;AAEH;;GAEG;AACH,uCAFW,OAAO;;;;;iCAIjB"}
@@ -0,0 +1,10 @@
1
+ export type Context = import("../../types").Context<any[]>;
2
+ export type RuleListener = import("../../types").RuleListener;
3
+ /**
4
+ * @param {Context} context
5
+ * @param {RuleListener} visitors
6
+ * @param {any} [templateVisitors]
7
+ * @returns {RuleListener}
8
+ */
9
+ export function createVisitors(context: Context, visitors: RuleListener, templateVisitors?: any): RuleListener;
10
+ //# sourceMappingURL=visitors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visitors.d.ts","sourceRoot":"","sources":["../../../lib/rules/utils/visitors.js"],"names":[],"mappings":"sBACc,OAAO,aAAa,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;2BACpC,OAAO,aAAa,EAAE,YAAY;AA8BhD;;;;;GAKG;AACH,wCALW,OAAO,YACP,YAAY,qBACZ,GAAG,GACD,YAAY,CAWxB"}
@@ -0,0 +1,16 @@
1
+ import eslint from "eslint";
2
+ /**
3
+ * This is not a node generated by es-html-parser; it is created by utils's splitToLineNodes.
4
+ */
5
+ export interface Line extends BaseNode {
6
+ type: "Line";
7
+ value: string;
8
+ hasTemplate: boolean;
9
+ }
10
+ export interface BaseNode {
11
+ parent?: BaseNode | null;
12
+ type: string;
13
+ range: eslint.AST.Range;
14
+ loc: eslint.AST.SourceLocation;
15
+ }
16
+ //# sourceMappingURL=ast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../lib/types/ast.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,IAAK,SAAQ,QAAQ;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;CAChC"}
@@ -0,0 +1,4 @@
1
+ export * from "./rule";
2
+ export * from "./settings";
3
+ export * from "./ast";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC"}
@@ -0,0 +1,97 @@
1
+ import eslint from "eslint";
2
+ import * as AST from "@html-eslint/types";
3
+ import * as estree from "estree";
4
+ import { Line } from "./ast";
5
+ type AnyNodeAndLine = AST.AnyNode | Line;
6
+ type PostFix<T, S extends string> = {
7
+ [K in keyof T as `${K & string}${S}`]: T[K];
8
+ };
9
+ interface BaseRuleListener {
10
+ Document?: (node: AST.Document) => void;
11
+ AttributeKey?: (node: AST.AttributeKey) => void;
12
+ Text?: (node: AST.Text) => void;
13
+ Tag?: (node: AST.Tag) => void;
14
+ OpenTagStart?: (node: AST.OpenTagStart) => void;
15
+ OpenTagEnd?: (node: AST.OpenTagEnd) => void;
16
+ CloseTag?: (node: AST.CloseTag) => void;
17
+ Attribute?: (node: AST.Attribute) => void;
18
+ AttributeValue?: (node: AST.AttributeValue) => void;
19
+ AttributeValueWrapperEnd?: (node: AST.AttributeValueWrapperEnd) => void;
20
+ AttributeValueWrapperStart?: (node: AST.AttributeValueWrapperStart) => void;
21
+ ScriptTag?: (node: AST.ScriptTag) => void;
22
+ OpenScriptTagStart?: (node: AST.OpenScriptTagStart) => void;
23
+ CloseScriptTag?: (node: AST.CloseScriptTag) => void;
24
+ OpenScriptTagEnd?: (node: AST.OpenScriptTagEnd) => void;
25
+ ScriptTagContent?: (node: AST.ScriptTagContent) => void;
26
+ StyleTag?: (node: AST.StyleTag) => void;
27
+ OpenStyleTagStart?: (node: AST.OpenStyleTagStart) => void;
28
+ OpenStyleTagEnd?: (node: AST.OpenStyleTagEnd) => void;
29
+ StyleTagContent?: (node: AST.StyleTagContent) => void;
30
+ CloseStyleTag?: (node: AST.CloseStyleTag) => void;
31
+ Comment?: (node: AST.Comment) => void;
32
+ CommentOpen?: (node: AST.CommentOpen) => void;
33
+ CommentClose?: (node: AST.CommentClose) => void;
34
+ CommentContent?: (node: AST.CommentContent) => void;
35
+ Doctype?: (node: AST.Doctype) => void;
36
+ DoctypeOpen?: (node: AST.DoctypeOpen) => void;
37
+ DoctypeClose?: (node: AST.DoctypeClose) => void;
38
+ DoctypeAttribute?: (node: AST.DoctypeAttribute) => void;
39
+ DoctypeAttributeValue?: (node: AST.DoctypeAttributeValue) => void;
40
+ DoctypeAttributeWrapperStart?: (node: AST.DoctypeAttributeWrapperStart) => void;
41
+ DoctypeAttributeWrapperEnd?: (node: AST.DoctypeAttributeWrapperEnd) => void;
42
+ TaggedTemplateExpression?: (node: AST.TaggedTemplateExpression) => void;
43
+ TemplateLiteral?: (node: AST.TemplateLiteral) => void;
44
+ }
45
+ interface RuleFix {
46
+ range: eslint.AST.Range;
47
+ text: string;
48
+ }
49
+ export interface RuleFixer {
50
+ insertTextAfter(nodeOrToken: AnyNodeAndLine, text: string): RuleFix;
51
+ insertTextAfterRange(range: eslint.AST.Range, text: string): RuleFix;
52
+ insertTextBefore(nodeOrToken: AnyNodeAndLine, text: string): RuleFix;
53
+ insertTextBeforeRange(range: eslint.AST.Range, text: string): RuleFix;
54
+ remove(nodeOrToken: AnyNodeAndLine): RuleFix;
55
+ removeRange(range: eslint.AST.Range): RuleFix;
56
+ replaceText(nodeOrToken: AnyNodeAndLine, text: string): RuleFix;
57
+ replaceTextRange(range: eslint.AST.Range, text: string): RuleFix;
58
+ }
59
+ type ReportFixFunction = (fixer: RuleFixer) => IterableIterator<RuleFix> | readonly RuleFix[] | RuleFix | null;
60
+ interface ReportDescriptorOptionsBase {
61
+ data?: {
62
+ [key: string]: string;
63
+ };
64
+ fix?: null | ReportFixFunction;
65
+ }
66
+ type SuggestionDescriptorMessage = {
67
+ desc: string;
68
+ } | {
69
+ messageId: string;
70
+ };
71
+ type SuggestionReportDescriptor = SuggestionDescriptorMessage & ReportDescriptorOptionsBase;
72
+ interface ReportDescriptorOptions extends ReportDescriptorOptionsBase {
73
+ suggest?: SuggestionReportDescriptor[] | null;
74
+ }
75
+ type ReportDescriptor = ReportDescriptorMessage & ReportDescriptorLocation & ReportDescriptorOptions;
76
+ type ReportDescriptorMessage = {
77
+ message: string;
78
+ } | {
79
+ messageId: string;
80
+ };
81
+ type ReportDescriptorLocation = {
82
+ node?: estree.BaseNode;
83
+ loc?: eslint.AST.SourceLocation;
84
+ line?: number;
85
+ column?: number;
86
+ };
87
+ export interface Context<Options extends unknown[]> extends Omit<eslint.Rule.RuleContext, "report"> {
88
+ report(descriptor: ReportDescriptor): void;
89
+ options: Options;
90
+ }
91
+ export type RuleListener = BaseRuleListener & PostFix<BaseRuleListener, ":exit">;
92
+ export interface RuleModule<Options extends unknown[]> {
93
+ create(context: Context<Options>): RuleListener;
94
+ meta: eslint.Rule.RuleMetaData;
95
+ }
96
+ export {};
97
+ //# sourceMappingURL=rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule.d.ts","sourceRoot":"","sources":["../../lib/types/rule.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,KAAK,cAAc,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;AAEzC,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI;KACjC,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;CAC5C,CAAC;AAEF,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC;IAChD,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC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{
9
+ tags: RegExp[];
10
+ comments: RegExp[];
11
+ };
12
+ };
13
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../lib/types/settings.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gBAAgB,CAAC,EAAE;QACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,gBAAgB,EAAE;QAChB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,QAAQ,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACH,CAAC"}
File without changes
File without changes
File without changes