@nx/eslint 0.0.0-pr-31231-180f614 → 0.0.0-pr-31222-862e973

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.
Files changed (52) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/migrations.json +112 -69
  4. package/package.json +7 -6
  5. package/src/executors/lint/utility/eslint-utils.js +0 -6
  6. package/src/generators/convert-to-flat-config/converters/json-converter.d.ts +1 -1
  7. package/src/generators/convert-to-flat-config/converters/json-converter.js +18 -10
  8. package/src/generators/convert-to-flat-config/generator.js +17 -18
  9. package/src/generators/convert-to-flat-config/schema.d.ts +0 -2
  10. package/src/generators/convert-to-inferred/convert-to-inferred.js +1 -2
  11. package/src/generators/init/global-eslint-config.d.ts +1 -1
  12. package/src/generators/init/global-eslint-config.js +6 -17
  13. package/src/generators/init/init-migration.d.ts +1 -1
  14. package/src/generators/init/init-migration.js +13 -18
  15. package/src/generators/init/init.d.ts +0 -1
  16. package/src/generators/init/init.js +6 -31
  17. package/src/generators/lint-project/lint-project.d.ts +0 -1
  18. package/src/generators/lint-project/lint-project.js +15 -37
  19. package/src/generators/lint-project/setup-root-eslint.d.ts +0 -1
  20. package/src/generators/lint-project/setup-root-eslint.js +1 -2
  21. package/src/generators/utils/eslint-file.d.ts +2 -3
  22. package/src/generators/utils/eslint-file.js +28 -160
  23. package/src/generators/utils/flat-config/ast-utils.d.ts +4 -12
  24. package/src/generators/utils/flat-config/ast-utils.js +63 -412
  25. package/src/generators/utils/linter.d.ts +0 -3
  26. package/src/generators/utils/linter.js +2 -2
  27. package/src/generators/workspace-rules-project/workspace-rules-project.js +1 -3
  28. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
  29. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +9 -0
  30. package/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.d.ts +2 -0
  31. package/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.js +44 -0
  32. package/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.d.ts +2 -0
  33. package/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.js +47 -0
  34. package/src/migrations/update-17-1-0/update-typescript-eslint.d.ts +2 -0
  35. package/src/migrations/update-17-1-0/update-typescript-eslint.js +74 -0
  36. package/src/migrations/update-17-2-0/simplify-eslint-patterns.d.ts +2 -0
  37. package/src/migrations/update-17-2-0/simplify-eslint-patterns.js +46 -0
  38. package/src/migrations/update-17-2-9/move-options-to-target-defaults.d.ts +2 -0
  39. package/src/migrations/update-17-2-9/move-options-to-target-defaults.js +107 -0
  40. package/src/plugins/plugin.js +10 -21
  41. package/src/utils/config-file.d.ts +1 -3
  42. package/src/utils/config-file.js +2 -5
  43. package/src/utils/flat-config.d.ts +0 -1
  44. package/src/utils/flat-config.js +3 -9
  45. package/src/utils/version-utils.d.ts +0 -1
  46. package/src/utils/version-utils.js +9 -13
  47. package/src/utils/versions.d.ts +2 -3
  48. package/src/utils/versions.js +3 -4
  49. package/src/migrations/update-20-2-0/update-typescript-eslint-v8-13-0.d.ts +0 -2
  50. package/src/migrations/update-20-2-0/update-typescript-eslint-v8-13-0.js +0 -23
  51. package/src/migrations/update-20-3-0/add-file-extensions-to-overrides.d.ts +0 -2
  52. package/src/migrations/update-20-3-0/add-file-extensions-to-overrides.js +0 -49
@@ -4,20 +4,13 @@ import * as ts from 'typescript';
4
4
  * Remove all overrides from the config file
5
5
  */
6
6
  export declare function removeOverridesFromLintConfig(content: string): string;
7
- export declare function addPatternsToFlatConfigIgnoresBlock(content: string, ignorePatterns: string[]): string;
8
- export declare function hasFlatConfigIgnoresBlock(content: string): boolean;
9
7
  export declare function hasOverride(content: string, lookup: (override: Linter.ConfigOverride<Linter.RulesRecord>) => boolean): boolean;
10
8
  /**
11
9
  * Finds an override matching the lookup function and applies the update function to it
12
10
  */
13
11
  export declare function replaceOverride(content: string, root: string, lookup: (override: Linter.ConfigOverride<Linter.RulesRecord>) => boolean, update?: (override: Partial<Linter.ConfigOverride<Linter.RulesRecord>>) => Partial<Linter.ConfigOverride<Linter.RulesRecord>>): string;
14
12
  /**
15
- * Adding import statement to the top of the file
16
- * The imports are added based on a few rules:
17
- * 1. If it's a default import and matches the variable, return content unchanged.
18
- * 2. If it's a named import and the variables are not part of the import object, add them.
19
- * 3. If no existing import and variable is a string, add a default import.
20
- * 4. If no existing import and variable is an array, add it as an object import.
13
+ * Adding require statement to the top of the file
21
14
  */
22
15
  export declare function addImportToFlatConfig(content: string, variable: string | string[], imp: string): string;
23
16
  /**
@@ -25,7 +18,7 @@ export declare function addImportToFlatConfig(content: string, variable: string
25
18
  */
26
19
  export declare function removeImportFromFlatConfig(content: string, variable: string, imp: string): string;
27
20
  /**
28
- * Injects new ts.expression to the end of the module.exports or export default array.
21
+ * Injects new ts.expression to the end of the module.exports array.
29
22
  */
30
23
  export declare function addBlockToFlatConfigExport(content: string, config: ts.Expression | ts.SpreadElement, options?: {
31
24
  insertAtTheEnd?: boolean;
@@ -50,7 +43,7 @@ export declare function addFlatCompatToFlatConfig(content: string): string;
50
43
  * Generate node list representing the imports and the exports blocks
51
44
  * Optionally add flat compat initialization
52
45
  */
53
- export declare function createNodeList(importsMap: Map<string, string>, exportElements: ts.Expression[], format: 'mjs' | 'cjs'): ts.NodeArray<ts.VariableStatement | ts.Identifier | ts.ExpressionStatement | ts.SourceFile>;
46
+ export declare function createNodeList(importsMap: Map<string, string>, exportElements: ts.Expression[]): ts.NodeArray<ts.VariableStatement | ts.Identifier | ts.ExpressionStatement | ts.SourceFile>;
54
47
  export declare function generateSpreadElement(name: string): ts.SpreadElement;
55
48
  export declare function generatePluginExtendsElement(plugins: string[]): ts.SpreadElement;
56
49
  export declare function generatePluginExtendsElementWithCompatFixup(plugin: string): ts.SpreadElement;
@@ -62,7 +55,6 @@ export declare function stringifyNodeList(nodes: ts.NodeArray<ts.VariableStateme
62
55
  * generates AST require statement
63
56
  */
64
57
  export declare function generateRequire(variableName: string | ts.ObjectBindingPattern, imp: string): ts.VariableStatement;
65
- export declare function generateESMImport(variableName: string | ts.ObjectBindingPattern, imp: string): ts.ImportDeclaration;
66
58
  export declare function overrideNeedsCompat(override: Partial<Linter.ConfigOverride<Linter.RulesRecord>>): string | string[] | {
67
59
  [name: string]: boolean;
68
60
  };
@@ -72,7 +64,7 @@ export declare function overrideNeedsCompat(override: Partial<Linter.ConfigOverr
72
64
  */
73
65
  export declare function generateFlatOverride(_override: Partial<Linter.ConfigOverride<Linter.RulesRecord>> & {
74
66
  ignores?: Linter.FlatConfig['ignores'];
75
- }, format: 'mjs' | 'cjs'): ts.ObjectLiteralExpression | ts.SpreadElement;
67
+ }): ts.ObjectLiteralExpression | ts.SpreadElement;
76
68
  export declare function generateFlatPredefinedConfig(predefinedConfigName: string, moduleName?: string, spread?: boolean): ts.ObjectLiteralExpression | ts.SpreadElement | ts.ElementAccessExpression;
77
69
  export declare function mapFilePaths<T extends Partial<Linter.ConfigOverride<Linter.RulesRecord>>>(_override: T): T;
78
70
  /**