@angular-eslint/utils 14.0.0-alpha.2 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/convert-annotated-source-to-failure-case.d.ts +1 -1
- package/dist/eslint-plugin/ast-utils.d.ts +1 -1
- package/dist/eslint-plugin/ast-utils.js +37 -37
- package/dist/eslint-plugin/rule-fixes.d.ts +1 -1
- package/dist/eslint-plugin/rule-fixes.js +6 -6
- package/dist/eslint-plugin/selector-utils.d.ts +1 -1
- package/dist/rules-tester.d.ts +1 -1
- package/dist/rules-tester.js +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [14.0.0](https://github.com/angular-eslint/angular-eslint/compare/v13.5.0...v14.0.0) (2022-06-23)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- update typescript-eslint packages to v5.28.0 ([#1045](https://github.com/angular-eslint/angular-eslint/issues/1045)) ([9e8c340](https://github.com/angular-eslint/angular-eslint/commit/9e8c3406de716d1d5e7f45e06b06700af3861f65))
|
|
11
|
+
- update typescript-eslint packages to v5.29.0 ([#1063](https://github.com/angular-eslint/angular-eslint/issues/1063)) ([02856cb](https://github.com/angular-eslint/angular-eslint/commit/02856cbc6116491eaa634a3cbdcd38d6bffda64c))
|
|
12
|
+
|
|
6
13
|
# [13.5.0](https://github.com/angular-eslint/angular-eslint/compare/v13.4.0...v13.5.0) (2022-06-12)
|
|
7
14
|
|
|
8
15
|
**Note:** Version bump only for package @angular-eslint/utils
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TSESLint } from '@typescript-eslint/
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
2
|
/**
|
|
3
3
|
* When leveraging the convertAnnotatedSourceToFailureCase() utility, the
|
|
4
4
|
* following characters are eligible to be used in the source code of expected
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isPropertyDefinition = exports.isClassDeclaration = exports.isIdentifierOrMemberExpression = exports.isMemberExpression = exports.isCallExpression = exports.getReplacementText = exports.getRawText = exports.isImportedFrom = exports.getLifecycleInterfaceByMethodName = exports.getMethodName = exports.getDeclaredMethods = exports.getDecoratorPropertyValue = exports.getDecoratorProperty = exports.getPropertyDefinitionName = exports.isAngularInnerClassDecorator = exports.isAngularClassDecorator = exports.isAngularLifecycleMethod = exports.isAngularLifecycleInterface = exports.ANGULAR_LIFECYCLE_METHODS = exports.ANGULAR_LIFECYCLE_INTERFACES = exports.getDecoratorName = exports.getDecoratorArgument = exports.getAngularClassDecorator = exports.getDecorator = exports.getClassName = exports.getNearestNodeFrom = exports.getDeclaredAngularLifecycleMethods = exports.getDeclaredAngularLifecycleInterfaces = exports.getDeclaredInterfaceNames = exports.getInterfaces = exports.getPipeDecorator = exports.getInterfaceName = exports.getInterface = exports.getImportDeclarationSpecifier = exports.getImportDeclarations = exports.getCorrespondentImportClause = exports.ANGULAR_CLASS_DECORATOR_MAPPER = exports.ANGULAR_CLASS_DECORATORS = exports.ANGULAR_INNER_CLASS_DECORATORS = exports.ANGULAR_CLASS_DECORATOR_LIFECYCLE_METHOD_MAPPER = exports.angularLifecycleMethodKeys = exports.angularLifecycleInterfaceKeys = exports.angularInnerClassDecoratorKeys = exports.angularClassDecoratorKeys = exports.OPTION_STYLE_KEBAB_CASE = exports.OPTION_STYLE_CAMEL_CASE = exports.AngularLifecycleMethods = exports.AngularLifecycleInterfaces = exports.AngularInnerClassDecorators = exports.AngularClassDecorators = void 0;
|
|
4
4
|
exports.isImplementsToken = exports.isSuper = exports.isMethodDefinition = exports.isStringLiteral = exports.isImportSpecifier = exports.isImportDeclaration = exports.isTemplateLiteral = exports.isTemplateElement = exports.isLiteral = exports.isProperty = exports.isArrayExpression = exports.isObjectExpression = exports.isImportNamespaceSpecifier = exports.isImportDefaultSpecifier = exports.isPropertyOrMethodDefinition = void 0;
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const utils_1 = require("@typescript-eslint/utils");
|
|
6
|
+
const utils_2 = require("../utils");
|
|
7
7
|
var AngularClassDecorators;
|
|
8
8
|
(function (AngularClassDecorators) {
|
|
9
9
|
AngularClassDecorators["Component"] = "Component";
|
|
@@ -62,10 +62,10 @@ var AngularLifecycleMethods;
|
|
|
62
62
|
})(AngularLifecycleMethods = exports.AngularLifecycleMethods || (exports.AngularLifecycleMethods = {}));
|
|
63
63
|
exports.OPTION_STYLE_CAMEL_CASE = 'camelCase';
|
|
64
64
|
exports.OPTION_STYLE_KEBAB_CASE = 'kebab-case';
|
|
65
|
-
exports.angularClassDecoratorKeys = (0,
|
|
66
|
-
exports.angularInnerClassDecoratorKeys = (0,
|
|
67
|
-
exports.angularLifecycleInterfaceKeys = (0,
|
|
68
|
-
exports.angularLifecycleMethodKeys = (0,
|
|
65
|
+
exports.angularClassDecoratorKeys = (0, utils_2.objectKeys)(AngularClassDecorators);
|
|
66
|
+
exports.angularInnerClassDecoratorKeys = (0, utils_2.objectKeys)(exports.AngularInnerClassDecorators);
|
|
67
|
+
exports.angularLifecycleInterfaceKeys = (0, utils_2.objectKeys)(AngularLifecycleInterfaces);
|
|
68
|
+
exports.angularLifecycleMethodKeys = (0, utils_2.objectKeys)(AngularLifecycleMethods);
|
|
69
69
|
exports.ANGULAR_CLASS_DECORATOR_LIFECYCLE_METHOD_MAPPER = new Map([
|
|
70
70
|
[
|
|
71
71
|
AngularClassDecorators.Component,
|
|
@@ -147,7 +147,7 @@ exports.ANGULAR_CLASS_DECORATOR_MAPPER = new Map([
|
|
|
147
147
|
function getCorrespondentImportClause(importDeclarations, compatibleWithTypeOnlyImport = false) {
|
|
148
148
|
let importClause;
|
|
149
149
|
for (const { importKind, specifiers } of importDeclarations) {
|
|
150
|
-
const lastImportSpecifier = (0,
|
|
150
|
+
const lastImportSpecifier = (0, utils_2.getLast)(specifiers);
|
|
151
151
|
if ((!compatibleWithTypeOnlyImport && importKind === 'type') ||
|
|
152
152
|
isImportNamespaceSpecifier(lastImportSpecifier)) {
|
|
153
153
|
continue;
|
|
@@ -185,10 +185,10 @@ function getInterface(node, interfaceName) {
|
|
|
185
185
|
}
|
|
186
186
|
exports.getInterface = getInterface;
|
|
187
187
|
function getInterfaceName(interfaceMember) {
|
|
188
|
-
if (
|
|
188
|
+
if (utils_1.ASTUtils.isIdentifier(interfaceMember)) {
|
|
189
189
|
return interfaceMember.name;
|
|
190
190
|
}
|
|
191
|
-
return
|
|
191
|
+
return utils_1.ASTUtils.isIdentifier(interfaceMember.property)
|
|
192
192
|
? interfaceMember.property.name
|
|
193
193
|
: undefined;
|
|
194
194
|
}
|
|
@@ -203,14 +203,14 @@ function getInterfaces(node) {
|
|
|
203
203
|
}
|
|
204
204
|
exports.getInterfaces = getInterfaces;
|
|
205
205
|
function getDeclaredInterfaceNames(node) {
|
|
206
|
-
return getInterfaces(node).map(getInterfaceName).filter(
|
|
206
|
+
return getInterfaces(node).map(getInterfaceName).filter(utils_2.isNotNullOrUndefined);
|
|
207
207
|
}
|
|
208
208
|
exports.getDeclaredInterfaceNames = getDeclaredInterfaceNames;
|
|
209
209
|
const getDeclaredAngularLifecycleInterfaces = (node) => getDeclaredInterfaceNames(node).filter(exports.isAngularLifecycleInterface);
|
|
210
210
|
exports.getDeclaredAngularLifecycleInterfaces = getDeclaredAngularLifecycleInterfaces;
|
|
211
211
|
const getDeclaredAngularLifecycleMethods = (node) => (0, exports.getDeclaredMethods)(node)
|
|
212
212
|
.map(exports.getMethodName)
|
|
213
|
-
.filter(
|
|
213
|
+
.filter(utils_2.isNotNullOrUndefined)
|
|
214
214
|
.filter(exports.isAngularLifecycleMethod);
|
|
215
215
|
exports.getDeclaredAngularLifecycleMethods = getDeclaredAngularLifecycleMethods;
|
|
216
216
|
function getNearestNodeFrom({ parent }, predicate) {
|
|
@@ -240,7 +240,7 @@ const getDecorator = (node, decoratorName) => {
|
|
|
240
240
|
};
|
|
241
241
|
exports.getDecorator = getDecorator;
|
|
242
242
|
const getAngularClassDecorator = ({ decorators, }) => {
|
|
243
|
-
return decorators === null || decorators === void 0 ? void 0 : decorators.map(exports.getDecoratorName).filter(
|
|
243
|
+
return decorators === null || decorators === void 0 ? void 0 : decorators.map(exports.getDecoratorName).filter(utils_2.isNotNullOrUndefined).find(exports.isAngularClassDecorator);
|
|
244
244
|
};
|
|
245
245
|
exports.getAngularClassDecorator = getAngularClassDecorator;
|
|
246
246
|
const getDecoratorArgument = ({ expression, }) => {
|
|
@@ -252,10 +252,10 @@ const getDecoratorArgument = ({ expression, }) => {
|
|
|
252
252
|
};
|
|
253
253
|
exports.getDecoratorArgument = getDecoratorArgument;
|
|
254
254
|
const getDecoratorName = ({ expression, }) => {
|
|
255
|
-
if (
|
|
255
|
+
if (utils_1.ASTUtils.isIdentifier(expression))
|
|
256
256
|
return expression.name;
|
|
257
257
|
return isCallExpression(expression) &&
|
|
258
|
-
|
|
258
|
+
utils_1.ASTUtils.isIdentifier(expression.callee)
|
|
259
259
|
? expression.callee.name
|
|
260
260
|
: undefined;
|
|
261
261
|
};
|
|
@@ -282,7 +282,7 @@ exports.isAngularInnerClassDecorator = isAngularInnerClassDecorator;
|
|
|
282
282
|
* }
|
|
283
283
|
*/
|
|
284
284
|
function getPropertyDefinitionName({ computed, key, }) {
|
|
285
|
-
if (
|
|
285
|
+
if (utils_1.ASTUtils.isIdentifier(key) && !computed) {
|
|
286
286
|
return key.name;
|
|
287
287
|
}
|
|
288
288
|
if (isLiteral(key)) {
|
|
@@ -293,7 +293,7 @@ function getPropertyDefinitionName({ computed, key, }) {
|
|
|
293
293
|
exports.getPropertyDefinitionName = getPropertyDefinitionName;
|
|
294
294
|
const getDecoratorProperty = (decorator, name) => {
|
|
295
295
|
var _a;
|
|
296
|
-
return (_a = (0, exports.getDecoratorArgument)(decorator)) === null || _a === void 0 ? void 0 : _a.properties.filter(isProperty).find(({ key }) =>
|
|
296
|
+
return (_a = (0, exports.getDecoratorArgument)(decorator)) === null || _a === void 0 ? void 0 : _a.properties.filter(isProperty).find(({ key }) => utils_1.ASTUtils.isIdentifier(key) && key.name === name);
|
|
297
297
|
};
|
|
298
298
|
exports.getDecoratorProperty = getDecoratorProperty;
|
|
299
299
|
const getDecoratorPropertyValue = (decorator, name) => {
|
|
@@ -309,7 +309,7 @@ const getMethodName = ({ computed, key, }) => {
|
|
|
309
309
|
if (isStringLiteral(key)) {
|
|
310
310
|
return key.value;
|
|
311
311
|
}
|
|
312
|
-
return
|
|
312
|
+
return utils_1.ASTUtils.isIdentifier(key) && !computed ? key.name : undefined;
|
|
313
313
|
};
|
|
314
314
|
exports.getMethodName = getMethodName;
|
|
315
315
|
const getLifecycleInterfaceByMethodName = (methodName) => methodName.slice(2);
|
|
@@ -322,7 +322,7 @@ function isImportedFrom(identifier, moduleName) {
|
|
|
322
322
|
}
|
|
323
323
|
exports.isImportedFrom = isImportedFrom;
|
|
324
324
|
function getRawText(node) {
|
|
325
|
-
if (
|
|
325
|
+
if (utils_1.ASTUtils.isIdentifier(node)) {
|
|
326
326
|
return node.name;
|
|
327
327
|
}
|
|
328
328
|
if (isPropertyDefinition(node) ||
|
|
@@ -349,23 +349,23 @@ exports.getReplacementText = getReplacementText;
|
|
|
349
349
|
// SECTION START:
|
|
350
350
|
// Equivalents of utils exported by TypeScript itself for its own AST
|
|
351
351
|
function isCallExpression(node) {
|
|
352
|
-
return node.type ===
|
|
352
|
+
return node.type === utils_1.AST_NODE_TYPES.CallExpression;
|
|
353
353
|
}
|
|
354
354
|
exports.isCallExpression = isCallExpression;
|
|
355
355
|
function isMemberExpression(node) {
|
|
356
|
-
return node.type ===
|
|
356
|
+
return node.type === utils_1.AST_NODE_TYPES.MemberExpression;
|
|
357
357
|
}
|
|
358
358
|
exports.isMemberExpression = isMemberExpression;
|
|
359
359
|
function isIdentifierOrMemberExpression(node) {
|
|
360
|
-
return
|
|
360
|
+
return utils_1.ASTUtils.isIdentifier(node) || isMemberExpression(node);
|
|
361
361
|
}
|
|
362
362
|
exports.isIdentifierOrMemberExpression = isIdentifierOrMemberExpression;
|
|
363
363
|
function isClassDeclaration(node) {
|
|
364
|
-
return node.type ===
|
|
364
|
+
return node.type === utils_1.AST_NODE_TYPES.ClassDeclaration;
|
|
365
365
|
}
|
|
366
366
|
exports.isClassDeclaration = isClassDeclaration;
|
|
367
367
|
function isPropertyDefinition(node) {
|
|
368
|
-
return node.type ===
|
|
368
|
+
return node.type === utils_1.AST_NODE_TYPES.PropertyDefinition;
|
|
369
369
|
}
|
|
370
370
|
exports.isPropertyDefinition = isPropertyDefinition;
|
|
371
371
|
function isPropertyOrMethodDefinition(node) {
|
|
@@ -373,46 +373,46 @@ function isPropertyOrMethodDefinition(node) {
|
|
|
373
373
|
}
|
|
374
374
|
exports.isPropertyOrMethodDefinition = isPropertyOrMethodDefinition;
|
|
375
375
|
function isImportDefaultSpecifier(node) {
|
|
376
|
-
return node.type ===
|
|
376
|
+
return node.type === utils_1.AST_NODE_TYPES.ImportDefaultSpecifier;
|
|
377
377
|
}
|
|
378
378
|
exports.isImportDefaultSpecifier = isImportDefaultSpecifier;
|
|
379
379
|
function isImportNamespaceSpecifier(node) {
|
|
380
|
-
return node.type ===
|
|
380
|
+
return node.type === utils_1.AST_NODE_TYPES.ImportNamespaceSpecifier;
|
|
381
381
|
}
|
|
382
382
|
exports.isImportNamespaceSpecifier = isImportNamespaceSpecifier;
|
|
383
383
|
function isObjectExpression(node) {
|
|
384
|
-
return node.type ===
|
|
384
|
+
return node.type === utils_1.AST_NODE_TYPES.ObjectExpression;
|
|
385
385
|
}
|
|
386
386
|
exports.isObjectExpression = isObjectExpression;
|
|
387
387
|
function isArrayExpression(node) {
|
|
388
|
-
return node.type ===
|
|
388
|
+
return node.type === utils_1.AST_NODE_TYPES.ArrayExpression;
|
|
389
389
|
}
|
|
390
390
|
exports.isArrayExpression = isArrayExpression;
|
|
391
391
|
function isProperty(node) {
|
|
392
|
-
return node.type ===
|
|
392
|
+
return node.type === utils_1.AST_NODE_TYPES.Property;
|
|
393
393
|
}
|
|
394
394
|
exports.isProperty = isProperty;
|
|
395
395
|
function isProgram(node) {
|
|
396
|
-
return node.type ===
|
|
396
|
+
return node.type === utils_1.AST_NODE_TYPES.Program;
|
|
397
397
|
}
|
|
398
398
|
function isLiteral(node) {
|
|
399
|
-
return node.type ===
|
|
399
|
+
return node.type === utils_1.AST_NODE_TYPES.Literal;
|
|
400
400
|
}
|
|
401
401
|
exports.isLiteral = isLiteral;
|
|
402
402
|
function isTemplateElement(node) {
|
|
403
|
-
return node.type ===
|
|
403
|
+
return node.type === utils_1.AST_NODE_TYPES.TemplateElement;
|
|
404
404
|
}
|
|
405
405
|
exports.isTemplateElement = isTemplateElement;
|
|
406
406
|
function isTemplateLiteral(node) {
|
|
407
|
-
return node.type ===
|
|
407
|
+
return node.type === utils_1.AST_NODE_TYPES.TemplateLiteral;
|
|
408
408
|
}
|
|
409
409
|
exports.isTemplateLiteral = isTemplateLiteral;
|
|
410
410
|
function isImportDeclaration(node) {
|
|
411
|
-
return node.type ===
|
|
411
|
+
return node.type === utils_1.AST_NODE_TYPES.ImportDeclaration;
|
|
412
412
|
}
|
|
413
413
|
exports.isImportDeclaration = isImportDeclaration;
|
|
414
414
|
function isImportSpecifier(node) {
|
|
415
|
-
return node.type ===
|
|
415
|
+
return node.type === utils_1.AST_NODE_TYPES.ImportSpecifier;
|
|
416
416
|
}
|
|
417
417
|
exports.isImportSpecifier = isImportSpecifier;
|
|
418
418
|
/**
|
|
@@ -425,15 +425,15 @@ function isStringLiteral(node) {
|
|
|
425
425
|
}
|
|
426
426
|
exports.isStringLiteral = isStringLiteral;
|
|
427
427
|
function isMethodDefinition(node) {
|
|
428
|
-
return node.type ===
|
|
428
|
+
return node.type === utils_1.AST_NODE_TYPES.MethodDefinition;
|
|
429
429
|
}
|
|
430
430
|
exports.isMethodDefinition = isMethodDefinition;
|
|
431
431
|
function isSuper(node) {
|
|
432
|
-
return node.type ===
|
|
432
|
+
return node.type === utils_1.AST_NODE_TYPES.Super;
|
|
433
433
|
}
|
|
434
434
|
exports.isSuper = isSuper;
|
|
435
435
|
function isImplementsToken(token) {
|
|
436
|
-
return token.type ===
|
|
436
|
+
return token.type === utils_1.AST_TOKEN_TYPES.Keyword && token.value === 'implements';
|
|
437
437
|
}
|
|
438
438
|
exports.isImplementsToken = isImplementsToken;
|
|
439
439
|
// SECTION END:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TSESLint, TSESTree } from '@typescript-eslint/
|
|
1
|
+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
|
|
2
2
|
export declare function getImportAddFix({ compatibleWithTypeOnlyImport, fixer, importName, moduleName, node, }: {
|
|
3
3
|
compatibleWithTypeOnlyImport?: boolean;
|
|
4
4
|
fixer: TSESLint.RuleFixer;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNodeToCommaRemoveFix = exports.getImplementsRemoveFix = exports.getDecoratorPropertyAddFix = exports.getImplementsSchemaFixer = exports.getImportRemoveFix = exports.getImportAddFix = void 0;
|
|
4
|
-
const
|
|
4
|
+
const utils_1 = require("@typescript-eslint/utils");
|
|
5
5
|
const ast_utils_1 = require("./ast-utils");
|
|
6
|
-
const
|
|
6
|
+
const utils_2 = require("../utils");
|
|
7
7
|
function getImportAddFix({ compatibleWithTypeOnlyImport = false, fixer, importName, moduleName, node, }) {
|
|
8
8
|
const fullImport = `import { ${importName} } from '${moduleName}';\n`;
|
|
9
9
|
const importDeclarations = (0, ast_utils_1.getImportDeclarations)(node, moduleName);
|
|
@@ -30,7 +30,7 @@ function getImportRemoveFix(sourceCode, importDeclarations, importName, fixer) {
|
|
|
30
30
|
if (!importDeclaration || !importSpecifier)
|
|
31
31
|
return undefined;
|
|
32
32
|
const isFirstImportSpecifier = importDeclaration.specifiers[0] === importSpecifier;
|
|
33
|
-
const isLastImportSpecifier = (0,
|
|
33
|
+
const isLastImportSpecifier = (0, utils_2.getLast)(importDeclaration.specifiers) === importSpecifier;
|
|
34
34
|
const isSingleImportSpecifier = isFirstImportSpecifier && isLastImportSpecifier;
|
|
35
35
|
if (isSingleImportSpecifier) {
|
|
36
36
|
return fixer.remove(importDeclaration);
|
|
@@ -53,7 +53,7 @@ function getImportRemoveFix(sourceCode, importDeclarations, importName, fixer) {
|
|
|
53
53
|
exports.getImportRemoveFix = getImportRemoveFix;
|
|
54
54
|
function getImplementsSchemaFixer({ id, implements: classImplements }, interfaceName) {
|
|
55
55
|
const [implementsNodeReplace, implementsTextReplace] = classImplements
|
|
56
|
-
? [(0,
|
|
56
|
+
? [(0, utils_2.getLast)(classImplements), `, ${interfaceName}`]
|
|
57
57
|
: [id, ` implements ${interfaceName}`];
|
|
58
58
|
return { implementsNodeReplace, implementsTextReplace };
|
|
59
59
|
}
|
|
@@ -86,7 +86,7 @@ function getImplementsRemoveFix(sourceCode, classDeclaration, interfaceName, fix
|
|
|
86
86
|
if (!identifier)
|
|
87
87
|
return undefined;
|
|
88
88
|
const isFirstInterface = classImplements[0].expression === identifier;
|
|
89
|
-
const isLastInterface = (0,
|
|
89
|
+
const isLastInterface = (0, utils_2.getLast)(classImplements).expression === identifier;
|
|
90
90
|
const hasSingleInterfaceImplemented = isFirstInterface && isLastInterface;
|
|
91
91
|
const tokenBeforeInterface = sourceCode.getTokenBefore(identifier);
|
|
92
92
|
if (hasSingleInterfaceImplemented) {
|
|
@@ -110,7 +110,7 @@ function getImplementsRemoveFix(sourceCode, classDeclaration, interfaceName, fix
|
|
|
110
110
|
exports.getImplementsRemoveFix = getImplementsRemoveFix;
|
|
111
111
|
function getNodeToCommaRemoveFix(sourceCode, node, fixer) {
|
|
112
112
|
const tokenAfterNode = sourceCode.getTokenAfter(node);
|
|
113
|
-
return tokenAfterNode &&
|
|
113
|
+
return tokenAfterNode && utils_1.ASTUtils.isCommaToken(tokenAfterNode)
|
|
114
114
|
? fixer.removeRange([node.range[0], tokenAfterNode.range[1]])
|
|
115
115
|
: fixer.remove(node);
|
|
116
116
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TSESLint, TSESTree } from '@typescript-eslint/
|
|
1
|
+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
|
|
2
2
|
import type { SelectorStyle } from './ast-utils';
|
|
3
3
|
export declare const OPTION_TYPE_ATTRIBUTE = "attribute";
|
|
4
4
|
export declare const OPTION_TYPE_ATTRS = "attrs";
|
package/dist/rules-tester.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TSESLint } from '@typescript-eslint/
|
|
1
|
+
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
2
|
declare const VALID_PARSERS: readonly ["@angular-eslint/template-parser", "@typescript-eslint/parser"];
|
|
3
3
|
declare type RuleTesterConfig = Omit<TSESLint.RuleTesterConfig, 'parser'> & {
|
|
4
4
|
parser: typeof VALID_PARSERS[number];
|
package/dist/rules-tester.js
CHANGED
|
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.RuleTester = void 0;
|
|
27
|
-
const
|
|
27
|
+
const utils_1 = require("@typescript-eslint/utils");
|
|
28
28
|
const path = __importStar(require("path"));
|
|
29
29
|
const VALID_PARSERS = [
|
|
30
30
|
'@angular-eslint/template-parser',
|
|
@@ -36,7 +36,7 @@ function getFixturesRootDir() {
|
|
|
36
36
|
function isValidParser(parser) {
|
|
37
37
|
return VALID_PARSERS.includes(parser);
|
|
38
38
|
}
|
|
39
|
-
class RuleTester extends
|
|
39
|
+
class RuleTester extends utils_1.TSESLint.RuleTester {
|
|
40
40
|
// as of eslint 6 you have to provide an absolute path to the parser
|
|
41
41
|
// but that's not as clean to type, this saves us trying to manually enforce
|
|
42
42
|
// that contributors require.resolve everything
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-eslint/utils",
|
|
3
|
-
"version": "14.0.0
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"typescript": "*"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@angular-eslint/bundled-angular-compiler": "14.0.0
|
|
19
|
-
"@typescript-eslint/
|
|
18
|
+
"@angular-eslint/bundled-angular-compiler": "14.0.0",
|
|
19
|
+
"@typescript-eslint/utils": "5.29.0"
|
|
20
20
|
},
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "676699f28a4ecaf41f8c65418d0bdc9c973714aa"
|
|
22
22
|
}
|