@angular-eslint/eslint-plugin-template 17.3.1-alpha.1 → 17.3.1-alpha.11
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/dist/index.d.ts +152 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/processors.d.ts +38 -0
- package/dist/processors.d.ts.map +1 -0
- package/dist/rules/alt-text.d.ts +5 -0
- package/dist/rules/alt-text.d.ts.map +1 -0
- package/dist/rules/attributes-order.d.ts +19 -0
- package/dist/rules/attributes-order.d.ts.map +1 -0
- package/dist/rules/attributes-order.js +67 -38
- package/dist/rules/banana-in-box.d.ts +5 -0
- package/dist/rules/banana-in-box.d.ts.map +1 -0
- package/dist/rules/button-has-type.d.ts +6 -0
- package/dist/rules/button-has-type.d.ts.map +1 -0
- package/dist/rules/click-events-have-key-events.d.ts +5 -0
- package/dist/rules/click-events-have-key-events.d.ts.map +1 -0
- package/dist/rules/conditional-complexity.d.ts +8 -0
- package/dist/rules/conditional-complexity.d.ts.map +1 -0
- package/dist/rules/cyclomatic-complexity.d.ts +8 -0
- package/dist/rules/cyclomatic-complexity.d.ts.map +1 -0
- package/dist/rules/elements-content.d.ts +10 -0
- package/dist/rules/elements-content.d.ts.map +1 -0
- package/dist/rules/elements-content.js +1 -1
- package/dist/rules/eqeqeq.d.ts +9 -0
- package/dist/rules/eqeqeq.d.ts.map +1 -0
- package/dist/rules/eqeqeq.js +19 -14
- package/dist/rules/i18n.d.ts +19 -0
- package/dist/rules/i18n.d.ts.map +1 -0
- package/dist/rules/i18n.js +33 -27
- package/dist/rules/interactive-supports-focus.d.ts +5 -0
- package/dist/rules/interactive-supports-focus.d.ts.map +1 -0
- package/dist/rules/label-has-associated-control.d.ts +15 -0
- package/dist/rules/label-has-associated-control.d.ts.map +1 -0
- package/dist/rules/label-has-associated-control.js +3 -4
- package/dist/rules/mouse-events-have-key-events.d.ts +6 -0
- package/dist/rules/mouse-events-have-key-events.d.ts.map +1 -0
- package/dist/rules/mouse-events-have-key-events.js +18 -5
- package/dist/rules/no-any.d.ts +5 -0
- package/dist/rules/no-any.d.ts.map +1 -0
- package/dist/rules/no-autofocus.d.ts +5 -0
- package/dist/rules/no-autofocus.d.ts.map +1 -0
- package/dist/rules/no-call-expression.d.ts +10 -0
- package/dist/rules/no-call-expression.d.ts.map +1 -0
- package/dist/rules/no-distracting-elements.d.ts +5 -0
- package/dist/rules/no-distracting-elements.d.ts.map +1 -0
- package/dist/rules/no-duplicate-attributes.d.ts +12 -0
- package/dist/rules/no-duplicate-attributes.d.ts.map +1 -0
- package/dist/rules/no-duplicate-attributes.js +1 -1
- package/dist/rules/no-inline-styles.d.ts +11 -0
- package/dist/rules/no-inline-styles.d.ts.map +1 -0
- package/dist/rules/no-inline-styles.js +1 -1
- package/dist/rules/no-interpolation-in-attributes.d.ts +5 -0
- package/dist/rules/no-interpolation-in-attributes.d.ts.map +1 -0
- package/dist/rules/no-negated-async.d.ts +8 -0
- package/dist/rules/no-negated-async.d.ts.map +1 -0
- package/dist/rules/no-positive-tabindex.d.ts +5 -0
- package/dist/rules/no-positive-tabindex.d.ts.map +1 -0
- package/dist/rules/prefer-control-flow.d.ts +5 -0
- package/dist/rules/prefer-control-flow.d.ts.map +1 -0
- package/dist/rules/prefer-ngsrc.d.ts +5 -0
- package/dist/rules/prefer-ngsrc.d.ts.map +1 -0
- package/dist/rules/prefer-self-closing-tags.d.ts +5 -0
- package/dist/rules/prefer-self-closing-tags.d.ts.map +1 -0
- package/dist/rules/prefer-self-closing-tags.js +3 -3
- package/dist/rules/role-has-required-aria.d.ts +5 -0
- package/dist/rules/role-has-required-aria.d.ts.map +1 -0
- package/dist/rules/role-has-required-aria.js +3 -3
- package/dist/rules/table-scope.d.ts +5 -0
- package/dist/rules/table-scope.d.ts.map +1 -0
- package/dist/rules/use-track-by-function.d.ts +8 -0
- package/dist/rules/use-track-by-function.d.ts.map +1 -0
- package/dist/rules/use-track-by-function.js +8 -2
- package/dist/rules/valid-aria.d.ts +5 -0
- package/dist/rules/valid-aria.d.ts.map +1 -0
- package/dist/rules/valid-aria.js +1 -1
- package/dist/utils/attributes-comparator.d.ts +4 -0
- package/dist/utils/attributes-comparator.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +9 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/create-eslint-rule.d.ts +3 -0
- package/dist/utils/create-eslint-rule.d.ts.map +1 -0
- package/dist/utils/get-attribute-value.d.ts +13 -0
- package/dist/utils/get-attribute-value.d.ts.map +1 -0
- package/dist/utils/get-attribute-value.js +2 -2
- package/dist/utils/get-dom-elements.d.ts +2 -0
- package/dist/utils/get-dom-elements.d.ts.map +1 -0
- package/dist/utils/get-dom-elements.js +1 -1
- package/dist/utils/get-nearest-node-from.d.ts +7 -0
- package/dist/utils/get-nearest-node-from.d.ts.map +1 -0
- package/dist/utils/get-original-attribute-name.d.ts +14 -0
- package/dist/utils/get-original-attribute-name.d.ts.map +1 -0
- package/dist/utils/get-original-attribute-name.js +1 -2
- package/dist/utils/is-child-node-of.d.ts +3 -0
- package/dist/utils/is-child-node-of.d.ts.map +1 -0
- package/dist/utils/is-content-editable.d.ts +3 -0
- package/dist/utils/is-content-editable.d.ts.map +1 -0
- package/dist/utils/is-disabled-element.d.ts +3 -0
- package/dist/utils/is-disabled-element.d.ts.map +1 -0
- package/dist/utils/is-hidden-from-screen-reader.d.ts +10 -0
- package/dist/utils/is-hidden-from-screen-reader.d.ts.map +1 -0
- package/dist/utils/is-interactive-element/get-interactive-element-ax-object-schemas.d.ts +10 -0
- package/dist/utils/is-interactive-element/get-interactive-element-ax-object-schemas.d.ts.map +1 -0
- package/dist/utils/is-interactive-element/get-interactive-element-ax-object-schemas.js +2 -1
- package/dist/utils/is-interactive-element/get-interactive-element-role-schemas.d.ts +3 -0
- package/dist/utils/is-interactive-element/get-interactive-element-role-schemas.d.ts.map +1 -0
- package/dist/utils/is-interactive-element/get-non-interactive-element-role-schemas.d.ts +4 -0
- package/dist/utils/is-interactive-element/get-non-interactive-element-role-schemas.d.ts.map +1 -0
- package/dist/utils/is-interactive-element/index.d.ts +10 -0
- package/dist/utils/is-interactive-element/index.d.ts.map +1 -0
- package/dist/utils/is-interactive-element/index.js +1 -1
- package/dist/utils/is-presentation-role.d.ts +3 -0
- package/dist/utils/is-presentation-role.d.ts.map +1 -0
- package/dist/utils/is-semantic-role-element.d.ts +3 -0
- package/dist/utils/is-semantic-role-element.d.ts.map +1 -0
- package/dist/utils/is-semantic-role-element.js +11 -16
- package/dist/utils/to-pattern.d.ts +2 -0
- package/dist/utils/to-pattern.d.ts.map +1 -0
- package/package.json +6 -5
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
configs: {
|
|
3
|
+
all: {
|
|
4
|
+
parser: string;
|
|
5
|
+
plugins: string[];
|
|
6
|
+
rules: {
|
|
7
|
+
"@angular-eslint/template/alt-text": string;
|
|
8
|
+
"@angular-eslint/template/attributes-order": string;
|
|
9
|
+
"@angular-eslint/template/banana-in-box": string;
|
|
10
|
+
"@angular-eslint/template/button-has-type": string;
|
|
11
|
+
"@angular-eslint/template/click-events-have-key-events": string;
|
|
12
|
+
"@angular-eslint/template/conditional-complexity": string;
|
|
13
|
+
"@angular-eslint/template/cyclomatic-complexity": string;
|
|
14
|
+
"@angular-eslint/template/elements-content": string;
|
|
15
|
+
"@angular-eslint/template/eqeqeq": string;
|
|
16
|
+
"@angular-eslint/template/i18n": string;
|
|
17
|
+
"@angular-eslint/template/interactive-supports-focus": string;
|
|
18
|
+
"@angular-eslint/template/label-has-associated-control": string;
|
|
19
|
+
"@angular-eslint/template/mouse-events-have-key-events": string;
|
|
20
|
+
"@angular-eslint/template/no-any": string;
|
|
21
|
+
"@angular-eslint/template/no-autofocus": string;
|
|
22
|
+
"@angular-eslint/template/no-call-expression": string;
|
|
23
|
+
"@angular-eslint/template/no-distracting-elements": string;
|
|
24
|
+
"@angular-eslint/template/no-duplicate-attributes": string;
|
|
25
|
+
"@angular-eslint/template/no-inline-styles": string;
|
|
26
|
+
"@angular-eslint/template/no-interpolation-in-attributes": string;
|
|
27
|
+
"@angular-eslint/template/no-negated-async": string;
|
|
28
|
+
"@angular-eslint/template/no-positive-tabindex": string;
|
|
29
|
+
"@angular-eslint/template/prefer-control-flow": string;
|
|
30
|
+
"@angular-eslint/template/prefer-ngsrc": string;
|
|
31
|
+
"@angular-eslint/template/prefer-self-closing-tags": string;
|
|
32
|
+
"@angular-eslint/template/role-has-required-aria": string;
|
|
33
|
+
"@angular-eslint/template/table-scope": string;
|
|
34
|
+
"@angular-eslint/template/use-track-by-function": string;
|
|
35
|
+
"@angular-eslint/template/valid-aria": string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
recommended: {
|
|
39
|
+
parser: string;
|
|
40
|
+
plugins: string[];
|
|
41
|
+
rules: {
|
|
42
|
+
"@angular-eslint/template/banana-in-box": string;
|
|
43
|
+
"@angular-eslint/template/eqeqeq": string;
|
|
44
|
+
"@angular-eslint/template/no-negated-async": string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
accessibility: {
|
|
48
|
+
parser: string;
|
|
49
|
+
plugins: string[];
|
|
50
|
+
rules: {
|
|
51
|
+
"@angular-eslint/template/alt-text": string;
|
|
52
|
+
"@angular-eslint/template/click-events-have-key-events": string;
|
|
53
|
+
"@angular-eslint/template/elements-content": string;
|
|
54
|
+
"@angular-eslint/template/interactive-supports-focus": string;
|
|
55
|
+
"@angular-eslint/template/label-has-associated-control": string;
|
|
56
|
+
"@angular-eslint/template/mouse-events-have-key-events": string;
|
|
57
|
+
"@angular-eslint/template/no-autofocus": string;
|
|
58
|
+
"@angular-eslint/template/no-distracting-elements": string;
|
|
59
|
+
"@angular-eslint/template/role-has-required-aria": string;
|
|
60
|
+
"@angular-eslint/template/table-scope": string;
|
|
61
|
+
"@angular-eslint/template/valid-aria": string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
'process-inline-templates': {
|
|
65
|
+
parser: string;
|
|
66
|
+
parserOptions: {
|
|
67
|
+
ecmaVersion: number;
|
|
68
|
+
sourceType: string;
|
|
69
|
+
};
|
|
70
|
+
plugins: string[];
|
|
71
|
+
processor: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
processors: {
|
|
75
|
+
'extract-inline-html': {
|
|
76
|
+
preprocess: typeof import("./processors").preprocessComponentFile;
|
|
77
|
+
postprocess: typeof import("./processors").postprocessComponentFile;
|
|
78
|
+
supportsAutofix: boolean;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
rules: {
|
|
82
|
+
"alt-text": import("@typescript-eslint/utils/ts-eslint").RuleModule<"altText", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
83
|
+
"attributes-order": import("@typescript-eslint/utils/ts-eslint").RuleModule<"attributesOrder", [{
|
|
84
|
+
readonly alphabetical: boolean;
|
|
85
|
+
readonly order: readonly import("./rules/attributes-order").OrderType[];
|
|
86
|
+
}], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
87
|
+
"banana-in-box": import("@typescript-eslint/utils/ts-eslint").RuleModule<"bananaInBox", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
88
|
+
"button-has-type": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/button-has-type").MessageIds, [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
89
|
+
"click-events-have-key-events": import("@typescript-eslint/utils/ts-eslint").RuleModule<"clickEventsHaveKeyEvents", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
90
|
+
"conditional-complexity": import("@typescript-eslint/utils/ts-eslint").RuleModule<"conditionalComplexity", [{
|
|
91
|
+
maxComplexity: number;
|
|
92
|
+
}], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
93
|
+
"cyclomatic-complexity": import("@typescript-eslint/utils/ts-eslint").RuleModule<"cyclomaticComplexity", [{
|
|
94
|
+
maxComplexity: number;
|
|
95
|
+
}], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
96
|
+
"elements-content": import("@typescript-eslint/utils/ts-eslint").RuleModule<"elementsContent", [{
|
|
97
|
+
readonly allowList?: readonly string[] | undefined;
|
|
98
|
+
}], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
99
|
+
eqeqeq: import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/eqeqeq").MessageIds, [{
|
|
100
|
+
readonly allowNullOrUndefined?: boolean | undefined;
|
|
101
|
+
}], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
102
|
+
i18n: import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/i18n").MessageIds, [{
|
|
103
|
+
readonly boundTextAllowedPattern?: string | undefined;
|
|
104
|
+
readonly checkAttributes?: boolean | undefined;
|
|
105
|
+
readonly checkDuplicateId?: boolean | undefined;
|
|
106
|
+
readonly checkId?: boolean | undefined;
|
|
107
|
+
readonly checkText?: boolean | undefined;
|
|
108
|
+
readonly ignoreAttributes?: readonly string[] | undefined;
|
|
109
|
+
readonly ignoreTags?: readonly string[] | undefined;
|
|
110
|
+
readonly requireDescription?: boolean | undefined;
|
|
111
|
+
readonly requireMeaning?: boolean | undefined;
|
|
112
|
+
}], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
113
|
+
"interactive-supports-focus": import("@typescript-eslint/utils/ts-eslint").RuleModule<"interactiveSupportsFocus", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
114
|
+
"label-has-associated-control": import("@typescript-eslint/utils/ts-eslint").RuleModule<"labelHasAssociatedControl", [{
|
|
115
|
+
readonly controlComponents?: readonly string[] | undefined;
|
|
116
|
+
readonly labelComponents?: readonly {
|
|
117
|
+
readonly inputs?: readonly string[] | undefined;
|
|
118
|
+
readonly selector: string;
|
|
119
|
+
}[] | undefined;
|
|
120
|
+
}], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
121
|
+
"mouse-events-have-key-events": import("@typescript-eslint/utils/ts-eslint").RuleModule<"mouseEventsHaveKeyEvents", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
122
|
+
"no-any": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/no-any").MessageIds, [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
123
|
+
"no-autofocus": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noAutofocus", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
124
|
+
"no-call-expression": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noCallExpression", [{
|
|
125
|
+
readonly allowList?: readonly string[] | undefined;
|
|
126
|
+
}], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
127
|
+
"no-distracting-elements": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noDistractingElements", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
128
|
+
"no-duplicate-attributes": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/no-duplicate-attributes").MessageIds, [{
|
|
129
|
+
readonly allowTwoWayDataBinding?: boolean | undefined;
|
|
130
|
+
readonly allowStylePrecedenceDuplicates?: boolean | undefined;
|
|
131
|
+
readonly ignore?: readonly string[] | undefined;
|
|
132
|
+
}], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
133
|
+
"no-inline-styles": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noInlineStyles", [{
|
|
134
|
+
readonly allowNgStyle?: boolean | undefined;
|
|
135
|
+
readonly allowBindToStyle?: boolean | undefined;
|
|
136
|
+
}], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
137
|
+
"no-interpolation-in-attributes": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noInterpolationInAttributes", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
138
|
+
"no-negated-async": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/no-negated-async").MessageIds, [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
139
|
+
"no-positive-tabindex": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/no-positive-tabindex").MessageIds, [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
140
|
+
"prefer-control-flow": import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferControlFlow", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
141
|
+
"prefer-self-closing-tags": import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferSelfClosingTags", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
142
|
+
"prefer-ngsrc": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/prefer-ngsrc").MessageIds, [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
143
|
+
"role-has-required-aria": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/role-has-required-aria").MessageIds, [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
144
|
+
"table-scope": import("@typescript-eslint/utils/ts-eslint").RuleModule<"tableScope", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
145
|
+
"use-track-by-function": import("@typescript-eslint/utils/ts-eslint").RuleModule<"useTrackByFunction", [{
|
|
146
|
+
readonly alias: readonly string[];
|
|
147
|
+
}], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
148
|
+
"valid-aria": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./rules/valid-aria").MessageIds, [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
export = _default;
|
|
152
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,kBAuCE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Because ultimately a user is in control of how and when this processor gets invoked,
|
|
3
|
+
* we can't fully protect them against doing more work than is necessary in all cases.
|
|
4
|
+
*
|
|
5
|
+
* Therefore, before we do a full parse of a TypeScript file to try and extract one or
|
|
6
|
+
* more Component declarations we want to do a really quick check for whether or not
|
|
7
|
+
* a file is likely to contain them.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isFileLikelyToContainComponentDeclarations(text: string, filename: string): boolean;
|
|
10
|
+
type PreprocessResult = (string | {
|
|
11
|
+
text: string;
|
|
12
|
+
filename: string;
|
|
13
|
+
})[];
|
|
14
|
+
export declare function preprocessComponentFile(text: string, filename: string): PreprocessResult;
|
|
15
|
+
export declare function postprocessComponentFile(multiDimensionalMessages: {
|
|
16
|
+
ruleId: string;
|
|
17
|
+
severity: number;
|
|
18
|
+
message: string;
|
|
19
|
+
line: number;
|
|
20
|
+
column: number;
|
|
21
|
+
nodeType: string;
|
|
22
|
+
messageId: string;
|
|
23
|
+
endLine: number;
|
|
24
|
+
endColumn: number;
|
|
25
|
+
fix?: {
|
|
26
|
+
range: number[];
|
|
27
|
+
text: string;
|
|
28
|
+
};
|
|
29
|
+
}[][], filename: string): readonly unknown[];
|
|
30
|
+
declare const _default: {
|
|
31
|
+
'extract-inline-html': {
|
|
32
|
+
preprocess: typeof preprocessComponentFile;
|
|
33
|
+
postprocess: typeof postprocessComponentFile;
|
|
34
|
+
supportsAutofix: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export default _default;
|
|
38
|
+
//# sourceMappingURL=processors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processors.d.ts","sourceRoot":"","sources":["../src/processors.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,wBAAgB,0CAA0C,CACxD,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,OAAO,CA2BT;AAED,KAAK,gBAAgB,GAAG,CAAC,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,CAAC;AAExE,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,gBAAgB,CAsJlB;AAED,wBAAgB,wBAAwB,CACtC,wBAAwB,EAAE;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE;QACJ,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,EAAE,EAAE,EACL,QAAQ,EAAE,MAAM,GACf,SAAS,OAAO,EAAE,CAmDpB;;;;;;;;AAED,wBAME"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type MessageIds = 'altText';
|
|
2
|
+
export declare const RULE_NAME = "alt-text";
|
|
3
|
+
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"altText", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=alt-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alt-text.d.ts","sourceRoot":"","sources":["../../src/rules/alt-text.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC;AACnC,eAAO,MAAM,SAAS,aAAa,CAAC;;AAEpC,wBAsCG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum OrderType {
|
|
2
|
+
TemplateReferenceVariable = "TEMPLATE_REFERENCE",
|
|
3
|
+
StructuralDirective = "STRUCTURAL_DIRECTIVE",
|
|
4
|
+
AttributeBinding = "ATTRIBUTE_BINDING",
|
|
5
|
+
InputBinding = "INPUT_BINDING",
|
|
6
|
+
OutputBinding = "OUTPUT_BINDING",
|
|
7
|
+
TwoWayBinding = "TWO_WAY_BINDING"
|
|
8
|
+
}
|
|
9
|
+
type Options = [
|
|
10
|
+
{
|
|
11
|
+
readonly alphabetical: boolean;
|
|
12
|
+
readonly order: readonly OrderType[];
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
export type MessageIds = 'attributesOrder';
|
|
16
|
+
export declare const RULE_NAME = "attributes-order";
|
|
17
|
+
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"attributesOrder", Options, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
18
|
+
export default _default;
|
|
19
|
+
//# sourceMappingURL=attributes-order.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes-order.d.ts","sourceRoot":"","sources":["../../src/rules/attributes-order.ts"],"names":[],"mappings":"AAiBA,oBAAY,SAAS;IACnB,yBAAyB,uBAAuB;IAChD,mBAAmB,yBAAyB;IAC5C,gBAAgB,sBAAsB;IACtC,YAAY,kBAAkB;IAC9B,aAAa,mBAAmB;IAChC,aAAa,oBAAoB;CAClC;AAED,KAAK,OAAO,GAAG;IACb;QACE,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;QAC/B,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;KACtC;CACF,CAAC;AA6BF,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAC3C,eAAO,MAAM,SAAS,qBAAqB,CAAC;;AAgB5C,wBAmJG"}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RULE_NAME = void 0;
|
|
3
|
+
exports.RULE_NAME = exports.OrderType = void 0;
|
|
4
4
|
const bundled_angular_compiler_1 = require("@angular-eslint/bundled-angular-compiler");
|
|
5
5
|
const utils_1 = require("@angular-eslint/utils");
|
|
6
6
|
const create_eslint_rule_1 = require("../utils/create-eslint-rule");
|
|
7
|
+
var OrderType;
|
|
8
|
+
(function (OrderType) {
|
|
9
|
+
OrderType["TemplateReferenceVariable"] = "TEMPLATE_REFERENCE";
|
|
10
|
+
OrderType["StructuralDirective"] = "STRUCTURAL_DIRECTIVE";
|
|
11
|
+
OrderType["AttributeBinding"] = "ATTRIBUTE_BINDING";
|
|
12
|
+
OrderType["InputBinding"] = "INPUT_BINDING";
|
|
13
|
+
OrderType["OutputBinding"] = "OUTPUT_BINDING";
|
|
14
|
+
OrderType["TwoWayBinding"] = "TWO_WAY_BINDING";
|
|
15
|
+
})(OrderType || (exports.OrderType = OrderType = {}));
|
|
7
16
|
exports.RULE_NAME = 'attributes-order';
|
|
8
17
|
const DEFAULT_ORDER = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
OrderType.StructuralDirective,
|
|
19
|
+
OrderType.TemplateReferenceVariable,
|
|
20
|
+
OrderType.AttributeBinding,
|
|
21
|
+
OrderType.InputBinding,
|
|
22
|
+
OrderType.TwoWayBinding,
|
|
23
|
+
OrderType.OutputBinding,
|
|
15
24
|
];
|
|
16
25
|
const DEFAULT_OPTIONS = {
|
|
17
26
|
alphabetical: false,
|
|
@@ -57,7 +66,7 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
|
|
|
57
66
|
function getLocation(attr) {
|
|
58
67
|
const loc = parserServices.convertNodeSourceSpanToLoc(attr.sourceSpan);
|
|
59
68
|
switch (attr.orderType) {
|
|
60
|
-
case
|
|
69
|
+
case OrderType.StructuralDirective:
|
|
61
70
|
return {
|
|
62
71
|
start: {
|
|
63
72
|
line: loc.start.line,
|
|
@@ -74,7 +83,6 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
|
|
|
74
83
|
}
|
|
75
84
|
return {
|
|
76
85
|
['Element$1, Template'](node) {
|
|
77
|
-
var _a;
|
|
78
86
|
if (isImplicitTemplate(node)) {
|
|
79
87
|
return;
|
|
80
88
|
}
|
|
@@ -96,7 +104,7 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
|
|
|
96
104
|
let errorRange;
|
|
97
105
|
for (let i = 0; i < sortedAttributes.length; i++) {
|
|
98
106
|
if (sortedAttributes[i] !== expectedAttributes[i]) {
|
|
99
|
-
errorRange = [
|
|
107
|
+
errorRange = [errorRange?.[0] ?? i, i];
|
|
100
108
|
}
|
|
101
109
|
}
|
|
102
110
|
if (errorRange) {
|
|
@@ -149,12 +157,11 @@ function byLocation(one, other) {
|
|
|
149
157
|
}
|
|
150
158
|
function byOrder(order, alphabetical) {
|
|
151
159
|
return function (one, other) {
|
|
152
|
-
var _a, _b, _c, _d;
|
|
153
160
|
const orderComparison = getOrderIndex(one, order) - getOrderIndex(other, order);
|
|
154
161
|
if (alphabetical && orderComparison === 0) {
|
|
155
|
-
const oneName =
|
|
162
|
+
const oneName = one.keySpan?.details ?? one.name;
|
|
156
163
|
const oneNormalised = oneName.replace(/^i18n-/, '');
|
|
157
|
-
const otherName =
|
|
164
|
+
const otherName = other.keySpan?.details ?? other.name;
|
|
158
165
|
const otherNormalised = otherName.replace(/^i18n-/, '');
|
|
159
166
|
if (oneNormalised === otherNormalised) {
|
|
160
167
|
return /^i18n-/.test(oneName) ? 1 : -1;
|
|
@@ -168,33 +175,53 @@ function getOrderIndex(attr, order) {
|
|
|
168
175
|
return order.indexOf(attr.orderType);
|
|
169
176
|
}
|
|
170
177
|
function toAttributeBindingOrderType(attribute) {
|
|
171
|
-
return
|
|
178
|
+
return {
|
|
179
|
+
...attribute,
|
|
180
|
+
orderType: OrderType.AttributeBinding,
|
|
181
|
+
};
|
|
172
182
|
}
|
|
173
183
|
function toInputBindingOrderType(input) {
|
|
174
|
-
return
|
|
184
|
+
return {
|
|
185
|
+
...input,
|
|
186
|
+
orderType: OrderType.InputBinding,
|
|
187
|
+
};
|
|
175
188
|
}
|
|
176
189
|
function toStructuralDirectiveOrderType(attributeOrInput) {
|
|
177
|
-
return
|
|
190
|
+
return {
|
|
191
|
+
...attributeOrInput,
|
|
192
|
+
orderType: OrderType.StructuralDirective,
|
|
193
|
+
};
|
|
178
194
|
}
|
|
179
195
|
function toOutputBindingOrderType(output) {
|
|
180
|
-
return
|
|
196
|
+
return {
|
|
197
|
+
...output,
|
|
198
|
+
orderType: OrderType.OutputBinding,
|
|
199
|
+
};
|
|
181
200
|
}
|
|
182
201
|
function toTwoWayBindingOrderType(output) {
|
|
183
|
-
return
|
|
202
|
+
return {
|
|
203
|
+
...output,
|
|
204
|
+
orderType: OrderType.TwoWayBinding,
|
|
205
|
+
};
|
|
184
206
|
}
|
|
185
207
|
function toTemplateReferenceVariableOrderType(reference) {
|
|
186
|
-
return
|
|
208
|
+
return {
|
|
209
|
+
...reference,
|
|
210
|
+
orderType: OrderType.TemplateReferenceVariable,
|
|
211
|
+
};
|
|
187
212
|
}
|
|
188
213
|
function isImplicitTemplate(node) {
|
|
189
214
|
return isTmplAstTemplate(node) && node.tagName !== 'ng-template';
|
|
190
215
|
}
|
|
191
216
|
function extractTemplateAttrs(node) {
|
|
192
|
-
var _a, _b, _c, _d, _e, _f;
|
|
193
217
|
if (isTmplAstTemplate(node)) {
|
|
194
218
|
return node.templateAttrs.map(toStructuralDirectiveOrderType).concat(node.variables.map((x) => {
|
|
195
|
-
return
|
|
219
|
+
return {
|
|
220
|
+
...toAttributeBindingOrderType(x),
|
|
196
221
|
// `let-` is excluded from the keySpan and name - add it back in
|
|
197
|
-
keySpan: new bundled_angular_compiler_1.ParseSourceSpan(x.keySpan.start.moveBy(-4), x.keySpan.end),
|
|
222
|
+
keySpan: new bundled_angular_compiler_1.ParseSourceSpan(x.keySpan.start.moveBy(-4), x.keySpan.end),
|
|
223
|
+
name: 'let-' + x.name,
|
|
224
|
+
};
|
|
198
225
|
}));
|
|
199
226
|
}
|
|
200
227
|
if (!isImplicitTemplate(node.parent)) {
|
|
@@ -207,22 +234,25 @@ function extractTemplateAttrs(node) {
|
|
|
207
234
|
* will parsed as two attributes (`ngFor` and `ngForOf`)
|
|
208
235
|
*/
|
|
209
236
|
const attrs = node.parent.templateAttrs.map(toStructuralDirectiveOrderType);
|
|
210
|
-
let keyEnd =
|
|
211
|
-
if (
|
|
237
|
+
let keyEnd = attrs[0].keySpan?.end;
|
|
238
|
+
if (keyEnd?.getContext(0, 0)?.after === '=') {
|
|
212
239
|
keyEnd = keyEnd.moveBy(1);
|
|
213
|
-
const apos =
|
|
240
|
+
const apos = keyEnd.getContext(0, 0)?.after;
|
|
214
241
|
if (apos === "'" || apos === '"') {
|
|
215
242
|
do {
|
|
216
243
|
keyEnd = keyEnd.moveBy(1);
|
|
217
|
-
} while (
|
|
244
|
+
} while (keyEnd.getContext(0, 0)?.after !== apos);
|
|
218
245
|
}
|
|
219
246
|
else {
|
|
220
|
-
while (!/[\s>]/.test(
|
|
247
|
+
while (!/[\s>]/.test(keyEnd.getContext(0, 0)?.after ?? '')) {
|
|
221
248
|
keyEnd = keyEnd.moveBy(1);
|
|
222
249
|
}
|
|
223
250
|
}
|
|
224
251
|
return [
|
|
225
|
-
|
|
252
|
+
{
|
|
253
|
+
...attrs[0],
|
|
254
|
+
sourceSpan: new bundled_angular_compiler_1.ParseSourceSpan(attrs[0].sourceSpan.start, keyEnd),
|
|
255
|
+
},
|
|
226
256
|
];
|
|
227
257
|
}
|
|
228
258
|
return [attrs[0]];
|
|
@@ -248,25 +278,24 @@ function isOnSameLocation(input, output) {
|
|
|
248
278
|
input.sourceSpan.end === output.sourceSpan.end);
|
|
249
279
|
}
|
|
250
280
|
function getMessageName(expected) {
|
|
251
|
-
|
|
252
|
-
const fullName = (_b = (_a = expected.keySpan) === null || _a === void 0 ? void 0 : _a.details) !== null && _b !== void 0 ? _b : expected.name;
|
|
281
|
+
const fullName = expected.keySpan?.details ?? expected.name;
|
|
253
282
|
switch (expected.orderType) {
|
|
254
|
-
case
|
|
283
|
+
case OrderType.StructuralDirective:
|
|
255
284
|
return `*${fullName}`;
|
|
256
|
-
case
|
|
285
|
+
case OrderType.TemplateReferenceVariable:
|
|
257
286
|
return `#${fullName}`;
|
|
258
|
-
case
|
|
287
|
+
case OrderType.InputBinding:
|
|
259
288
|
return `[${fullName}]`;
|
|
260
|
-
case
|
|
289
|
+
case OrderType.OutputBinding:
|
|
261
290
|
return `(${fullName})`;
|
|
262
|
-
case
|
|
291
|
+
case OrderType.TwoWayBinding:
|
|
263
292
|
return `[(${fullName})]`;
|
|
264
293
|
default:
|
|
265
294
|
return fullName;
|
|
266
295
|
}
|
|
267
296
|
}
|
|
268
297
|
function isValuelessStructuralDirective(attr) {
|
|
269
|
-
if (attr.orderType !==
|
|
298
|
+
if (attr.orderType !== OrderType.StructuralDirective || !attr.keySpan) {
|
|
270
299
|
return false;
|
|
271
300
|
}
|
|
272
301
|
const attrSpan = attr.sourceSpan;
|
|
@@ -285,7 +314,7 @@ function isValuelessStructuralDirective(attr) {
|
|
|
285
314
|
}
|
|
286
315
|
function getStartPos(expected) {
|
|
287
316
|
switch (expected.orderType) {
|
|
288
|
-
case
|
|
317
|
+
case OrderType.StructuralDirective:
|
|
289
318
|
return expected.sourceSpan.start.offset - 1;
|
|
290
319
|
default:
|
|
291
320
|
return expected.sourceSpan.start.offset;
|
|
@@ -293,7 +322,7 @@ function getStartPos(expected) {
|
|
|
293
322
|
}
|
|
294
323
|
function getEndPos(expected) {
|
|
295
324
|
switch (expected.orderType) {
|
|
296
|
-
case
|
|
325
|
+
case OrderType.StructuralDirective:
|
|
297
326
|
return (expected.sourceSpan.end.offset +
|
|
298
327
|
(isValuelessStructuralDirective(expected) ? 0 : 1));
|
|
299
328
|
default:
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type MessageIds = 'bananaInBox';
|
|
2
|
+
export declare const RULE_NAME = "banana-in-box";
|
|
3
|
+
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"bananaInBox", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=banana-in-box.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banana-in-box.d.ts","sourceRoot":"","sources":["../../src/rules/banana-in-box.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;AACvC,eAAO,MAAM,SAAS,kBAAkB,CAAC;;AAKzC,wBA2CG"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const RULE_NAME = "button-has-type";
|
|
2
|
+
export declare const INVALID_TYPE_DATA_KEY = "type";
|
|
3
|
+
export type MessageIds = 'invalidType' | 'missingType';
|
|
4
|
+
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
5
|
+
export default _default;
|
|
6
|
+
//# sourceMappingURL=button-has-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-has-type.d.ts","sourceRoot":"","sources":["../../src/rules/button-has-type.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,SAAS,oBAAoB,CAAC;AAC3C,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAC5C,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,aAAa,CAAC;;AAWvD,wBAyCG"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type MessageIds = 'clickEventsHaveKeyEvents';
|
|
2
|
+
export declare const RULE_NAME = "click-events-have-key-events";
|
|
3
|
+
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"clickEventsHaveKeyEvents", [], import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=click-events-have-key-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click-events-have-key-events.d.ts","sourceRoot":"","sources":["../../src/rules/click-events-have-key-events.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,UAAU,GAAG,0BAA0B,CAAC;AACpD,eAAO,MAAM,SAAS,iCAAiC,CAAC;;AAExD,wBAwDG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type Options = [{
|
|
2
|
+
maxComplexity: number;
|
|
3
|
+
}];
|
|
4
|
+
export type MessageIds = 'conditionalComplexity';
|
|
5
|
+
export declare const RULE_NAME = "conditional-complexity";
|
|
6
|
+
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"conditionalComplexity", Options, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=conditional-complexity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditional-complexity.d.ts","sourceRoot":"","sources":["../../src/rules/conditional-complexity.ts"],"names":[],"mappings":"AAgBA,KAAK,OAAO,GAAG,CAAC;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAC3C,MAAM,MAAM,UAAU,GAAG,uBAAuB,CAAC;AACjD,eAAO,MAAM,SAAS,2BAA2B,CAAC;;AAIlD,wBAkFG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type Options = [{
|
|
2
|
+
maxComplexity: number;
|
|
3
|
+
}];
|
|
4
|
+
export type MessageIds = 'cyclomaticComplexity';
|
|
5
|
+
export declare const RULE_NAME = "cyclomatic-complexity";
|
|
6
|
+
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"cyclomaticComplexity", Options, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=cyclomatic-complexity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclomatic-complexity.d.ts","sourceRoot":"","sources":["../../src/rules/cyclomatic-complexity.ts"],"names":[],"mappings":"AAOA,KAAK,OAAO,GAAG,CAAC;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAC3C,MAAM,MAAM,UAAU,GAAG,sBAAsB,CAAC;AAChD,eAAO,MAAM,SAAS,0BAA0B,CAAC;;AAIjD,wBA+CG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type Options = [
|
|
2
|
+
{
|
|
3
|
+
readonly allowList?: readonly string[];
|
|
4
|
+
}
|
|
5
|
+
];
|
|
6
|
+
export type MessageIds = 'elementsContent';
|
|
7
|
+
export declare const RULE_NAME = "elements-content";
|
|
8
|
+
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"elementsContent", Options, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=elements-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements-content.d.ts","sourceRoot":"","sources":["../../src/rules/elements-content.ts"],"names":[],"mappings":"AAKA,KAAK,OAAO,GAAG;IACb;QACE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;KACxC;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAC3C,eAAO,MAAM,SAAS,qBAAqB,CAAC;;AAa5C,wBAwDG"}
|
|
@@ -50,7 +50,7 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
|
|
|
50
50
|
const { attributes, inputs, name: element, sourceSpan } = node;
|
|
51
51
|
const safelistAttributes = new Set([
|
|
52
52
|
...DEFAULT_SAFELIST_ATTRIBUTES,
|
|
53
|
-
...(allowList
|
|
53
|
+
...(allowList ?? []),
|
|
54
54
|
]);
|
|
55
55
|
const hasAttributeSafelisted = [...attributes, ...inputs]
|
|
56
56
|
.map(({ name }) => name)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type Options = [{
|
|
3
|
+
readonly allowNullOrUndefined?: boolean;
|
|
4
|
+
}];
|
|
5
|
+
export type MessageIds = 'eqeqeq' | 'suggestStrictEquality';
|
|
6
|
+
export declare const RULE_NAME = "eqeqeq";
|
|
7
|
+
declare const _default: TSESLint.RuleModule<MessageIds, Options, TSESLint.RuleListener>;
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=eqeqeq.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eqeqeq.d.ts","sourceRoot":"","sources":["../../src/rules/eqeqeq.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,KAAK,OAAO,GAAG,CAAC;IAAE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAC7D,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,uBAAuB,CAAC;AAC5D,eAAO,MAAM,SAAS,WAAW,CAAC;;AAGlC,wBA4EG"}
|
package/dist/rules/eqeqeq.js
CHANGED
|
@@ -48,22 +48,27 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
|
|
|
48
48
|
actualOperation: operation,
|
|
49
49
|
expectedOperation: `${operation}=`,
|
|
50
50
|
};
|
|
51
|
-
context.report(
|
|
51
|
+
context.report({
|
|
52
|
+
loc: {
|
|
52
53
|
start: sourceCode.getLocFromIndex(start),
|
|
53
54
|
end: sourceCode.getLocFromIndex(end),
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
},
|
|
56
|
+
messageId: 'eqeqeq',
|
|
57
|
+
data,
|
|
58
|
+
...(isStringNonNumericValue(left) || isStringNonNumericValue(right)
|
|
59
|
+
? {
|
|
60
|
+
fix: (fixer) => getFix({ node, right, end, sourceCode, fixer }),
|
|
61
|
+
}
|
|
62
|
+
: {
|
|
63
|
+
suggest: [
|
|
64
|
+
{
|
|
65
|
+
messageId: 'suggestStrictEquality',
|
|
66
|
+
fix: (fixer) => getFix({ node, right, end, sourceCode, fixer }),
|
|
67
|
+
data,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
67
72
|
},
|
|
68
73
|
};
|
|
69
74
|
},
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type Options = [
|
|
3
|
+
{
|
|
4
|
+
readonly boundTextAllowedPattern?: string;
|
|
5
|
+
readonly checkAttributes?: boolean;
|
|
6
|
+
readonly checkDuplicateId?: boolean;
|
|
7
|
+
readonly checkId?: boolean;
|
|
8
|
+
readonly checkText?: boolean;
|
|
9
|
+
readonly ignoreAttributes?: readonly string[];
|
|
10
|
+
readonly ignoreTags?: readonly string[];
|
|
11
|
+
readonly requireDescription?: boolean;
|
|
12
|
+
readonly requireMeaning?: boolean;
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
export type MessageIds = 'i18nAttribute' | 'i18nAttributeOnIcuOrText' | 'i18nCustomIdOnAttribute' | 'i18nCustomIdOnElement' | 'i18nDuplicateCustomId' | 'suggestAddI18nAttribute' | 'i18nMissingDescription' | 'i18nMissingMeaning';
|
|
16
|
+
export declare const RULE_NAME = "i18n";
|
|
17
|
+
declare const _default: TSESLint.RuleModule<MessageIds, Options, TSESLint.RuleListener>;
|
|
18
|
+
export default _default;
|
|
19
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/rules/i18n.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,0BAA0B,CAAC;AA6CnE,KAAK,OAAO,GAAG;IACb;QACE,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;QAC1C,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;QACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;QACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;QAC7B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QACxC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;QACtC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;KACnC;CACF,CAAC;AACF,MAAM,MAAM,UAAU,GAClB,eAAe,GACf,0BAA0B,GAC1B,yBAAyB,GACzB,uBAAuB,GACvB,uBAAuB,GACvB,yBAAyB,GACzB,wBAAwB,GACxB,oBAAoB,CAAC;AAqBzB,eAAO,MAAM,SAAS,SAAS,CAAC;;AAiBhC,wBAqTG"}
|