@angular-eslint/utils 20.5.2-alpha.4 → 20.5.2-alpha.5

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.
@@ -7,8 +7,8 @@ export declare function getImportAddFix({ compatibleWithTypeOnlyImport, fixer, i
7
7
  node: TSESTree.Node;
8
8
  }): TSESLint.RuleFix | undefined;
9
9
  export declare function getImportRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, importDeclarations: readonly TSESTree.ImportDeclaration[], importName: string, fixer: TSESLint.RuleFixer): TSESLint.RuleFix | undefined;
10
- export declare function getImplementsSchemaFixer({ id, superClass, implements: classImplements }: TSESTree.ClassDeclaration, interfaceName: string): {
11
- readonly implementsNodeReplace: TSESTree.TSClassImplements | TSESTree.Identifier;
10
+ export declare function getImplementsSchemaFixer({ id, superClass, implements: classImplements, typeParameters, }: TSESTree.ClassDeclaration, interfaceName: string): {
11
+ readonly implementsNodeReplace: TSESTree.TSClassImplements | TSESTree.Identifier | TSESTree.TSTypeParameterDeclaration;
12
12
  readonly implementsTextReplace: string;
13
13
  };
14
14
  export declare function getDecoratorPropertyAddFix({ expression }: TSESTree.Decorator, fixer: TSESLint.RuleFixer, text: string): TSESLint.RuleFix | undefined;
@@ -1 +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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,CAAC,UAAU,CAAC,EACzC,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,EAC3C,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,QAAQ,CAAC,SAAS,GACxB,QAAQ,CAAC,OAAO,GAAG,SAAS,CAkC9B;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,KAAK,EAAE,QAAQ,CAAC,SAAS,GACxB,QAAQ,CAAC,OAAO,CAMlB"}
@@ -53,16 +53,30 @@ function getImportRemoveFix(sourceCode, importDeclarations, importName, fixer) {
53
53
  importSpecifier.range[1],
54
54
  ]);
55
55
  }
56
- function getImplementsSchemaFixer({ id, superClass, implements: classImplements }, interfaceName) {
57
- const [implementsNodeReplace, implementsTextReplace] = Array.isArray(classImplements) && classImplements.length > 0
58
- ? [(0, utils_2.getLast)(classImplements), `, ${interfaceName}`]
59
- : [
60
- ((0, utils_2.isNotNullOrUndefined)(superClass)
61
- ? superClass
62
- : id),
63
- ` implements ${interfaceName}`,
64
- ];
65
- return { implementsNodeReplace, implementsTextReplace };
56
+ function getImplementsSchemaFixer({ id, superClass, implements: classImplements, typeParameters, }, interfaceName) {
57
+ if (Array.isArray(classImplements) && classImplements.length > 0) {
58
+ return {
59
+ implementsNodeReplace: (0, utils_2.getLast)(classImplements),
60
+ implementsTextReplace: `, ${interfaceName}`,
61
+ };
62
+ }
63
+ const implementsTextReplace = ` implements ${interfaceName}`;
64
+ if ((0, utils_2.isNotNullOrUndefined)(superClass)) {
65
+ return {
66
+ implementsNodeReplace: superClass,
67
+ implementsTextReplace,
68
+ };
69
+ }
70
+ if ((0, utils_2.isNotNullOrUndefined)(typeParameters)) {
71
+ return {
72
+ implementsNodeReplace: typeParameters,
73
+ implementsTextReplace,
74
+ };
75
+ }
76
+ return {
77
+ implementsNodeReplace: id,
78
+ implementsTextReplace,
79
+ };
66
80
  }
67
81
  function getDecoratorPropertyAddFix({ expression }, fixer, text) {
68
82
  if (!(0, ast_utils_1.isCallExpression)(expression)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/utils",
3
- "version": "20.5.2-alpha.4",
3
+ "version": "20.5.2-alpha.5",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "typescript": "*"
23
23
  },
24
24
  "dependencies": {
25
- "@angular-eslint/bundled-angular-compiler": "20.5.2-alpha.4"
25
+ "@angular-eslint/bundled-angular-compiler": "20.5.2-alpha.5"
26
26
  },
27
27
  "nx": {
28
28
  "namedInputs": {