@html-eslint/eslint-plugin 0.35.0 → 0.35.2

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 (177) hide show
  1. package/lib/exports.ts +2 -0
  2. package/lib/index.js +6 -1
  3. package/lib/rules/attrs-newline.js +11 -7
  4. package/lib/rules/element-newline.js +25 -18
  5. package/lib/rules/id-naming-convention.js +10 -4
  6. package/lib/rules/indent/indent-level.js +1 -1
  7. package/lib/rules/indent/indent.js +26 -15
  8. package/lib/rules/lowercase.js +4 -4
  9. package/lib/rules/max-element-depth.js +8 -5
  10. package/lib/rules/no-abstract-roles.js +4 -4
  11. package/lib/rules/no-accesskey-attrs.js +4 -4
  12. package/lib/rules/no-aria-hidden-body.js +1 -1
  13. package/lib/rules/no-duplicate-attrs.js +4 -4
  14. package/lib/rules/no-duplicate-id.js +5 -5
  15. package/lib/rules/no-extra-spacing-attrs.js +18 -12
  16. package/lib/rules/no-extra-spacing-text.js +8 -5
  17. package/lib/rules/no-heading-inside-button.js +1 -1
  18. package/lib/rules/no-inline-styles.js +1 -1
  19. package/lib/rules/no-invalid-role.js +1 -1
  20. package/lib/rules/no-multiple-empty-lines.js +8 -5
  21. package/lib/rules/no-multiple-h1.js +2 -2
  22. package/lib/rules/no-nested-interactive.js +2 -2
  23. package/lib/rules/no-non-scalable-viewport.js +1 -1
  24. package/lib/rules/no-obsolete-tags.js +1 -1
  25. package/lib/rules/no-positive-tabindex.js +4 -4
  26. package/lib/rules/no-restricted-attr-values.js +5 -5
  27. package/lib/rules/no-restricted-attrs.js +8 -7
  28. package/lib/rules/no-script-style-type.js +4 -4
  29. package/lib/rules/no-skip-heading-levels.js +2 -2
  30. package/lib/rules/no-target-blank.js +1 -1
  31. package/lib/rules/no-trailing-spaces.js +3 -3
  32. package/lib/rules/prefer-https.js +5 -5
  33. package/lib/rules/quotes.js +7 -5
  34. package/lib/rules/require-attrs.js +7 -5
  35. package/lib/rules/require-button-type.js +1 -1
  36. package/lib/rules/require-closing-tags.js +6 -2
  37. package/lib/rules/require-doctype.js +1 -1
  38. package/lib/rules/require-explicit-size.js +8 -3
  39. package/lib/rules/require-form-method.js +1 -1
  40. package/lib/rules/require-frame-title.js +1 -1
  41. package/lib/rules/require-img-alt.js +9 -8
  42. package/lib/rules/require-input-label.js +2 -2
  43. package/lib/rules/require-lang.js +4 -7
  44. package/lib/rules/require-li-container.js +1 -1
  45. package/lib/rules/require-meta-charset.js +3 -3
  46. package/lib/rules/require-meta-description.js +3 -3
  47. package/lib/rules/require-meta-viewport.js +3 -3
  48. package/lib/rules/require-open-graph-protocol.js +6 -3
  49. package/lib/rules/require-title.js +4 -4
  50. package/lib/rules/sort-attrs.js +11 -11
  51. package/lib/rules/utils/node.js +23 -23
  52. package/lib/rules/utils/settings.js +3 -3
  53. package/lib/rules/utils/source-code.js +1 -1
  54. package/lib/rules/utils/visitors.js +1 -1
  55. package/lib/types/ast.ts +17 -0
  56. package/lib/types/{rule.d.ts → rule.ts} +41 -10
  57. package/package.json +12 -19
  58. package/types/exports.d.ts +3 -0
  59. package/types/exports.d.ts.map +1 -0
  60. package/types/index.d.ts +80 -5
  61. package/types/index.d.ts.map +1 -1
  62. package/types/rules/attrs-newline.d.ts +7 -3
  63. package/types/rules/attrs-newline.d.ts.map +1 -1
  64. package/types/rules/element-newline.d.ts +17 -11
  65. package/types/rules/element-newline.d.ts.map +1 -1
  66. package/types/rules/id-naming-convention.d.ts +10 -5
  67. package/types/rules/id-naming-convention.d.ts.map +1 -1
  68. package/types/rules/indent/indent-level.d.ts +2 -2
  69. package/types/rules/indent/indent-level.d.ts.map +1 -1
  70. package/types/rules/indent/indent.d.ts +15 -9
  71. package/types/rules/indent/indent.d.ts.map +1 -1
  72. package/types/rules/index.d.ts +64 -47
  73. package/types/rules/lowercase.d.ts +5 -5
  74. package/types/rules/lowercase.d.ts.map +1 -1
  75. package/types/rules/max-element-depth.d.ts +8 -5
  76. package/types/rules/max-element-depth.d.ts.map +1 -1
  77. package/types/rules/no-abstract-roles.d.ts +5 -5
  78. package/types/rules/no-abstract-roles.d.ts.map +1 -1
  79. package/types/rules/no-accesskey-attrs.d.ts +5 -5
  80. package/types/rules/no-accesskey-attrs.d.ts.map +1 -1
  81. package/types/rules/no-aria-hidden-body.d.ts +1 -1
  82. package/types/rules/no-aria-hidden-body.d.ts.map +1 -1
  83. package/types/rules/no-duplicate-attrs.d.ts +5 -5
  84. package/types/rules/no-duplicate-attrs.d.ts.map +1 -1
  85. package/types/rules/no-duplicate-id.d.ts +6 -6
  86. package/types/rules/no-duplicate-id.d.ts.map +1 -1
  87. package/types/rules/no-extra-spacing-attrs.d.ts +19 -13
  88. package/types/rules/no-extra-spacing-attrs.d.ts.map +1 -1
  89. package/types/rules/no-extra-spacing-text.d.ts +9 -6
  90. package/types/rules/no-extra-spacing-text.d.ts.map +1 -1
  91. package/types/rules/no-heading-inside-button.d.ts +1 -1
  92. package/types/rules/no-heading-inside-button.d.ts.map +1 -1
  93. package/types/rules/no-inline-styles.d.ts +1 -1
  94. package/types/rules/no-inline-styles.d.ts.map +1 -1
  95. package/types/rules/no-invalid-role.d.ts +1 -1
  96. package/types/rules/no-invalid-role.d.ts.map +1 -1
  97. package/types/rules/no-multiple-empty-lines.d.ts +8 -5
  98. package/types/rules/no-multiple-empty-lines.d.ts.map +1 -1
  99. package/types/rules/no-multiple-h1.d.ts +2 -2
  100. package/types/rules/no-multiple-h1.d.ts.map +1 -1
  101. package/types/rules/no-nested-interactive.d.ts +2 -2
  102. package/types/rules/no-nested-interactive.d.ts.map +1 -1
  103. package/types/rules/no-non-scalable-viewport.d.ts +1 -1
  104. package/types/rules/no-non-scalable-viewport.d.ts.map +1 -1
  105. package/types/rules/no-obsolete-tags.d.ts +1 -1
  106. package/types/rules/no-obsolete-tags.d.ts.map +1 -1
  107. package/types/rules/no-positive-tabindex.d.ts +4 -4
  108. package/types/rules/no-positive-tabindex.d.ts.map +1 -1
  109. package/types/rules/no-restricted-attr-values.d.ts +6 -6
  110. package/types/rules/no-restricted-attr-values.d.ts.map +1 -1
  111. package/types/rules/no-restricted-attrs.d.ts +6 -6
  112. package/types/rules/no-restricted-attrs.d.ts.map +1 -1
  113. package/types/rules/no-script-style-type.d.ts +4 -4
  114. package/types/rules/no-script-style-type.d.ts.map +1 -1
  115. package/types/rules/no-skip-heading-levels.d.ts +2 -2
  116. package/types/rules/no-skip-heading-levels.d.ts.map +1 -1
  117. package/types/rules/no-target-blank.d.ts +1 -1
  118. package/types/rules/no-target-blank.d.ts.map +1 -1
  119. package/types/rules/no-trailing-spaces.d.ts +3 -3
  120. package/types/rules/no-trailing-spaces.d.ts.map +1 -1
  121. package/types/rules/prefer-https.d.ts +5 -5
  122. package/types/rules/prefer-https.d.ts.map +1 -1
  123. package/types/rules/quotes.d.ts +7 -6
  124. package/types/rules/quotes.d.ts.map +1 -1
  125. package/types/rules/require-attrs.d.ts +6 -6
  126. package/types/rules/require-attrs.d.ts.map +1 -1
  127. package/types/rules/require-button-type.d.ts +1 -1
  128. package/types/rules/require-button-type.d.ts.map +1 -1
  129. package/types/rules/require-closing-tags.d.ts +7 -3
  130. package/types/rules/require-closing-tags.d.ts.map +1 -1
  131. package/types/rules/require-doctype.d.ts +1 -1
  132. package/types/rules/require-doctype.d.ts.map +1 -1
  133. package/types/rules/require-explicit-size.d.ts +8 -4
  134. package/types/rules/require-explicit-size.d.ts.map +1 -1
  135. package/types/rules/require-form-method.d.ts +1 -1
  136. package/types/rules/require-form-method.d.ts.map +1 -1
  137. package/types/rules/require-frame-title.d.ts +1 -1
  138. package/types/rules/require-frame-title.d.ts.map +1 -1
  139. package/types/rules/require-img-alt.d.ts +6 -3
  140. package/types/rules/require-img-alt.d.ts.map +1 -1
  141. package/types/rules/require-input-label.d.ts +3 -3
  142. package/types/rules/require-input-label.d.ts.map +1 -1
  143. package/types/rules/require-lang.d.ts +1 -1
  144. package/types/rules/require-lang.d.ts.map +1 -1
  145. package/types/rules/require-li-container.d.ts +1 -1
  146. package/types/rules/require-li-container.d.ts.map +1 -1
  147. package/types/rules/require-meta-charset.d.ts +4 -4
  148. package/types/rules/require-meta-charset.d.ts.map +1 -1
  149. package/types/rules/require-meta-description.d.ts +4 -4
  150. package/types/rules/require-meta-description.d.ts.map +1 -1
  151. package/types/rules/require-meta-viewport.d.ts +4 -4
  152. package/types/rules/require-meta-viewport.d.ts.map +1 -1
  153. package/types/rules/require-open-graph-protocol.d.ts +5 -4
  154. package/types/rules/require-open-graph-protocol.d.ts.map +1 -1
  155. package/types/rules/require-title.d.ts +5 -5
  156. package/types/rules/require-title.d.ts.map +1 -1
  157. package/types/rules/sort-attrs.d.ts +8 -5
  158. package/types/rules/sort-attrs.d.ts.map +1 -1
  159. package/types/rules/utils/node.d.ts +28 -28
  160. package/types/rules/utils/node.d.ts.map +1 -1
  161. package/types/rules/utils/settings.d.ts +3 -3
  162. package/types/rules/utils/settings.d.ts.map +1 -1
  163. package/types/rules/utils/source-code.d.ts +8 -3
  164. package/types/rules/utils/source-code.d.ts.map +1 -1
  165. package/types/rules/utils/visitors.d.ts +1 -1
  166. package/types/rules/utils/visitors.d.ts.map +1 -1
  167. package/types/types/ast.d.ts +16 -0
  168. package/types/types/ast.d.ts.map +1 -0
  169. package/types/types/index.d.ts +4 -0
  170. package/types/types/index.d.ts.map +1 -0
  171. package/types/types/rule.d.ts +97 -0
  172. package/types/types/rule.d.ts.map +1 -0
  173. package/types/types/settings.d.ts +13 -0
  174. package/types/types/settings.d.ts.map +1 -0
  175. package/lib/types/ast.d.ts +0 -213
  176. package/lib/types/{index.d.ts → index.ts} +1 -1
  177. /package/lib/types/{settings.d.ts → settings.ts} +0 -0
@@ -1,9 +1,9 @@
1
1
  declare namespace _exports {
2
- export { RuleModule, Tag, AnyNode };
2
+ export { Tag, AnyNode, RuleModule };
3
3
  }
4
4
  declare const _exports: RuleModule;
5
5
  export = _exports;
6
- type RuleModule = import("../types").RuleModule;
7
- type Tag = import("../types").Tag;
8
- type AnyNode = import("../types").AnyNode;
6
+ type Tag = import("@html-eslint/types").Tag;
7
+ type AnyNode = import("@html-eslint/types").AnyNode;
8
+ type RuleModule = import("../types").RuleModule<[]>;
9
9
  //# sourceMappingURL=require-meta-viewport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"require-meta-viewport.d.ts","sourceRoot":"","sources":["../../lib/rules/require-meta-viewport.js"],"names":[],"mappings":";;;wBAgCU,UAAU;;kBA/BN,OAAO,UAAU,EAAE,UAAU;WAC7B,OAAO,UAAU,EAAE,GAAG;eACtB,OAAO,UAAU,EAAE,OAAO"}
1
+ {"version":3,"file":"require-meta-viewport.d.ts","sourceRoot":"","sources":["../../lib/rules/require-meta-viewport.js"],"names":[],"mappings":";;;wBAgCU,UAAU;;WA/BN,OAAO,oBAAoB,EAAE,GAAG;eAChC,OAAO,oBAAoB,EAAE,OAAO;kBACpC,OAAO,UAAU,EAAE,UAAU,CAAC,EAAE,CAAC"}
@@ -1,9 +1,10 @@
1
1
  declare namespace _exports {
2
- export { RuleModule, Tag, AnyNode };
2
+ export { Tag, AnyNode, Option, RuleModule };
3
3
  }
4
4
  declare const _exports: RuleModule;
5
5
  export = _exports;
6
- type RuleModule = import("../types").RuleModule;
7
- type Tag = import("../types").Tag;
8
- type AnyNode = import("../types").AnyNode;
6
+ type Tag = import("@html-eslint/types").Tag;
7
+ type AnyNode = import("@html-eslint/types").AnyNode;
8
+ type Option = string[];
9
+ type RuleModule = import("../types").RuleModule<[Option]>;
9
10
  //# sourceMappingURL=require-open-graph-protocol.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"require-open-graph-protocol.d.ts","sourceRoot":"","sources":["../../lib/rules/require-open-graph-protocol.js"],"names":[],"mappings":";;;wBAkCU,UAAU;;kBAjCN,OAAO,UAAU,EAAE,UAAU;WAC7B,OAAO,UAAU,EAAE,GAAG;eACrB,OAAO,UAAU,EAAE,OAAO"}
1
+ {"version":3,"file":"require-open-graph-protocol.d.ts","sourceRoot":"","sources":["../../lib/rules/require-open-graph-protocol.js"],"names":[],"mappings":";;;wBAqCU,UAAU;;WApCN,OAAO,oBAAoB,EAAE,GAAG;eAChC,OAAO,oBAAoB,EAAE,OAAO;cAErC,MAAM,EAAE;kBAEP,OAAO,UAAU,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -1,10 +1,10 @@
1
1
  declare namespace _exports {
2
- export { RuleModule, Tag, Text, AnyNode };
2
+ export { Tag, Text, AnyNode, RuleModule };
3
3
  }
4
4
  declare const _exports: RuleModule;
5
5
  export = _exports;
6
- type RuleModule = import("../types").RuleModule;
7
- type Tag = import("../types").Tag;
8
- type Text = import("../types").Text;
9
- type AnyNode = import("../types").AnyNode;
6
+ type Tag = import("@html-eslint/types").Tag;
7
+ type Text = import("@html-eslint/types").Text;
8
+ type AnyNode = import("@html-eslint/types").AnyNode;
9
+ type RuleModule = import("../types").RuleModule<[]>;
10
10
  //# sourceMappingURL=require-title.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"require-title.d.ts","sourceRoot":"","sources":["../../lib/rules/require-title.js"],"names":[],"mappings":";;;wBAiCU,UAAU;;kBAhCN,OAAO,UAAU,EAAE,UAAU;WAC7B,OAAO,UAAU,EAAE,GAAG;YACtB,OAAO,UAAU,EAAE,IAAI;eACvB,OAAO,UAAU,EAAE,OAAO"}
1
+ {"version":3,"file":"require-title.d.ts","sourceRoot":"","sources":["../../lib/rules/require-title.js"],"names":[],"mappings":";;;wBAiCU,UAAU;;WAhCN,OAAO,oBAAoB,EAAE,GAAG;YAChC,OAAO,oBAAoB,EAAE,IAAI;eACjC,OAAO,oBAAoB,EAAE,OAAO;kBACpC,OAAO,UAAU,EAAE,UAAU,CAAC,EAAE,CAAC"}
@@ -1,10 +1,13 @@
1
1
  declare namespace _exports {
2
- export { RuleFixer, RuleModule, Attribute, Text };
2
+ export { RuleFixer, Attribute, Text, Option, RuleModule };
3
3
  }
4
4
  declare const _exports: RuleModule;
5
5
  export = _exports;
6
- type RuleFixer = import("eslint").Rule.RuleFixer;
7
- type RuleModule = import("../types").RuleModule;
8
- type Attribute = import("../types").Attribute;
9
- type Text = import("../types").Text;
6
+ type RuleFixer = import("../types").RuleFixer;
7
+ type Attribute = import("@html-eslint/types").Attribute;
8
+ type Text = import("@html-eslint/types").Text;
9
+ type Option = {
10
+ priority?: string[] | undefined;
11
+ };
12
+ type RuleModule = import("../types").RuleModule<[Option]>;
10
13
  //# sourceMappingURL=sort-attrs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sort-attrs.d.ts","sourceRoot":"","sources":["../../lib/rules/sort-attrs.js"],"names":[],"mappings":";;;wBAiBU,UAAU;;iBAhBN,OAAO,QAAQ,EAAE,IAAI,CAAC,SAAS;kBAC/B,OAAO,UAAU,EAAE,UAAU;iBAC7B,OAAO,UAAU,EAAE,SAAS;YAC5B,OAAO,UAAU,EAAE,IAAI"}
1
+ {"version":3,"file":"sort-attrs.d.ts","sourceRoot":"","sources":["../../lib/rules/sort-attrs.js"],"names":[],"mappings":";;;wBAoBU,UAAU;;iBAnBN,OAAO,UAAU,EAAE,SAAS;iBAC5B,OAAO,oBAAoB,EAAE,SAAS;YACtC,OAAO,oBAAoB,EAAE,IAAI;;;;kBAIjC,OAAO,UAAU,EAAE,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -1,18 +1,18 @@
1
- export type Attribute = import("../../types").Attribute;
2
- export type Tag = import("../../types").Tag;
3
- export type ScriptTag = import("../../types").ScriptTag;
4
- export type StyleTag = import("../../types").StyleTag;
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;
5
6
  export type Line = import("../../types").Line;
6
- export type Text = import("../../types").Text;
7
- export type CommentContent = import("../../types").CommentContent;
8
- export type Comment = import("../../types").Comment;
9
- export type AnyNode = import("../../types").AnyNode;
10
- export type AttributeValue = import("../../types").AttributeValue;
11
- export type AttributeKey = import("../../types").AttributeKey;
12
- export type TemplateText = import("../../types").TemplateText;
13
- export type OpenTemplate = import("../../types").OpenTemplate;
14
- export type CloseTemplate = import("../../types").CloseTemplate;
15
- export type AnyPartNode = import("../../types").AnyPartNode;
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
16
  export type Range = import("eslint").AST.Range;
17
17
  export type SourceLocation = import("eslint").AST.SourceLocation;
18
18
  export type AnyToken = import("es-html-parser").AnyToken;
@@ -52,41 +52,41 @@ export function getLocBetween(before: {
52
52
  loc: SourceLocation;
53
53
  }): SourceLocation;
54
54
  /**
55
- * @param {Exclude<AnyNode, Line>} node
55
+ * @param {AnyNode} node
56
56
  * @param {(node: AnyNode) => boolean} predicate
57
57
  * @returns {null | AnyNode}
58
58
  */
59
- export function findParent(node: Exclude<AnyNode, Line>, predicate: (node: AnyNode) => boolean): null | AnyNode;
59
+ export function findParent(node: AnyNode, predicate: (node: AnyNode) => boolean): null | AnyNode;
60
60
  /**
61
- * @param {AnyNode} node
61
+ * @param {BaseNode} node
62
62
  * @returns {node is Tag}
63
63
  */
64
- export function isTag(node: AnyNode): node is Tag;
64
+ export function isTag(node: BaseNode): node is Tag;
65
65
  /**
66
- * @param {AnyNode} node
66
+ * @param {BaseNode} node
67
67
  * @returns {node is Comment}
68
68
  */
69
- export function isComment(node: AnyNode): node is Comment;
69
+ export function isComment(node: BaseNode): node is Comment;
70
70
  /**
71
- * @param {AnyNode} node
71
+ * @param {BaseNode} node
72
72
  * @returns {node is Text}
73
73
  */
74
- export function isText(node: AnyNode): node is Text;
74
+ export function isText(node: BaseNode): node is Text;
75
75
  /**
76
- * @param {AnyNode | Line | TemplateText | OpenTemplate | CloseTemplate } node
76
+ * @param {BaseNode} node
77
77
  * @returns {node is Line}
78
78
  */
79
- export function isLine(node: AnyNode | Line | TemplateText | OpenTemplate | CloseTemplate): node is Line;
79
+ export function isLine(node: BaseNode): node is Line;
80
80
  /**
81
- * @param {AnyNode} node
81
+ * @param {BaseNode} node
82
82
  * @returns {node is ScriptTag}
83
83
  */
84
- export function isScript(node: AnyNode): node is ScriptTag;
84
+ export function isScript(node: BaseNode): node is ScriptTag;
85
85
  /**
86
- * @param {AnyNode} node
86
+ * @param {BaseNode} node
87
87
  * @returns {node is StyleTag}
88
88
  */
89
- export function isStyle(node: AnyNode): node is StyleTag;
89
+ export function isStyle(node: BaseNode): node is StyleTag;
90
90
  /**
91
91
  * @param {(Text | CommentContent)['parts']} parts
92
92
  * @param {Range} range
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../lib/rules/utils/node.js"],"names":[],"mappings":"wBACc,OAAO,aAAa,EAAE,SAAS;kBAC/B,OAAO,aAAa,EAAE,GAAG;wBACzB,OAAO,aAAa,EAAE,SAAS;uBAC/B,OAAO,aAAa,EAAE,QAAQ;mBAC9B,OAAO,aAAa,EAAE,IAAI;mBAC1B,OAAO,aAAa,EAAE,IAAI;6BAC1B,OAAO,aAAa,EAAE,cAAc;sBACpC,OAAO,aAAa,EAAE,OAAO;sBAC7B,OAAO,aAAa,EAAE,OAAO;6BAC7B,OAAO,aAAa,EAAE,cAAc;2BACpC,OAAO,aAAa,EAAE,YAAY;2BAClC,OAAO,aAAa,EAAE,YAAY;2BAClC,OAAO,aAAa,EAAE,YAAY;4BAClC,OAAO,aAAa,EAAE,aAAa;0BACnC,OAAO,aAAa,EAAE,WAAW;oBACjC,OAA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../../types").MaybeHTMLSettings;
2
2
  export type HTMLSettings = import("../../types").HTMLSettings;
3
- export type Context = import("../../types").Context;
4
- export type TaggedTemplateExpression = import("../../types").TaggedTemplateExpression;
5
- export type TemplateLiteral = import("../../types").TemplateLiteral;
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
6
  /**
7
7
  *
8
8
  * @param {TemplateLiteral} node
@@ -1 +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;uCAC7B,OAAO,aAAa,EAAE,wBAAwB;8BAC9C,OAAO,aAAa,EAAE,eAAe;AA8DlD;;;;;GAKG;AACH,iDAJW,eAAe,WACf,OAAO,GACL,OAAO,CAWnB;AA7BD;;;;GAIG;AACH,0DAJW,wBAAwB,WACxB,OAAO,GACL,OAAO,CASnB"}
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"}
@@ -1,9 +1,14 @@
1
- export type Context = import("../../types").Context;
1
+ export type Context = import("../../types").Context<any[]>;
2
2
  /**
3
- * @typedef {import("../../types").Context} Context
3
+ * @typedef {import("../../types").Context<any[]>} Context
4
4
  */
5
5
  /**
6
6
  * @param {Context} context
7
7
  */
8
- export function getSourceCode(context: Context): any;
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;
9
14
  //# sourceMappingURL=source-code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-code.d.ts","sourceRoot":"","sources":["../../../lib/rules/utils/source-code.js"],"names":[],"mappings":"sBACa,OAAO,aAAa,EAAE,OAAO;AAD1C;;GAEG;AAEH;;GAEG;AACH,uCAFW,OAAO,OAIjB"}
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"}
@@ -1,4 +1,4 @@
1
- export type Context = import("../../types").Context;
1
+ export type Context = import("../../types").Context<any[]>;
2
2
  export type RuleListener = import("../../types").RuleListener;
3
3
  /**
4
4
  * @param {Context} context
@@ -1 +1 @@
1
- {"version":3,"file":"visitors.d.ts","sourceRoot":"","sources":["../../../lib/rules/utils/visitors.js"],"names":[],"mappings":"sBACc,OAAO,aAAa,EAAE,OAAO;2BAC7B,OAAO,aAAa,EAAE,YAAY;AA8BhD;;;;;GAKG;AACH,wCALW,OAAO,YACP,YAAY,qBACZ,GAAG,GACD,YAAY,CAWxB"}
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;IAChC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,KAAK,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC;IAChD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,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BAAuB,GAC7C,wBAAwB,GACxB,uBAAuB,CAAC;AAC1B,KAAK,uBAAuB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAC3E,KAAK,wBAAwB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,OAAO,CAAC,OAAO,SAAS,OAAO,EAAE,CAChD,SAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC;IAC/C,MAAM,CAAC,UAAU,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC3C,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,YAAY,GAAG,gBAAgB,GACzC,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAErC,MAAM,WAAW,UAAU,CAAC,OAAO,SAAS,OAAO,EAAE;IACnD,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC;IAChD,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;CAChC"}
@@ -0,0 +1,13 @@
1
+ export type MaybeHTMLSettings = {
2
+ templateLiterals?: {
3
+ tags?: string[];
4
+ comments?: string[];
5
+ };
6
+ };
7
+ export type HTMLSettings = {
8
+ templateLiterals: {
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"}
@@ -1,213 +0,0 @@
1
- import * as Parser from "es-html-parser";
2
- import eslint from "eslint";
3
- import * as estree from "estree";
4
-
5
- export interface Document extends Parser.DocumentNode {
6
- parent: null;
7
- children: Array<Tag | Text | Comment | Doctype | ScriptTag | StyleTag>;
8
- }
9
-
10
- export interface Doctype extends Parser.DoctypeNode {
11
- parent: Document | Tag;
12
- open: DoctypeOpen;
13
- close: DoctypeClose;
14
- attributes: Array<DoctypeAttribute>;
15
- }
16
-
17
- export interface DoctypeOpen extends Parser.DoctypeOpenNode {
18
- parent: Doctype;
19
- }
20
-
21
- export interface DoctypeClose extends Parser.DoctypeCloseNode {
22
- parent: Doctype;
23
- }
24
-
25
- export interface DoctypeAttribute extends Parser.DoctypeAttributeNode {
26
- parent: Doctype;
27
- }
28
-
29
- export interface Comment extends Parser.CommentNode {
30
- parent: Tag | Document;
31
- open: CommentOpen;
32
- close: CommentClose;
33
- value: CommentContent;
34
- }
35
-
36
- export interface CommentOpen extends Parser.CommentOpenNode {
37
- parent: Comment;
38
- }
39
-
40
- export interface CommentClose extends Parser.CommentCloseNode {
41
- parent: Comment;
42
- }
43
-
44
- export interface CommentContent extends Parser.CommentContentNode {
45
- parent: Comment;
46
- }
47
-
48
- export interface Tag extends Parser.TagNode {
49
- parent: Document | Tag;
50
- openStart: OpenTagStart;
51
- openEnd: OpenTagEnd;
52
- attributes: Array<Attribute>;
53
- close?: CloseTag;
54
- children: Array<Tag | Text | StyleTag | ScriptTag>;
55
- }
56
-
57
- export interface OpenTagStart extends Parser.OpenTagStartNode {
58
- parent: Tag;
59
- }
60
-
61
- export interface OpenTagEnd extends Parser.OpenTagEndNode {
62
- parent: Tag;
63
- }
64
-
65
- export interface CloseTag extends Parser.CloseTagNode {
66
- parent: Tag;
67
- }
68
-
69
- export interface ScriptTag extends Parser.ScriptTagNode {
70
- parent: Document | Tag;
71
- attributes: Array<Attribute>;
72
- openStart: OpenScriptTagStart;
73
- openEnd: OpenScriptTagEnd;
74
- value?: ScriptTagContent;
75
- }
76
-
77
- export interface OpenScriptTagStart extends Parser.OpenScriptTagStartNode {
78
- parent: ScriptTag;
79
- }
80
-
81
- export interface OpenScriptTagEnd extends Parser.OpenScriptTagEndNode {
82
- parent: ScriptTag;
83
- }
84
-
85
- export interface CloseScriptTag extends Parser.CloseScriptTagNode {
86
- parent: ScriptTag;
87
- }
88
-
89
- export interface ScriptTagContent extends Parser.ScriptTagContentNode {
90
- parent: ScriptTag;
91
- }
92
-
93
- export interface StyleTag extends Parser.StyleTagNode {
94
- parent: Document | Tag;
95
- attributes: Array<Attribute>;
96
- openStart: OpenStyleTagStart;
97
- openEnd: OpenStyleTagEnd;
98
- value?: StyleTagContent;
99
- }
100
-
101
- export interface OpenStyleTagStart extends Parser.OpenStyleTagStartNode {
102
- parent: StyleTag;
103
- }
104
-
105
- export interface OpenStyleTagEnd extends Parser.OpenStyleTagEndNode {
106
- parent: StyleTag;
107
- }
108
-
109
- export interface CloseStyleTag extends Parser.CloseStyleTagNode {
110
- parent: StyleTag;
111
- }
112
-
113
- export interface StyleTagContent extends Parser.StyleTagContentNode {
114
- parent: StyleTag;
115
- }
116
-
117
- export interface Attribute extends Parser.AttributeNode {
118
- parent: Tag;
119
- key: AttributeKey;
120
- value?: AttributeValue;
121
- startWrapper?: AttributeValueWrapperStart;
122
- endWrapper?: AttributeValueWrapperEnd;
123
- }
124
-
125
- export interface AttributeKey extends Parser.AttributeKeyNode {
126
- parent: Attribute;
127
- }
128
-
129
- export interface AttributeValue extends Parser.AttributeValueNode {
130
- parent: Attribute;
131
- }
132
-
133
- export interface AttributeValueWrapperStart
134
- extends Parser.AttributeValueWrapperStartNode {
135
- parent: Attribute;
136
- }
137
-
138
- export interface AttributeValueWrapperEnd
139
- extends Parser.AttributeValueWrapperEndNode {
140
- parent: Attribute;
141
- }
142
-
143
- export interface Text extends Parser.TextNode {
144
- parent: Document | Tag;
145
- }
146
-
147
- /**
148
- * This is not a node generated by es-html-parser; it is created by utils's splitToLineNodes.
149
- */
150
- export interface Line {
151
- type: "Line";
152
- value: string;
153
- hasTemplate: boolean;
154
- range: eslint.AST.Range;
155
- loc: eslint.AST.SourceLocation;
156
- }
157
-
158
- export interface TaggedTemplateExpression
159
- extends estree.TaggedTemplateExpression {
160
- parent: estree.Node | null;
161
- loc: eslint.AST.SourceLocation;
162
- range: eslint.AST.Range;
163
- quasi: TemplateLiteral;
164
- }
165
-
166
- export interface TemplateLiteral extends estree.TemplateLiteral {
167
- parent: estree.Node | null;
168
- loc: eslint.AST.SourceLocation;
169
- range: eslint.AST.Range;
170
- }
171
-
172
- export type TemplateText = Text["parts"][number];
173
-
174
- export type OpenTemplate = Exclude<Parser.TemplateNode<any>["open"], undefined>;
175
- export type CloseTemplate = Exclude<
176
- Parser.TemplateNode<any>["close"],
177
- undefined
178
- >;
179
- export type AnyPartNode = Parser.PartNode<Parser.NodeTypes>;
180
-
181
- export type AnyNode =
182
- | Document
183
- | Doctype
184
- | DoctypeOpen
185
- | DoctypeClose
186
- | DoctypeAttribute
187
- | Comment
188
- | CommentOpen
189
- | CommentClose
190
- | CommentContent
191
- | Tag
192
- | OpenTagStart
193
- | OpenTagEnd
194
- | CloseTag
195
- | ScriptTag
196
- | OpenScriptTagStart
197
- | OpenScriptTagEnd
198
- | ScriptTagContent
199
- | CloseScriptTag
200
- | StyleTag
201
- | OpenStyleTagStart
202
- | OpenStyleTagEnd
203
- | StyleTagContent
204
- | CloseStyleTag
205
- | Attribute
206
- | AttributeKey
207
- | AttributeValue
208
- | AttributeValueWrapperEnd
209
- | AttributeValueWrapperStart
210
- | Text
211
- | Line
212
- | TaggedTemplateExpression
213
- | TemplateLiteral;
@@ -1,3 +1,3 @@
1
- export * from "./ast";
2
1
  export * from "./rule";
3
2
  export * from "./settings";
3
+ export * from "./ast";
File without changes