@html-eslint/eslint-plugin 0.35.0-alpha.0 → 0.35.1
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/lib/rules/attrs-newline.js +11 -7
- package/lib/rules/element-newline.js +172 -160
- package/lib/rules/id-naming-convention.js +10 -4
- package/lib/rules/indent/indent-level.js +1 -1
- package/lib/rules/indent/indent.js +28 -15
- package/lib/rules/lowercase.js +4 -4
- package/lib/rules/max-element-depth.js +8 -5
- package/lib/rules/no-abstract-roles.js +4 -4
- package/lib/rules/no-accesskey-attrs.js +4 -4
- package/lib/rules/no-aria-hidden-body.js +1 -1
- package/lib/rules/no-duplicate-attrs.js +4 -4
- package/lib/rules/no-duplicate-id.js +5 -5
- package/lib/rules/no-extra-spacing-attrs.js +18 -12
- package/lib/rules/no-extra-spacing-text.js +8 -5
- package/lib/rules/no-heading-inside-button.js +1 -1
- package/lib/rules/no-inline-styles.js +1 -1
- package/lib/rules/no-invalid-role.js +1 -1
- package/lib/rules/no-multiple-empty-lines.js +8 -5
- package/lib/rules/no-multiple-h1.js +2 -2
- package/lib/rules/no-nested-interactive.js +2 -2
- package/lib/rules/no-non-scalable-viewport.js +1 -1
- package/lib/rules/no-obsolete-tags.js +1 -1
- package/lib/rules/no-positive-tabindex.js +4 -4
- package/lib/rules/no-restricted-attr-values.js +5 -5
- package/lib/rules/no-restricted-attrs.js +8 -7
- package/lib/rules/no-script-style-type.js +4 -4
- package/lib/rules/no-skip-heading-levels.js +2 -2
- package/lib/rules/no-target-blank.js +1 -1
- package/lib/rules/no-trailing-spaces.js +3 -3
- package/lib/rules/prefer-https.js +5 -5
- package/lib/rules/quotes.js +7 -5
- package/lib/rules/require-attrs.js +7 -5
- package/lib/rules/require-button-type.js +1 -1
- package/lib/rules/require-closing-tags.js +6 -2
- package/lib/rules/require-doctype.js +1 -1
- package/lib/rules/require-explicit-size.js +8 -3
- package/lib/rules/require-form-method.js +1 -1
- package/lib/rules/require-frame-title.js +1 -1
- package/lib/rules/require-img-alt.js +9 -8
- package/lib/rules/require-input-label.js +2 -2
- package/lib/rules/require-lang.js +4 -7
- package/lib/rules/require-li-container.js +1 -1
- package/lib/rules/require-meta-charset.js +3 -3
- package/lib/rules/require-meta-description.js +3 -3
- package/lib/rules/require-meta-viewport.js +3 -3
- package/lib/rules/require-open-graph-protocol.js +6 -3
- package/lib/rules/require-title.js +4 -4
- package/lib/rules/sort-attrs.js +11 -11
- package/lib/rules/utils/node.js +31 -19
- package/lib/rules/utils/settings.js +3 -3
- package/lib/rules/utils/source-code.js +1 -1
- package/lib/rules/utils/visitors.js +1 -1
- package/lib/types/ast.d.ts +4 -194
- package/lib/types/index.d.ts +1 -1
- package/lib/types/rule.d.ts +41 -10
- package/package.json +11 -20
- package/types/configs/recommended.d.ts +0 -20
- package/types/configs/recommended.d.ts.map +0 -1
- package/types/constants/index.d.ts +0 -5
- package/types/constants/index.d.ts.map +0 -1
- package/types/constants/obsolete-tags.d.ts +0 -3
- package/types/constants/obsolete-tags.d.ts.map +0 -1
- package/types/constants/rule-category.d.ts +0 -5
- package/types/constants/rule-category.d.ts.map +0 -1
- package/types/constants/svg-camel-case-attributes.d.ts +0 -3
- package/types/constants/svg-camel-case-attributes.d.ts.map +0 -1
- package/types/constants/void-elements.d.ts +0 -3
- package/types/constants/void-elements.d.ts.map +0 -1
- package/types/index.d.ts +0 -14
- package/types/index.d.ts.map +0 -1
- package/types/rules/attrs-newline.d.ts +0 -13
- package/types/rules/attrs-newline.d.ts.map +0 -1
- package/types/rules/element-newline.d.ts +0 -19
- package/types/rules/element-newline.d.ts.map +0 -1
- package/types/rules/id-naming-convention.d.ts +0 -10
- package/types/rules/id-naming-convention.d.ts.map +0 -1
- package/types/rules/indent/indent-level.d.ts +0 -55
- package/types/rules/indent/indent-level.d.ts.map +0 -1
- package/types/rules/indent/indent.d.ts +0 -30
- package/types/rules/indent/indent.d.ts.map +0 -1
- package/types/rules/indent/index.d.ts +0 -3
- package/types/rules/indent/index.d.ts.map +0 -1
- package/types/rules/index.d.ts +0 -51
- package/types/rules/index.d.ts.map +0 -1
- package/types/rules/lowercase.d.ts +0 -10
- package/types/rules/lowercase.d.ts.map +0 -1
- package/types/rules/max-element-depth.d.ts +0 -10
- package/types/rules/max-element-depth.d.ts.map +0 -1
- package/types/rules/no-abstract-roles.d.ts +0 -10
- package/types/rules/no-abstract-roles.d.ts.map +0 -1
- package/types/rules/no-accesskey-attrs.d.ts +0 -10
- package/types/rules/no-accesskey-attrs.d.ts.map +0 -1
- package/types/rules/no-aria-hidden-body.d.ts +0 -7
- package/types/rules/no-aria-hidden-body.d.ts.map +0 -1
- package/types/rules/no-duplicate-attrs.d.ts +0 -10
- package/types/rules/no-duplicate-attrs.d.ts.map +0 -1
- package/types/rules/no-duplicate-id.d.ts +0 -11
- package/types/rules/no-duplicate-id.d.ts.map +0 -1
- package/types/rules/no-extra-spacing-attrs.d.ts +0 -18
- package/types/rules/no-extra-spacing-attrs.d.ts.map +0 -1
- package/types/rules/no-extra-spacing-text.d.ts +0 -13
- package/types/rules/no-extra-spacing-text.d.ts.map +0 -1
- package/types/rules/no-heading-inside-button.d.ts +0 -7
- package/types/rules/no-heading-inside-button.d.ts.map +0 -1
- package/types/rules/no-inline-styles.d.ts +0 -7
- package/types/rules/no-inline-styles.d.ts.map +0 -1
- package/types/rules/no-invalid-role.d.ts +0 -7
- package/types/rules/no-invalid-role.d.ts.map +0 -1
- package/types/rules/no-multiple-empty-lines.d.ts +0 -11
- package/types/rules/no-multiple-empty-lines.d.ts.map +0 -1
- package/types/rules/no-multiple-h1.d.ts +0 -8
- package/types/rules/no-multiple-h1.d.ts.map +0 -1
- package/types/rules/no-nested-interactive.d.ts +0 -8
- package/types/rules/no-nested-interactive.d.ts.map +0 -1
- package/types/rules/no-non-scalable-viewport.d.ts +0 -7
- package/types/rules/no-non-scalable-viewport.d.ts.map +0 -1
- package/types/rules/no-obsolete-tags.d.ts +0 -7
- package/types/rules/no-obsolete-tags.d.ts.map +0 -1
- package/types/rules/no-positive-tabindex.d.ts +0 -10
- package/types/rules/no-positive-tabindex.d.ts.map +0 -1
- package/types/rules/no-restricted-attr-values.d.ts +0 -16
- package/types/rules/no-restricted-attr-values.d.ts.map +0 -1
- package/types/rules/no-restricted-attrs.d.ts +0 -16
- package/types/rules/no-restricted-attrs.d.ts.map +0 -1
- package/types/rules/no-script-style-type.d.ts +0 -10
- package/types/rules/no-script-style-type.d.ts.map +0 -1
- package/types/rules/no-skip-heading-levels.d.ts +0 -8
- package/types/rules/no-skip-heading-levels.d.ts.map +0 -1
- package/types/rules/no-target-blank.d.ts +0 -7
- package/types/rules/no-target-blank.d.ts.map +0 -1
- package/types/rules/no-trailing-spaces.d.ts +0 -9
- package/types/rules/no-trailing-spaces.d.ts.map +0 -1
- package/types/rules/prefer-https.d.ts +0 -11
- package/types/rules/prefer-https.d.ts.map +0 -1
- package/types/rules/quotes.d.ts +0 -12
- package/types/rules/quotes.d.ts.map +0 -1
- package/types/rules/require-attrs.d.ts +0 -15
- package/types/rules/require-attrs.d.ts.map +0 -1
- package/types/rules/require-button-type.d.ts +0 -7
- package/types/rules/require-button-type.d.ts.map +0 -1
- package/types/rules/require-closing-tags.d.ts +0 -8
- package/types/rules/require-closing-tags.d.ts.map +0 -1
- package/types/rules/require-doctype.d.ts +0 -7
- package/types/rules/require-doctype.d.ts.map +0 -1
- package/types/rules/require-explicit-size.d.ts +0 -9
- package/types/rules/require-explicit-size.d.ts.map +0 -1
- package/types/rules/require-form-method.d.ts +0 -7
- package/types/rules/require-form-method.d.ts.map +0 -1
- package/types/rules/require-frame-title.d.ts +0 -7
- package/types/rules/require-frame-title.d.ts.map +0 -1
- package/types/rules/require-img-alt.d.ts +0 -8
- package/types/rules/require-img-alt.d.ts.map +0 -1
- package/types/rules/require-input-label.d.ts +0 -8
- package/types/rules/require-input-label.d.ts.map +0 -1
- package/types/rules/require-lang.d.ts +0 -7
- package/types/rules/require-lang.d.ts.map +0 -1
- package/types/rules/require-li-container.d.ts +0 -7
- package/types/rules/require-li-container.d.ts.map +0 -1
- package/types/rules/require-meta-charset.d.ts +0 -9
- package/types/rules/require-meta-charset.d.ts.map +0 -1
- package/types/rules/require-meta-description.d.ts +0 -9
- package/types/rules/require-meta-description.d.ts.map +0 -1
- package/types/rules/require-meta-viewport.d.ts +0 -9
- package/types/rules/require-meta-viewport.d.ts.map +0 -1
- package/types/rules/require-open-graph-protocol.d.ts +0 -9
- package/types/rules/require-open-graph-protocol.d.ts.map +0 -1
- package/types/rules/require-title.d.ts +0 -10
- package/types/rules/require-title.d.ts.map +0 -1
- package/types/rules/sort-attrs.d.ts +0 -10
- package/types/rules/sort-attrs.d.ts.map +0 -1
- package/types/rules/utils/array.d.ts +0 -17
- package/types/rules/utils/array.d.ts.map +0 -1
- package/types/rules/utils/naming.d.ts +0 -25
- package/types/rules/utils/naming.d.ts.map +0 -1
- package/types/rules/utils/node.d.ts +0 -111
- package/types/rules/utils/node.d.ts.map +0 -1
- package/types/rules/utils/settings.d.ts +0 -19
- package/types/rules/utils/settings.d.ts.map +0 -1
- package/types/rules/utils/source-code.d.ts +0 -9
- package/types/rules/utils/source-code.d.ts.map +0 -1
- package/types/rules/utils/visitors.d.ts +0 -10
- package/types/rules/utils/visitors.d.ts.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("
|
|
6
|
-
* @typedef { import("../types").
|
|
2
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
|
+
* @typedef { import("@html-eslint/types").StyleTag } StyleTag
|
|
4
|
+
* @typedef { import("@html-eslint/types").ScriptTag } ScriptTag
|
|
5
|
+
* @typedef { import("@html-eslint/types").AttributeValue } AttributeValue
|
|
6
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
const { parse } = require("@html-eslint/template-parser");
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("
|
|
6
|
-
* @typedef { import("
|
|
7
|
-
* @typedef { import("
|
|
8
|
-
* @typedef { import("
|
|
9
|
-
* @typedef { import("
|
|
10
|
-
* @typedef { import("
|
|
11
|
-
* @typedef { import("
|
|
12
|
-
* @typedef { import("
|
|
13
|
-
*
|
|
2
|
+
* @typedef { import("@html-eslint/types").Attribute } Attribute
|
|
3
|
+
* @typedef { import("@html-eslint/types").OpenTagEnd } OpenTagEnd
|
|
4
|
+
* @typedef { import("@html-eslint/types").OpenScriptTagEnd } OpenScriptTagEnd
|
|
5
|
+
* @typedef { import("@html-eslint/types").OpenStyleTagEnd } OpenStyleTagEnd
|
|
6
|
+
* @typedef { import("@html-eslint/types").OpenScriptTagStart } OpenScriptTagStart
|
|
7
|
+
* @typedef { import("@html-eslint/types").OpenTagStart } OpenTagStart
|
|
8
|
+
* @typedef { import("@html-eslint/types").OpenStyleTagStart } OpenStyleTagStart
|
|
9
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
10
|
+
* @typedef { import("@html-eslint/types").StyleTag } StyleTag
|
|
11
|
+
* @typedef { import("@html-eslint/types").ScriptTag } ScriptTag
|
|
12
|
+
* @typedef { import("@html-eslint/types").AnyNode } AnyNode
|
|
13
|
+
*
|
|
14
|
+
* @typedef {Object} Option
|
|
15
|
+
* @property {boolean} [Option.disallowInAssignment]
|
|
16
|
+
* @property {boolean} [Option.disallowMissing]
|
|
17
|
+
* @property {boolean} [Option.disallowTabs]
|
|
18
|
+
* @property {boolean} [Option.enforceBeforeSelfClose]
|
|
19
|
+
* @typedef { import("../types").RuleModule<[Option]> } RuleModule
|
|
14
20
|
*/
|
|
15
21
|
|
|
16
22
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("
|
|
6
|
-
* @typedef { import("../types").Text } Text
|
|
2
|
+
* @typedef { import("@html-eslint/types").CommentContent } CommentContent
|
|
3
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
4
|
+
* @typedef { import("@html-eslint/types").Comment } Comment
|
|
5
|
+
* @typedef { import("@html-eslint/types").Text } Text
|
|
7
6
|
* @typedef { import("../types").Line } Line
|
|
8
7
|
* @typedef { import("eslint").AST.Range } Range
|
|
8
|
+
*
|
|
9
|
+
* @typedef {Object} Option
|
|
10
|
+
* @property {string[]} [Option.skip]
|
|
11
|
+
* @typedef { import("../types").RuleModule<[Option]> } RuleModule
|
|
9
12
|
*/
|
|
10
13
|
|
|
11
14
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef { import("es-html-parser").AnyToken } AnyToken
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("
|
|
6
|
-
*
|
|
3
|
+
* @typedef { import("@html-eslint/types").Document } Document
|
|
4
|
+
* @typedef { import("@html-eslint/types").CommentContent } CommentContent
|
|
5
|
+
* @typedef { import("@html-eslint/types").Text } Text
|
|
6
|
+
*
|
|
7
|
+
* @typedef {Object} Option
|
|
8
|
+
* @property {number} Option.max
|
|
9
|
+
* @typedef { import("../types").RuleModule<[Option]> } RuleModule
|
|
7
10
|
*/
|
|
8
11
|
|
|
9
12
|
const { parse } = require("@html-eslint/template-parser");
|
|
@@ -99,7 +102,7 @@ module.exports = {
|
|
|
99
102
|
},
|
|
100
103
|
messageId: MESSAGE_IDS.UNEXPECTED,
|
|
101
104
|
data: {
|
|
102
|
-
max
|
|
105
|
+
max: `${max}`,
|
|
103
106
|
},
|
|
104
107
|
fix(fixer) {
|
|
105
108
|
return fixer.removeRange([start, end]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
-
* @typedef { import("
|
|
2
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
3
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
-
* @typedef { import("
|
|
2
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
3
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("
|
|
2
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
3
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
4
|
+
* @typedef { import("@html-eslint/types").StyleTag } StyleTag
|
|
5
|
+
* @typedef { import("@html-eslint/types").ScriptTag } ScriptTag
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("
|
|
6
|
-
* @typedef { import("../types").ScriptTag } ScriptTag
|
|
2
|
+
* @typedef { import("@html-eslint/types").StyleTag } StyleTag
|
|
3
|
+
* @typedef { import("@html-eslint/types").Attribute } Attribute
|
|
4
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
5
|
+
* @typedef { import("@html-eslint/types").ScriptTag } ScriptTag
|
|
7
6
|
* @typedef {{attrPatterns: string[], attrValuePatterns: string[], message?: string}[]} Options
|
|
7
|
+
* @typedef { import("../types").RuleModule<Options> } RuleModule
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("
|
|
6
|
-
* @typedef { import("../types").ScriptTag } ScriptTag
|
|
2
|
+
* @typedef { import("@html-eslint/types").StyleTag } StyleTag
|
|
3
|
+
* @typedef { import("@html-eslint/types").Attribute } Attribute
|
|
4
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
5
|
+
* @typedef { import("@html-eslint/types").ScriptTag } ScriptTag
|
|
7
6
|
* @typedef {{tagPatterns: string[], attrPatterns: string[], message?: string}[]} Options
|
|
7
|
+
*
|
|
8
|
+
* @typedef { import("../types").RuleModule<Options> } RuleModule
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
const { NODE_TYPES } = require("@html-eslint/parser");
|
|
@@ -74,8 +75,8 @@ module.exports = {
|
|
|
74
75
|
node.type === NODE_TYPES.Tag
|
|
75
76
|
? node.name
|
|
76
77
|
: node.type === NODE_TYPES.ScriptTag
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
? "script"
|
|
79
|
+
: "style";
|
|
79
80
|
node.attributes.forEach((attr) => {
|
|
80
81
|
if (!attr.key || !attr.key.value) {
|
|
81
82
|
return;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("
|
|
2
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
3
|
+
* @typedef { import("@html-eslint/types").StyleTag } StyleTag
|
|
4
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
5
|
+
* @typedef { import("@html-eslint/types").ScriptTag } ScriptTag
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
-
* @typedef { import("
|
|
2
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
3
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
2
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
3
|
+
* @typedef { import("@html-eslint/types").CommentContent } CommentContent
|
|
4
|
+
* @typedef { import("@html-eslint/types").Text } Text
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const { parse } = require("@html-eslint/template-parser");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("../types").RuleModule } RuleModule
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("
|
|
6
|
-
* @typedef { import("
|
|
2
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
3
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
4
|
+
* @typedef { import("@html-eslint/types").ScriptTag } ScriptTag
|
|
5
|
+
* @typedef { import("@html-eslint/types").Attribute } Attribute
|
|
6
|
+
* @typedef { import("@html-eslint/types").AttributeValue } AttributeValue
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
const { RULE_CATEGORY } = require("../constants");
|
package/lib/rules/quotes.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef { import("eslint").AST.Range } Range
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("
|
|
6
|
-
* @typedef { import("
|
|
7
|
-
*
|
|
3
|
+
* @typedef { import("@html-eslint/types").Attribute } Attribute
|
|
4
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
5
|
+
* @typedef { import("@html-eslint/types").ScriptTag } ScriptTag
|
|
6
|
+
* @typedef { import("@html-eslint/types").StyleTag } StyleTag
|
|
7
|
+
*
|
|
8
|
+
* @typedef {"single" | "double"} Option
|
|
9
|
+
* @typedef { import("../types").RuleModule<[Option]> } RuleModule
|
|
8
10
|
*/
|
|
9
11
|
|
|
10
12
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("../types").StyleTag } StyleTag
|
|
2
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
|
+
* @typedef { import("@html-eslint/types").ScriptTag } ScriptTag
|
|
4
|
+
* @typedef { import("@html-eslint/types").StyleTag } StyleTag
|
|
6
5
|
*
|
|
7
6
|
* @typedef {Object} Option
|
|
8
7
|
* @property {string} tag
|
|
9
8
|
* @property {string} attr
|
|
10
|
-
* @property {string
|
|
9
|
+
* @property {string} [value]
|
|
10
|
+
*
|
|
11
|
+
* @typedef { import("../types").RuleModule<Option[]> } RuleModule
|
|
12
|
+
*
|
|
11
13
|
*/
|
|
12
14
|
|
|
13
15
|
const { NODE_TYPES } = require("@html-eslint/parser");
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
*
|
|
2
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
|
+
*
|
|
4
|
+
* @typedef {Object} Option
|
|
5
|
+
* @property {"always" | "never"} [Option.selfClosing]
|
|
6
|
+
* @property {string[]} [Option.selfClosingCustomPatterns]
|
|
7
|
+
* @typedef { import("../types").RuleModule<[Option]> } RuleModule
|
|
4
8
|
*/
|
|
5
9
|
|
|
6
10
|
const { RULE_CATEGORY, VOID_ELEMENTS } = require("../constants");
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
*
|
|
2
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
|
+
* @typedef { import("@html-eslint/types").AnyNode } AnyNode
|
|
4
|
+
*
|
|
5
|
+
* @typedef {Object} Option
|
|
6
|
+
* @property {string[]} [Option.allowClass]
|
|
7
|
+
* @property {string[]} [Option.allowId]
|
|
8
|
+
* @typedef { import("../types").RuleModule<[Option]> } RuleModule
|
|
9
|
+
*
|
|
5
10
|
*/
|
|
6
11
|
|
|
7
12
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
*
|
|
2
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
|
+
*
|
|
4
|
+
* @typedef {Object} Option
|
|
5
|
+
* @property {string[]} [Option.substitute]
|
|
6
|
+
*
|
|
7
|
+
* @typedef { import("../types").RuleModule<[Option]> } RuleModule
|
|
4
8
|
*/
|
|
5
9
|
|
|
6
10
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -56,12 +60,9 @@ module.exports = {
|
|
|
56
60
|
}
|
|
57
61
|
if (!hasAltAttrAndValue(node, substitute)) {
|
|
58
62
|
context.report({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
end: node.openEnd.loc.end,
|
|
63
|
-
},
|
|
64
|
-
range: [node.openStart.range[0], node.openEnd.range[1]],
|
|
63
|
+
loc: {
|
|
64
|
+
start: node.openStart.loc.start,
|
|
65
|
+
end: node.openEnd.loc.end,
|
|
65
66
|
},
|
|
66
67
|
messageId: MESSAGE_IDS.MISSING_ALT,
|
|
67
68
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("../types").
|
|
2
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("../types").RuleModule } RuleModule
|
|
2
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -41,12 +41,9 @@ module.exports = {
|
|
|
41
41
|
const langAttr = findAttr(node, "lang");
|
|
42
42
|
if (!langAttr) {
|
|
43
43
|
context.report({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
end: node.openEnd.loc.end,
|
|
48
|
-
},
|
|
49
|
-
range: [node.openStart.range[0], node.openEnd.range[1]],
|
|
44
|
+
loc: {
|
|
45
|
+
start: node.openStart.loc.start,
|
|
46
|
+
end: node.openEnd.loc.end,
|
|
50
47
|
},
|
|
51
48
|
messageId: MESSAGE_IDS.MISSING,
|
|
52
49
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("../types").
|
|
2
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
|
+
* @typedef { import("@html-eslint/types").AnyNode } AnyNode
|
|
4
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("../types").
|
|
2
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
|
+
* @typedef { import("@html-eslint/types").AnyNode } AnyNode
|
|
4
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
5
5
|
*/
|
|
6
6
|
const { RULE_CATEGORY } = require("../constants");
|
|
7
7
|
const { filter } = require("./utils/array");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("../types").
|
|
2
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
|
+
* @typedef { import("@html-eslint/types").AnyNode } AnyNode
|
|
4
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
*
|
|
2
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
|
+
* @typedef { import("@html-eslint/types").AnyNode } AnyNode
|
|
4
|
+
*
|
|
5
|
+
* @typedef {string[]} Option
|
|
6
|
+
*
|
|
7
|
+
* @typedef { import("../types").RuleModule<[Option]> } RuleModule
|
|
5
8
|
*/
|
|
6
9
|
|
|
7
10
|
const { RULE_CATEGORY } = require("../constants");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
* @typedef { import("../types").
|
|
2
|
+
* @typedef { import("@html-eslint/types").Tag } Tag
|
|
3
|
+
* @typedef { import("@html-eslint/types").Text } Text
|
|
4
|
+
* @typedef { import("@html-eslint/types").AnyNode } AnyNode
|
|
5
|
+
* @typedef { import("../types").RuleModule<[]> } RuleModule
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const { RULE_CATEGORY } = require("../constants");
|
package/lib/rules/sort-attrs.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef { import("
|
|
3
|
-
* @typedef { import("
|
|
4
|
-
* @typedef { import("
|
|
5
|
-
*
|
|
2
|
+
* @typedef { import("../types").RuleFixer } RuleFixer
|
|
3
|
+
* @typedef { import("@html-eslint/types").Attribute } Attribute
|
|
4
|
+
* @typedef { import("@html-eslint/types").Text } Text
|
|
5
|
+
*
|
|
6
|
+
* @typedef {Object} Option
|
|
7
|
+
* @property {string[]} [Option.priority]
|
|
8
|
+
* @typedef { import("../types").RuleModule<[Option]> } RuleModule
|
|
6
9
|
*/
|
|
7
10
|
|
|
8
11
|
const { hasTemplate } = require("./utils/node");
|
|
@@ -53,7 +56,7 @@ module.exports = {
|
|
|
53
56
|
/**
|
|
54
57
|
* @type {string[]}
|
|
55
58
|
*/
|
|
56
|
-
const priority = option.priority;
|
|
59
|
+
const priority = option.priority || [];
|
|
57
60
|
|
|
58
61
|
/**
|
|
59
62
|
* @param {Attribute} attrA
|
|
@@ -165,12 +168,9 @@ module.exports = {
|
|
|
165
168
|
const first = unsorted[0];
|
|
166
169
|
const last = unsorted[unsorted.length - 1];
|
|
167
170
|
context.report({
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
start: first.loc.start,
|
|
172
|
-
end: last.loc.end,
|
|
173
|
-
},
|
|
171
|
+
loc: {
|
|
172
|
+
start: first.loc.start,
|
|
173
|
+
end: last.loc.end,
|
|
174
174
|
},
|
|
175
175
|
messageId: MESSAGE_IDS.UNSORTED,
|
|
176
176
|
fix(fixer) {
|