@angular-eslint/utils 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/convert-annotated-source-to-failure-case.d.ts +1 -0
- package/dist/convert-annotated-source-to-failure-case.d.ts.map +1 -0
- package/dist/convert-annotated-source-to-failure-case.js +3 -4
- package/dist/eslint-plugin/ast-utils.d.ts +1 -0
- package/dist/eslint-plugin/ast-utils.d.ts.map +1 -0
- package/dist/eslint-plugin/ast-utils.js +17 -13
- package/dist/eslint-plugin/get-aria-attribute-keys.d.ts +1 -0
- package/dist/eslint-plugin/get-aria-attribute-keys.d.ts.map +1 -0
- package/dist/eslint-plugin/get-aria-attribute-keys.js +50 -49
- package/dist/eslint-plugin/get-native-event-names.d.ts +1 -0
- package/dist/eslint-plugin/get-native-event-names.d.ts.map +1 -0
- package/dist/eslint-plugin/get-native-event-names.js +175 -174
- package/dist/eslint-plugin/rule-fixes.d.ts +1 -0
- package/dist/eslint-plugin/rule-fixes.d.ts.map +1 -0
- package/dist/eslint-plugin/rule-fixes.js +2 -3
- package/dist/eslint-plugin/selector-utils.d.ts +1 -0
- package/dist/eslint-plugin/selector-utils.d.ts.map +1 -0
- package/dist/eslint-plugin/selectors.d.ts +1 -0
- package/dist/eslint-plugin/selectors.d.ts.map +1 -0
- package/dist/eslint-plugin-template/parser-services.d.ts +1 -0
- package/dist/eslint-plugin-template/parser-services.d.ts.map +1 -0
- package/dist/eslint-plugin-template/parser-services.js +4 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/rules-tester.d.ts +1 -0
- package/dist/rules-tester.d.ts.map +1 -0
- package/dist/rules-tester.js +13 -9
- package/dist/utils.d.ts +2 -1
- package/dist/utils.d.ts.map +1 -0
- package/package.json +4 -3
|
@@ -58,3 +58,4 @@ type SingleErrorOptions<TMessageIds extends string> = BaseErrorOptions & Message
|
|
|
58
58
|
export declare function convertAnnotatedSourceToFailureCase<TMessageIds extends string>(errorOptions: SingleErrorOptions<TMessageIds>): TSESLint.InvalidTestCase<TMessageIds, readonly unknown[]>;
|
|
59
59
|
export declare function convertAnnotatedSourceToFailureCase<TMessageIds extends string>(errorOptions: MultipleErrorOptions<TMessageIds>): TSESLint.InvalidTestCase<TMessageIds, readonly unknown[]>;
|
|
60
60
|
export {};
|
|
61
|
+
//# sourceMappingURL=convert-annotated-source-to-failure-case.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-annotated-source-to-failure-case.d.ts","sourceRoot":"","sources":["../src/convert-annotated-source-to-failure-case.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,mDAS1B,CAAC;AAEX,KAAK,oBAAoB,CAAC,WAAW,SAAS,MAAM,IAAI,gBAAgB,GAAG;IACzE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG;QAClD,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;KACzD,CAAC,EAAE,CAAC;CACN,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACtC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,KAAK,OAAO,CAAC,WAAW,SAAS,MAAM,IAAI;IACzC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,CAAC;CACjE,CAAC;AAEF,KAAK,kBAAkB,CAAC,WAAW,SAAS,MAAM,IAAI,gBAAgB,GACpE,OAAO,CAAC,WAAW,CAAC,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,mCAAmC,CAAC,WAAW,SAAS,MAAM,EAC5E,YAAY,EAAE,kBAAkB,CAAC,WAAW,CAAC,GAC5C,QAAQ,CAAC,eAAe,CAAC,WAAW,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC;AAC7D,wBAAgB,mCAAmC,CAAC,WAAW,SAAS,MAAM,EAC5E,YAAY,EAAE,oBAAoB,CAAC,WAAW,CAAC,GAC9C,QAAQ,CAAC,eAAe,CAAC,WAAW,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC"}
|
|
@@ -21,9 +21,8 @@ exports.SPECIAL_UNDERLINE_CHARS = [
|
|
|
21
21
|
'@',
|
|
22
22
|
];
|
|
23
23
|
function convertAnnotatedSourceToFailureCase(errorOptions) {
|
|
24
|
-
var _a, _b;
|
|
25
24
|
const messages = 'messageId' in errorOptions
|
|
26
|
-
? [
|
|
25
|
+
? [{ ...errorOptions, char: '~' }]
|
|
27
26
|
: errorOptions.messages;
|
|
28
27
|
let parsedSource = '';
|
|
29
28
|
const errors = messages.map(({ char: currentValueChar, data, messageId, suggestions }) => {
|
|
@@ -50,9 +49,9 @@ function convertAnnotatedSourceToFailureCase(errorOptions) {
|
|
|
50
49
|
name: errorOptions.description,
|
|
51
50
|
code: parsedSource,
|
|
52
51
|
filename: errorOptions.filename,
|
|
53
|
-
options:
|
|
52
|
+
options: errorOptions.options ?? [],
|
|
54
53
|
errors,
|
|
55
|
-
only:
|
|
54
|
+
only: errorOptions.only ?? false,
|
|
56
55
|
output: errorOptions.annotatedOutput
|
|
57
56
|
? parseInvalidSource(errorOptions.annotatedOutput).source
|
|
58
57
|
: null,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ast-utils.d.ts","sourceRoot":"","sources":["../../src/eslint-plugin/ast-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAQzD,oBAAY,sBAAsB;IAChC,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,IAAI,SAAS;CACd;AAED,aAAK,qCAAqC;IACxC,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAED,aAAK,uBAAuB;IAC1B,YAAY,iBAAiB;CAC9B;AAED,aAAK,iCAAiC;IACpC,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;IAC3B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,YAAY,iBAAiB;CAC9B;AAED,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;CAIvC,CAAC;AAEF,oBAAY,0BAA0B;IACpC,mBAAmB,wBAAwB;IAC3C,gBAAgB,qBAAqB;IACrC,gBAAgB,qBAAqB;IACrC,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAED,oBAAY,uBAAuB;IACjC,qBAAqB,0BAA0B;IAC/C,kBAAkB,uBAAuB;IACzC,kBAAkB,uBAAuB;IACzC,eAAe,oBAAoB;IACnC,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;CACtB;AAED,eAAO,M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E,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,QAAQ,CAAC,KAAK,CAEnE;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,CAAC,KAAK,GACpB,KAAK,IAAI,QAAQ,CAAC,YAAY,GAAG;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,CAE1D"}
|
|
@@ -35,7 +35,11 @@ var AngularPropertyAccessorDecorators;
|
|
|
35
35
|
AngularPropertyAccessorDecorators["ViewChild"] = "ViewChild";
|
|
36
36
|
AngularPropertyAccessorDecorators["ViewChildren"] = "ViewChildren";
|
|
37
37
|
})(AngularPropertyAccessorDecorators || (AngularPropertyAccessorDecorators = {}));
|
|
38
|
-
exports.AngularInnerClassDecorators =
|
|
38
|
+
exports.AngularInnerClassDecorators = {
|
|
39
|
+
...AngularConstructorParameterDecorators,
|
|
40
|
+
...AngularMethodDecorators,
|
|
41
|
+
...AngularPropertyAccessorDecorators,
|
|
42
|
+
};
|
|
39
43
|
var AngularLifecycleInterfaces;
|
|
40
44
|
(function (AngularLifecycleInterfaces) {
|
|
41
45
|
AngularLifecycleInterfaces["AfterContentChecked"] = "AfterContentChecked";
|
|
@@ -210,8 +214,7 @@ exports.getInterfaceName = getInterfaceName;
|
|
|
210
214
|
const getPipeDecorator = (node) => (0, exports.getDecorator)(node, 'Pipe');
|
|
211
215
|
exports.getPipeDecorator = getPipeDecorator;
|
|
212
216
|
function getInterfaces(node) {
|
|
213
|
-
|
|
214
|
-
return ((_a = node.implements) !== null && _a !== void 0 ? _a : [])
|
|
217
|
+
return (node.implements ?? [])
|
|
215
218
|
.map(({ expression }) => expression)
|
|
216
219
|
.filter(isIdentifierOrMemberExpression);
|
|
217
220
|
}
|
|
@@ -238,9 +241,8 @@ function getNearestNodeFrom({ parent }, predicate) {
|
|
|
238
241
|
}
|
|
239
242
|
exports.getNearestNodeFrom = getNearestNodeFrom;
|
|
240
243
|
const getClassName = (node) => {
|
|
241
|
-
var _a;
|
|
242
244
|
if (isClassDeclaration(node)) {
|
|
243
|
-
return
|
|
245
|
+
return node.id?.name;
|
|
244
246
|
}
|
|
245
247
|
if (node.parent) {
|
|
246
248
|
return (0, exports.getClassName)(node.parent);
|
|
@@ -249,12 +251,14 @@ const getClassName = (node) => {
|
|
|
249
251
|
};
|
|
250
252
|
exports.getClassName = getClassName;
|
|
251
253
|
const getDecorator = (node, decoratorName) => {
|
|
252
|
-
|
|
253
|
-
return (_a = node.decorators) === null || _a === void 0 ? void 0 : _a.find((decorator) => (0, exports.getDecoratorName)(decorator) === decoratorName);
|
|
254
|
+
return node.decorators?.find((decorator) => (0, exports.getDecoratorName)(decorator) === decoratorName);
|
|
254
255
|
};
|
|
255
256
|
exports.getDecorator = getDecorator;
|
|
256
257
|
const getAngularClassDecorator = ({ decorators, }) => {
|
|
257
|
-
return decorators
|
|
258
|
+
return decorators
|
|
259
|
+
?.map(exports.getDecoratorName)
|
|
260
|
+
.filter(utils_2.isNotNullOrUndefined)
|
|
261
|
+
.find(exports.isAngularClassDecorator);
|
|
258
262
|
};
|
|
259
263
|
exports.getAngularClassDecorator = getAngularClassDecorator;
|
|
260
264
|
const getDecoratorArgument = ({ expression, }) => {
|
|
@@ -306,13 +310,13 @@ function getPropertyDefinitionName({ computed, key, }) {
|
|
|
306
310
|
}
|
|
307
311
|
exports.getPropertyDefinitionName = getPropertyDefinitionName;
|
|
308
312
|
const getDecoratorProperty = (decorator, name) => {
|
|
309
|
-
|
|
310
|
-
|
|
313
|
+
return (0, exports.getDecoratorArgument)(decorator)
|
|
314
|
+
?.properties.filter(isProperty)
|
|
315
|
+
.find(({ key }) => utils_1.ASTUtils.isIdentifier(key) && key.name === name);
|
|
311
316
|
};
|
|
312
317
|
exports.getDecoratorProperty = getDecoratorProperty;
|
|
313
318
|
const getDecoratorPropertyValue = (decorator, name) => {
|
|
314
|
-
|
|
315
|
-
return (_a = (0, exports.getDecoratorProperty)(decorator, name)) === null || _a === void 0 ? void 0 : _a.value;
|
|
319
|
+
return (0, exports.getDecoratorProperty)(decorator, name)?.value;
|
|
316
320
|
};
|
|
317
321
|
exports.getDecoratorPropertyValue = getDecoratorPropertyValue;
|
|
318
322
|
const getDeclaredMethods = ({ body: { body }, }) => {
|
|
@@ -330,7 +334,7 @@ const getLifecycleInterfaceByMethodName = (methodName) => methodName.slice(2);
|
|
|
330
334
|
exports.getLifecycleInterfaceByMethodName = getLifecycleInterfaceByMethodName;
|
|
331
335
|
function isImportedFrom(identifier, moduleName) {
|
|
332
336
|
const importDeclarations = getImportDeclarations(identifier, moduleName);
|
|
333
|
-
return Boolean(importDeclarations
|
|
337
|
+
return Boolean(importDeclarations?.some((importDeclaration) => importDeclaration.specifiers.some((specifier) => isImportSpecifier(specifier) &&
|
|
334
338
|
specifier.imported.name === identifier.name &&
|
|
335
339
|
specifier.local.name === identifier.name)));
|
|
336
340
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-aria-attribute-keys.d.ts","sourceRoot":"","sources":["../../src/eslint-plugin/get-aria-attribute-keys.ts"],"names":[],"mappings":"AAEA,wBAAgB,oBAAoB,IAAI,WAAW,CAAC,MAAM,CAAC,CAqD1D"}
|
|
@@ -3,54 +3,55 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getAriaAttributeKeys = void 0;
|
|
4
4
|
let ariaAttributeKeys = null;
|
|
5
5
|
function getAriaAttributeKeys() {
|
|
6
|
-
return (ariaAttributeKeys
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
6
|
+
return (ariaAttributeKeys ??
|
|
7
|
+
(ariaAttributeKeys = new Set([
|
|
8
|
+
// Source: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques
|
|
9
|
+
'aria-activedescendant',
|
|
10
|
+
'aria-atomic',
|
|
11
|
+
'aria-autocomplete',
|
|
12
|
+
'aria-busy',
|
|
13
|
+
'aria-checked',
|
|
14
|
+
'aria-colcount',
|
|
15
|
+
'aria-colindex',
|
|
16
|
+
'aria-colspan',
|
|
17
|
+
'aria-controls',
|
|
18
|
+
'aria-current',
|
|
19
|
+
'aria-describedby',
|
|
20
|
+
'aria-details',
|
|
21
|
+
'aria-disabled',
|
|
22
|
+
'aria-dragged',
|
|
23
|
+
'aria-dropeffect',
|
|
24
|
+
'aria-errormessage',
|
|
25
|
+
'aria-expanded',
|
|
26
|
+
'aria-flowto',
|
|
27
|
+
'aria-haspopup',
|
|
28
|
+
'aria-hidden',
|
|
29
|
+
'aria-invalid',
|
|
30
|
+
'aria-label',
|
|
31
|
+
'aria-labelledby',
|
|
32
|
+
'aria-level',
|
|
33
|
+
'aria-live',
|
|
34
|
+
'aria-modal',
|
|
35
|
+
'aria-multiline',
|
|
36
|
+
'aria-multiselectable',
|
|
37
|
+
'aria-orientation',
|
|
38
|
+
'aria-owns',
|
|
39
|
+
'aria-placeholder',
|
|
40
|
+
'aria-posinset',
|
|
41
|
+
'aria-pressed',
|
|
42
|
+
'aria-readonly',
|
|
43
|
+
'aria-relevant',
|
|
44
|
+
'aria-required',
|
|
45
|
+
'aria-rowcount',
|
|
46
|
+
'aria-rowindex',
|
|
47
|
+
'aria-rowspan',
|
|
48
|
+
'aria-selected',
|
|
49
|
+
'aria-setsize',
|
|
50
|
+
'aria-sort',
|
|
51
|
+
'aria-valuemax',
|
|
52
|
+
'aria-valuemin',
|
|
53
|
+
'aria-valuenow',
|
|
54
|
+
'aria-valuetext',
|
|
55
|
+
])));
|
|
55
56
|
}
|
|
56
57
|
exports.getAriaAttributeKeys = getAriaAttributeKeys;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-native-event-names.d.ts","sourceRoot":"","sources":["../../src/eslint-plugin/get-native-event-names.ts"],"names":[],"mappings":"AAEA,wBAAgB,mBAAmB,IAAI,WAAW,CAAC,MAAM,CAAC,CAkLzD"}
|
|
@@ -3,179 +3,180 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getNativeEventNames = void 0;
|
|
4
4
|
let nativeEventNames = null;
|
|
5
5
|
function getNativeEventNames() {
|
|
6
|
-
return (nativeEventNames
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
6
|
+
return (nativeEventNames ??
|
|
7
|
+
(nativeEventNames = new Set([
|
|
8
|
+
// Source: https://developer.mozilla.org/en-US/docs/Web/Events
|
|
9
|
+
'abort',
|
|
10
|
+
'afterprint',
|
|
11
|
+
'animationend',
|
|
12
|
+
'animationiteration',
|
|
13
|
+
'animationstart',
|
|
14
|
+
'appinstalled',
|
|
15
|
+
'audioprocess',
|
|
16
|
+
'audioend',
|
|
17
|
+
'audiostart',
|
|
18
|
+
'beforeprint',
|
|
19
|
+
'beforeunload',
|
|
20
|
+
'beginEvent',
|
|
21
|
+
'blocked',
|
|
22
|
+
'blur',
|
|
23
|
+
'boundary',
|
|
24
|
+
'cached',
|
|
25
|
+
'canplay',
|
|
26
|
+
'canplaythrough',
|
|
27
|
+
'change',
|
|
28
|
+
'chargingchange',
|
|
29
|
+
'chargingtimechange',
|
|
30
|
+
'checking',
|
|
31
|
+
'click',
|
|
32
|
+
'close',
|
|
33
|
+
'complete',
|
|
34
|
+
'compositionend',
|
|
35
|
+
'compositionstart',
|
|
36
|
+
'compositionupdate',
|
|
37
|
+
'contextmenu',
|
|
38
|
+
'copy',
|
|
39
|
+
'cut',
|
|
40
|
+
'dblclick',
|
|
41
|
+
'devicechange',
|
|
42
|
+
'devicelight',
|
|
43
|
+
'devicemotion',
|
|
44
|
+
'deviceorientation',
|
|
45
|
+
'deviceproximity',
|
|
46
|
+
'dischargingtimechange',
|
|
47
|
+
'DOMAttributeNameChanged',
|
|
48
|
+
'DOMAttrModified',
|
|
49
|
+
'DOMCharacterDataModified',
|
|
50
|
+
'DOMContentLoaded',
|
|
51
|
+
'DOMElementNameChanged',
|
|
52
|
+
'focus',
|
|
53
|
+
'focusin',
|
|
54
|
+
'focusout',
|
|
55
|
+
'DOMNodeInserted',
|
|
56
|
+
'DOMNodeInsertedIntoDocument',
|
|
57
|
+
'DOMNodeRemoved',
|
|
58
|
+
'DOMNodeRemovedFromDocument',
|
|
59
|
+
'DOMSubtreeModified',
|
|
60
|
+
'downloading',
|
|
61
|
+
'drag',
|
|
62
|
+
'dragend',
|
|
63
|
+
'dragenter',
|
|
64
|
+
'dragleave',
|
|
65
|
+
'dragover',
|
|
66
|
+
'dragstart',
|
|
67
|
+
'drop',
|
|
68
|
+
'durationchange',
|
|
69
|
+
'emptied',
|
|
70
|
+
'end',
|
|
71
|
+
'ended',
|
|
72
|
+
'endEvent',
|
|
73
|
+
'error',
|
|
74
|
+
'fullscreenchange',
|
|
75
|
+
'fullscreenerror',
|
|
76
|
+
'gamepadconnected',
|
|
77
|
+
'gamepaddisconnected',
|
|
78
|
+
'gotpointercapture',
|
|
79
|
+
'hashchange',
|
|
80
|
+
'lostpointercapture',
|
|
81
|
+
'input',
|
|
82
|
+
'invalid',
|
|
83
|
+
'keydown',
|
|
84
|
+
'keypress',
|
|
85
|
+
'keyup',
|
|
86
|
+
'languagechange',
|
|
87
|
+
'levelchange',
|
|
88
|
+
'load',
|
|
89
|
+
'loadeddata',
|
|
90
|
+
'loadedmetadata',
|
|
91
|
+
'loadend',
|
|
92
|
+
'loadstart',
|
|
93
|
+
'mark',
|
|
94
|
+
'message',
|
|
95
|
+
'messageerror',
|
|
96
|
+
'mousedown',
|
|
97
|
+
'mouseenter',
|
|
98
|
+
'mouseleave',
|
|
99
|
+
'mousemove',
|
|
100
|
+
'mouseout',
|
|
101
|
+
'mouseover',
|
|
102
|
+
'mouseup',
|
|
103
|
+
'nomatch',
|
|
104
|
+
'notificationclick',
|
|
105
|
+
'noupdate',
|
|
106
|
+
'obsolete',
|
|
107
|
+
'offline',
|
|
108
|
+
'online',
|
|
109
|
+
'open',
|
|
110
|
+
'orientationchange',
|
|
111
|
+
'pagehide',
|
|
112
|
+
'pageshow',
|
|
113
|
+
'paste',
|
|
114
|
+
'pause',
|
|
115
|
+
'pointercancel',
|
|
116
|
+
'pointerdown',
|
|
117
|
+
'pointerenter',
|
|
118
|
+
'pointerleave',
|
|
119
|
+
'pointerlockchange',
|
|
120
|
+
'pointerlockerror',
|
|
121
|
+
'pointermove',
|
|
122
|
+
'pointerout',
|
|
123
|
+
'pointerover',
|
|
124
|
+
'pointerup',
|
|
125
|
+
'play',
|
|
126
|
+
'playing',
|
|
127
|
+
'popstate',
|
|
128
|
+
'progress',
|
|
129
|
+
'push',
|
|
130
|
+
'pushsubscriptionchange',
|
|
131
|
+
'ratechange',
|
|
132
|
+
'readystatechange',
|
|
133
|
+
'repeatEvent',
|
|
134
|
+
'reset',
|
|
135
|
+
'resize',
|
|
136
|
+
'resourcetimingbufferfull',
|
|
137
|
+
'result',
|
|
138
|
+
'resume',
|
|
139
|
+
'scroll',
|
|
140
|
+
'seeked',
|
|
141
|
+
'seeking',
|
|
142
|
+
'select',
|
|
143
|
+
'selectstart',
|
|
144
|
+
'selectionchange',
|
|
145
|
+
'show',
|
|
146
|
+
'soundend',
|
|
147
|
+
'soundstart',
|
|
148
|
+
'speechend',
|
|
149
|
+
'speechstart',
|
|
150
|
+
'stalled',
|
|
151
|
+
'start',
|
|
152
|
+
'storage',
|
|
153
|
+
'submit',
|
|
154
|
+
'success',
|
|
155
|
+
'suspend',
|
|
156
|
+
'SVGAbort',
|
|
157
|
+
'SVGError',
|
|
158
|
+
'SVGLoad',
|
|
159
|
+
'SVGResize',
|
|
160
|
+
'SVGScroll',
|
|
161
|
+
'SVGUnload',
|
|
162
|
+
'SVGZoom',
|
|
163
|
+
'timeout',
|
|
164
|
+
'timeupdate',
|
|
165
|
+
'touchcancel',
|
|
166
|
+
'touchend',
|
|
167
|
+
'touchmove',
|
|
168
|
+
'touchstart',
|
|
169
|
+
'transitionend',
|
|
170
|
+
'unload',
|
|
171
|
+
'updateready',
|
|
172
|
+
'upgradeneeded',
|
|
173
|
+
'userproximity',
|
|
174
|
+
'voiceschanged',
|
|
175
|
+
'versionchange',
|
|
176
|
+
'visibilitychange',
|
|
177
|
+
'volumechange',
|
|
178
|
+
'waiting',
|
|
179
|
+
'wheel',
|
|
180
|
+
])));
|
|
180
181
|
}
|
|
181
182
|
exports.getNativeEventNames = getNativeEventNames;
|
|
@@ -14,3 +14,4 @@ export declare function getImplementsSchemaFixer({ id, implements: classImplemen
|
|
|
14
14
|
export declare function getDecoratorPropertyAddFix({ expression }: TSESTree.Decorator, fixer: TSESLint.RuleFixer, text: string): TSESLint.RuleFix | undefined;
|
|
15
15
|
export declare function getImplementsRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, classDeclaration: TSESTree.ClassDeclaration, interfaceName: string, fixer: TSESLint.RuleFixer): TSESLint.RuleFix | undefined;
|
|
16
16
|
export declare function getNodeToCommaRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, node: TSESTree.Node, fixer: TSESLint.RuleFixer): TSESLint.RuleFix;
|
|
17
|
+
//# sourceMappingURL=rule-fixes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-fixes.d.ts","sourceRoot":"","sources":["../../src/eslint-plugin/rule-fixes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAcnE,wBAAgB,eAAe,CAAC,EAC9B,4BAAoC,EACpC,KAAK,EACL,UAAU,EACV,UAAU,EACV,IAAI,GACL,EAAE;IACD,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;CACrB,GAAG,QAAQ,CAAC,OAAO,GA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) {
|
|
8
8
|
const fullImport = `import { ${importName} } from '${moduleName}';\n`;
|
|
9
9
|
const importDeclarations = (0, ast_utils_1.getImportDeclarations)(node, moduleName);
|
|
10
|
-
if (!
|
|
10
|
+
if (!importDeclarations?.length) {
|
|
11
11
|
return fixer.insertTextAfterRange([0, 0], fullImport);
|
|
12
12
|
}
|
|
13
13
|
const importDeclarationSpecifier = (0, ast_utils_1.getImportDeclarationSpecifier)(importDeclarations, importName);
|
|
@@ -25,8 +25,7 @@ function getImportAddFix({ compatibleWithTypeOnlyImport = false, fixer, importNa
|
|
|
25
25
|
}
|
|
26
26
|
exports.getImportAddFix = getImportAddFix;
|
|
27
27
|
function getImportRemoveFix(sourceCode, importDeclarations, importName, fixer) {
|
|
28
|
-
|
|
29
|
-
const { importDeclaration, importSpecifier } = (_a = (0, ast_utils_1.getImportDeclarationSpecifier)(importDeclarations, importName)) !== null && _a !== void 0 ? _a : {};
|
|
28
|
+
const { importDeclaration, importSpecifier } = (0, ast_utils_1.getImportDeclarationSpecifier)(importDeclarations, importName) ?? {};
|
|
30
29
|
if (!importDeclaration || !importSpecifier)
|
|
31
30
|
return undefined;
|
|
32
31
|
const isFirstImportSpecifier = importDeclaration.specifiers[0] === importSpecifier;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector-utils.d.ts","sourceRoot":"","sources":["../../src/eslint-plugin/selector-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AASjD,eAAO,MAAM,qBAAqB,cAAc,CAAC;AACjD,eAAO,MAAM,iBAAiB,UAAU,CAAC;AACzC,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,MAAM,CAAC;AACzD,MAAM,MAAM,kBAAkB,GAC1B,OAAO,qBAAqB,GAC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AQF,CAAC;AAEF,eAAO,MAAM,iBAAiB,SACtB,kBAAkB,GAAG,SAAS,kBAAkB,EAAE,UAChD,MAAM,GAAG,SAAS,MAAM,EAAE,SAC3B,mBAAmB,KACzB,OAqBF,CAAC;AAEF,eAAO,MAAM,aAAa,SAClB,SAAS,IAAI,cACP,kBAAkB,GAAG,SAAS,kBAAkB,EAAE,gBAChD,SAAS,MAAM,EAAE,eAClB,aAAa,KACzB;IACD,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;CACpC,GAAG,IA8CH,CAAC"}
|
|
@@ -22,3 +22,4 @@ export declare const INPUT_PROPERTY_OR_SETTER = ":matches(PropertyDefinition, Me
|
|
|
22
22
|
export declare const OUTPUTS_METADATA_PROPERTY_LITERAL: string;
|
|
23
23
|
export declare const OUTPUT_ALIAS = ":matches(PropertyDefinition, MethodDefinition[kind='get']) Decorator[expression.callee.name=\"Output\"] :matches(Literal, TemplateElement)";
|
|
24
24
|
export declare const OUTPUT_PROPERTY_OR_GETTER = ":matches(PropertyDefinition, MethodDefinition[kind='get'])[computed=false]:has(Decorator[expression.callee.name=\"Output\"]) > :matches(Identifier, Literal)";
|
|
25
|
+
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/eslint-plugin/selectors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sCAAsC,mFAC+B,CAAC;AAEnF,eAAO,MAAM,yBAAyB,uEAC8B,CAAC;AAErE,eAAO,MAAM,yBAAyB,uEAC8B,CAAC;AAErE,eAAO,MAAM,oBAAoB,kEAC8B,CAAC;AAEhE,eAAO,MAAM,0BAA0B,wEAC8B,CAAC;AAEtE,eAAO,MAAM,sBAAsB,sEACgC,CAAC;AAEpE,eAAO,MAAM,eAAe,gDAA8C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,iDAA+C,CAAC;AAE7E,eAAO,MAAM,2BAA2B,uCAAuC,CAAC;AAEhF,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;AACnE,wBAAgB,mBAAmB,CAAC,cAAc,SAAS,MAAM,EAC/D,aAAa,EAAE,cAAc,GAC5B,yDAAyD,cAAc,IAAI,CAAC;AAK/E,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;AACtD,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,MAAM,EAClD,GAAG,EAAE,IAAI,GACR,8BAA8B,IAAI,iCAAiC,IAAI,8BAA8B,IAAI,IAAI,CAAC;AAKjH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;AACtD,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,MAAM,EAClD,GAAG,EAAE,IAAI,GACR,sCAAsC,IAAI,iCAAiC,IAAI,8BAA8B,IAAI,IAAI,CAAC;AAKzH,eAAO,MAAM,0BAA0B,QAEL,CAAC;AAEnC,eAAO,MAAM,0BAA0B,QAEL,CAAC;AAEnC,eAAO,MAAM,uCAAuC,QAA2E,CAAC;AAEhI,eAAO,MAAM,gCAAgC,QAEO,CAAC;AAErD,eAAO,MAAM,WAAW,8IAAiH,CAAC;AAE1I,eAAO,MAAM,wBAAwB,gKAAuI,CAAC;AAE7K,eAAO,MAAM,iCAAiC,QAEM,CAAC;AAErD,eAAO,MAAM,YAAY,+IAAkH,CAAC;AAE5I,eAAO,MAAM,yBAAyB,iKAAwI,CAAC"}
|
|
@@ -10,3 +10,4 @@ export declare function getTemplateParserServices(context: Readonly<TSESLint.Rul
|
|
|
10
10
|
* If @angular-eslint/template-parser is not the configured parser when the function is invoked it will throw
|
|
11
11
|
*/
|
|
12
12
|
export declare function ensureTemplateParser(context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>): void;
|
|
13
|
+
//# sourceMappingURL=parser-services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser-services.d.ts","sourceRoot":"","sources":["../../src/eslint-plugin-template/parser-services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACf,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,WAAW,sBAAsB;IACrC,0BAA0B,EAAE,CAC1B,UAAU,EAAE,eAAe,KACxB,QAAQ,CAAC,cAAc,CAAC;IAC7B,6BAA6B,EAAE,CAC7B,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC,EACnE,IAAI,EAAE,cAAc,KACjB,QAAQ,CAAC,cAAc,CAAC;CAC9B;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC,GAClE,sBAAsB,CAGxB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC,GAClE,IAAI,CAeN"}
|
|
@@ -11,9 +11,10 @@ exports.getTemplateParserServices = getTemplateParserServices;
|
|
|
11
11
|
* If @angular-eslint/template-parser is not the configured parser when the function is invoked it will throw
|
|
12
12
|
*/
|
|
13
13
|
function ensureTemplateParser(context) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
!
|
|
14
|
+
if (!context.parserServices
|
|
15
|
+
?.convertNodeSourceSpanToLoc ||
|
|
16
|
+
!context.parserServices
|
|
17
|
+
?.convertElementSourceSpanToLoc) {
|
|
17
18
|
/**
|
|
18
19
|
* The user needs to have configured "parser" in their eslint config and set it
|
|
19
20
|
* to @angular-eslint/template-parser
|
package/dist/index.d.ts
CHANGED
|
@@ -9,3 +9,4 @@ export * as Selectors from './eslint-plugin/selectors';
|
|
|
9
9
|
export * as SelectorUtils from './eslint-plugin/selector-utils';
|
|
10
10
|
export type { TemplateParserServices } from './eslint-plugin-template/parser-services';
|
|
11
11
|
export { ensureTemplateParser, getTemplateParserServices, } from './eslint-plugin-template/parser-services';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EACL,mBAAmB,EACnB,QAAQ,EACR,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,6BAA6B,EAC7B,UAAU,GACX,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,aAAa,MAAM,gCAAgC,CAAC;AAEhE,YAAY,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EACL,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,0CAA0C,CAAC"}
|
package/dist/rules-tester.d.ts
CHANGED
|
@@ -9,3 +9,4 @@ export declare class RuleTester extends TSESLint.RuleTester {
|
|
|
9
9
|
run<TMessageIds extends string, TOptions extends readonly unknown[]>(name: string, rule: TSESLint.RuleModule<TMessageIds, TOptions>, { valid, invalid }: TSESLint.RunTests<TMessageIds, TOptions>): void;
|
|
10
10
|
}
|
|
11
11
|
export {};
|
|
12
|
+
//# sourceMappingURL=rules-tester.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules-tester.d.ts","sourceRoot":"","sources":["../src/rules-tester.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,QAAA,MAAM,aAAa,2EAGT,CAAC;AAEX,KAAK,gBAAgB,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAAG;IAClE,MAAM,EAAE,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;CACxC,CAAC;AAYF,qBAAa,UAAW,SAAQ,QAAQ,CAAC,UAAU;IACjD,OAAO,CAAC,QAAQ,CAAC,CAAS;gBAKd,OAAO,EAAE,gBAAgB;IA8B5B,GAAG,CAAC,WAAW,SAAS,MAAM,EAAE,QAAQ,SAAS,SAAS,OAAO,EAAE,EAC1E,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,EAChD,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,GAC3D,IAAI;CA0BR"}
|
package/dist/rules-tester.js
CHANGED
|
@@ -37,14 +37,17 @@ function isValidParser(parser) {
|
|
|
37
37
|
return VALID_PARSERS.includes(parser);
|
|
38
38
|
}
|
|
39
39
|
class RuleTester extends utils_1.TSESLint.RuleTester {
|
|
40
|
+
filename;
|
|
40
41
|
// as of eslint 6 you have to provide an absolute path to the parser
|
|
41
42
|
// but that's not as clean to type, this saves us trying to manually enforce
|
|
42
43
|
// that contributors require.resolve everything
|
|
43
44
|
constructor(options) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
super({
|
|
46
|
+
...options,
|
|
47
|
+
parser: require.resolve(options.parser),
|
|
48
|
+
});
|
|
49
|
+
if (options.parserOptions?.project) {
|
|
50
|
+
this.filename = path.join(options.parserOptions?.tsconfigRootDir ?? getFixturesRootDir(), 'file.ts');
|
|
48
51
|
}
|
|
49
52
|
// make sure that the parser doesn't hold onto file handles between tests
|
|
50
53
|
// on linux (i.e. our CI env), there can be very a limited number of watch handles available
|
|
@@ -55,7 +58,7 @@ class RuleTester extends utils_1.TSESLint.RuleTester {
|
|
|
55
58
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
56
59
|
require(options.parser).clearCaches();
|
|
57
60
|
}
|
|
58
|
-
catch
|
|
61
|
+
catch {
|
|
59
62
|
// ignored
|
|
60
63
|
}
|
|
61
64
|
});
|
|
@@ -67,20 +70,21 @@ class RuleTester extends utils_1.TSESLint.RuleTester {
|
|
|
67
70
|
const errorMessage = `Do not set the parser at the test level unless you want to use a parser other than ${VALID_PARSERS.join(', ')}`;
|
|
68
71
|
const parsedTests = {
|
|
69
72
|
valid: valid.map((test) => {
|
|
70
|
-
var _a;
|
|
71
73
|
if (typeof test !== 'string' && isValidParser(test.parser)) {
|
|
72
74
|
throw Error(errorMessage);
|
|
73
75
|
}
|
|
74
76
|
return typeof test === 'string'
|
|
75
77
|
? { code: test, filename: this.filename }
|
|
76
|
-
:
|
|
78
|
+
: { ...test, filename: test.filename ?? this.filename };
|
|
77
79
|
}),
|
|
78
80
|
invalid: invalid.map((test) => {
|
|
79
|
-
var _a;
|
|
80
81
|
if (isValidParser(test.parser)) {
|
|
81
82
|
throw Error(errorMessage);
|
|
82
83
|
}
|
|
83
|
-
return
|
|
84
|
+
return {
|
|
85
|
+
...test,
|
|
86
|
+
filename: test.filename ?? this.filename,
|
|
87
|
+
};
|
|
84
88
|
}),
|
|
85
89
|
};
|
|
86
90
|
super.run(name, rule, parsedTests);
|
package/dist/utils.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const objectKeys: <T>(o: T) => readonly Extract<keyof T, string>[
|
|
|
15
15
|
* Enforces the invariant that the input is an array.
|
|
16
16
|
*/
|
|
17
17
|
export declare function arrayify<T>(value: T | readonly T[]): readonly T[];
|
|
18
|
-
export declare const isNotNullOrUndefined: <T>(input:
|
|
18
|
+
export declare const isNotNullOrUndefined: <T>(input: null | undefined | T) => input is T;
|
|
19
19
|
export declare const kebabToCamelCase: (value: string) => string;
|
|
20
20
|
/**
|
|
21
21
|
* Convert an array to human-readable text.
|
|
@@ -24,3 +24,4 @@ export declare const toHumanReadableText: (items: readonly string[]) => string;
|
|
|
24
24
|
export declare const toPattern: (value: readonly unknown[]) => RegExp;
|
|
25
25
|
export declare function capitalize<T extends string>(text: T): Capitalize<T>;
|
|
26
26
|
export declare function withoutBracketsAndWhitespaces(text: string): string;
|
|
27
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAEzE;AAED,eAAO,MAAM,UAAU,SAClB,CAAC,KACD,SAAS,QAAQ,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC;AAEzC;;GAEG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,CAKjE;AAID,eAAO,MAAM,oBAAoB,aACxB,IAAI,GAAG,SAAS,GAAG,CAAC,eACyB,CAAC;AAEvD,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MAG9C,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,mBAAmB,UAAW,SAAS,MAAM,EAAE,KAAG,MAW9D,CAAC;AAEF,eAAO,MAAM,SAAS,UAAW,SAAS,OAAO,EAAE,KAAG,MACpB,CAAC;AAEnC,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAEnE;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-eslint/utils",
|
|
3
|
-
"version": "17.3.1-alpha.
|
|
3
|
+
"version": "17.3.1-alpha.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|
|
14
|
+
"!**/*.tsbuildinfo",
|
|
14
15
|
"package.json",
|
|
15
16
|
"README.md",
|
|
16
17
|
"LICENSE"
|
|
@@ -20,8 +21,8 @@
|
|
|
20
21
|
"typescript": "*"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"@angular-eslint/bundled-angular-compiler": "17.3.1-alpha.
|
|
24
|
-
"@typescript-eslint/utils": "7.
|
|
24
|
+
"@angular-eslint/bundled-angular-compiler": "17.3.1-alpha.11",
|
|
25
|
+
"@typescript-eslint/utils": "7.7.0"
|
|
25
26
|
},
|
|
26
27
|
"gitHead": "e2006e5e9c99e5a943d1a999e0efa5247d29ec24"
|
|
27
28
|
}
|