@nrwl/linter 15.9.2 → 16.0.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. package/executors.json +5 -5
  2. package/generators.json +2 -28
  3. package/index.d.ts +1 -5
  4. package/index.js +1 -13
  5. package/index.js.map +1 -1
  6. package/package.json +7 -20
  7. package/README.md +0 -61
  8. package/migrations.json +0 -226
  9. package/src/executors/eslint/compat.d.ts +0 -2
  10. package/src/executors/eslint/compat.js +0 -6
  11. package/src/executors/eslint/compat.js.map +0 -1
  12. package/src/executors/eslint/hasher.d.ts +0 -7
  13. package/src/executors/eslint/hasher.js +0 -47
  14. package/src/executors/eslint/hasher.js.map +0 -1
  15. package/src/executors/eslint/lint.impl.d.ts +0 -5
  16. package/src/executors/eslint/lint.impl.js +0 -116
  17. package/src/executors/eslint/lint.impl.js.map +0 -1
  18. package/src/executors/eslint/schema.d.ts +0 -38
  19. package/src/executors/eslint/schema.json +0 -139
  20. package/src/executors/eslint/utility/eslint-utils.d.ts +0 -4
  21. package/src/executors/eslint/utility/eslint-utils.js +0 -52
  22. package/src/executors/eslint/utility/eslint-utils.js.map +0 -1
  23. package/src/generators/init/global-eslint-config.d.ts +0 -36
  24. package/src/generators/init/global-eslint-config.js +0 -77
  25. package/src/generators/init/global-eslint-config.js.map +0 -1
  26. package/src/generators/init/init-migration.d.ts +0 -3
  27. package/src/generators/init/init-migration.js +0 -68
  28. package/src/generators/init/init-migration.js.map +0 -1
  29. package/src/generators/init/init.d.ts +0 -9
  30. package/src/generators/init/init.js +0 -63
  31. package/src/generators/init/init.js.map +0 -1
  32. package/src/generators/lint-project/lint-project.d.ts +0 -16
  33. package/src/generators/lint-project/lint-project.js +0 -137
  34. package/src/generators/lint-project/lint-project.js.map +0 -1
  35. package/src/generators/utils/eslint-file.d.ts +0 -4
  36. package/src/generators/utils/eslint-file.js +0 -27
  37. package/src/generators/utils/eslint-file.js.map +0 -1
  38. package/src/generators/utils/eslint-targets.d.ts +0 -2
  39. package/src/generators/utils/eslint-targets.js +0 -13
  40. package/src/generators/utils/eslint-targets.js.map +0 -1
  41. package/src/generators/utils/linter.d.ts +0 -4
  42. package/src/generators/utils/linter.js +0 -9
  43. package/src/generators/utils/linter.js.map +0 -1
  44. package/src/generators/workspace-rule/files/__name__.spec.ts__tmpl__ +0 -11
  45. package/src/generators/workspace-rule/files/__name__.ts__tmpl__ +0 -37
  46. package/src/generators/workspace-rule/schema.json +0 -26
  47. package/src/generators/workspace-rule/workspace-rule.d.ts +0 -7
  48. package/src/generators/workspace-rule/workspace-rule.js +0 -79
  49. package/src/generators/workspace-rule/workspace-rule.js.map +0 -1
  50. package/src/generators/workspace-rules-project/files/index.ts__tmpl__ +0 -27
  51. package/src/generators/workspace-rules-project/files/tsconfig.json__tmpl__ +0 -13
  52. package/src/generators/workspace-rules-project/files/tsconfig.lint.json__tmpl__ +0 -9
  53. package/src/generators/workspace-rules-project/schema.json +0 -23
  54. package/src/generators/workspace-rules-project/workspace-rules-project.d.ts +0 -8
  55. package/src/generators/workspace-rules-project/workspace-rules-project.js +0 -86
  56. package/src/generators/workspace-rules-project/workspace-rules-project.js.map +0 -1
  57. package/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.d.ts +0 -2
  58. package/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.js +0 -32
  59. package/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.js.map +0 -1
  60. package/src/migrations/update-12-9-0/add-outputs.d.ts +0 -2
  61. package/src/migrations/update-12-9-0/add-outputs.js +0 -23
  62. package/src/migrations/update-12-9-0/add-outputs.js.map +0 -1
  63. package/src/migrations/update-13-3-0/eslint-8-updates.d.ts +0 -2
  64. package/src/migrations/update-13-3-0/eslint-8-updates.js +0 -44
  65. package/src/migrations/update-13-3-0/eslint-8-updates.js.map +0 -1
  66. package/src/migrations/update-14-1-9/add-swc-deps-if-needed.d.ts +0 -2
  67. package/src/migrations/update-14-1-9/add-swc-deps-if-needed.js +0 -20
  68. package/src/migrations/update-14-1-9/add-swc-deps-if-needed.js.map +0 -1
  69. package/src/migrations/update-14-4-4/experimental-to-utils-deps.d.ts +0 -2
  70. package/src/migrations/update-14-4-4/experimental-to-utils-deps.js +0 -30
  71. package/src/migrations/update-14-4-4/experimental-to-utils-deps.js.map +0 -1
  72. package/src/migrations/update-14-4-4/experimental-to-utils-rules.d.ts +0 -2
  73. package/src/migrations/update-14-4-4/experimental-to-utils-rules.js +0 -38
  74. package/src/migrations/update-14-4-4/experimental-to-utils-rules.js.map +0 -1
  75. package/src/migrations/update-15-0-0/add-eslint-inputs.d.ts +0 -2
  76. package/src/migrations/update-15-0-0/add-eslint-inputs.js +0 -33
  77. package/src/migrations/update-15-0-0/add-eslint-inputs.js.map +0 -1
  78. package/src/migrations/update-15-7-1/add-eslint-ignore.d.ts +0 -2
  79. package/src/migrations/update-15-7-1/add-eslint-ignore.js +0 -42
  80. package/src/migrations/update-15-7-1/add-eslint-ignore.js.map +0 -1
  81. package/src/utils/convert-tslint-to-eslint/convert-nx-enforce-module-boundaries-rule.d.ts +0 -5
  82. package/src/utils/convert-tslint-to-eslint/convert-nx-enforce-module-boundaries-rule.js +0 -57
  83. package/src/utils/convert-tslint-to-eslint/convert-nx-enforce-module-boundaries-rule.js.map +0 -1
  84. package/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.d.ts +0 -9
  85. package/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.js +0 -152
  86. package/src/utils/convert-tslint-to-eslint/convert-to-eslint-config.js.map +0 -1
  87. package/src/utils/convert-tslint-to-eslint/example-tslint-configs.d.ts +0 -326
  88. package/src/utils/convert-tslint-to-eslint/example-tslint-configs.js +0 -325
  89. package/src/utils/convert-tslint-to-eslint/example-tslint-configs.js.map +0 -1
  90. package/src/utils/convert-tslint-to-eslint/index.d.ts +0 -2
  91. package/src/utils/convert-tslint-to-eslint/index.js +0 -9
  92. package/src/utils/convert-tslint-to-eslint/index.js.map +0 -1
  93. package/src/utils/convert-tslint-to-eslint/project-converter.d.ts +0 -72
  94. package/src/utils/convert-tslint-to-eslint/project-converter.js +0 -396
  95. package/src/utils/convert-tslint-to-eslint/project-converter.js.map +0 -1
  96. package/src/utils/convert-tslint-to-eslint/utils.d.ts +0 -10
  97. package/src/utils/convert-tslint-to-eslint/utils.js +0 -91
  98. package/src/utils/convert-tslint-to-eslint/utils.js.map +0 -1
  99. package/src/utils/rules-requiring-type-checking.d.ts +0 -3
  100. package/src/utils/rules-requiring-type-checking.js +0 -88
  101. package/src/utils/rules-requiring-type-checking.js.map +0 -1
  102. package/src/utils/testing.d.ts +0 -2
  103. package/src/utils/testing.js +0 -13
  104. package/src/utils/testing.js.map +0 -1
  105. package/src/utils/versions.d.ts +0 -5
  106. package/src/utils/versions.js +0 -9
  107. package/src/utils/versions.js.map +0 -1
  108. package/src/utils/workspace-lint-rules.d.ts +0 -1
  109. package/src/utils/workspace-lint-rules.js +0 -6
  110. package/src/utils/workspace-lint-rules.js.map +0 -1
@@ -1,88 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeParserOptionsProjectIfNotRequired = exports.hasRulesRequiringTypeChecking = void 0;
4
- // Cache the resolved rules from node_modules
5
- let knownRulesRequiringTypeChecking = null;
6
- function resolveKnownRulesRequiringTypeChecking() {
7
- if (knownRulesRequiringTypeChecking) {
8
- return knownRulesRequiringTypeChecking;
9
- }
10
- try {
11
- const { rules } = require('@typescript-eslint/eslint-plugin');
12
- const rulesRequiringTypeInfo = Object.entries(rules)
13
- .map(([ruleName, config]) => {
14
- var _a, _b;
15
- if ((_b = (_a = config.meta) === null || _a === void 0 ? void 0 : _a.docs) === null || _b === void 0 ? void 0 : _b.requiresTypeChecking) {
16
- return `@typescript-eslint/${ruleName}`;
17
- }
18
- return null;
19
- })
20
- .filter(Boolean);
21
- return rulesRequiringTypeInfo;
22
- }
23
- catch (err) {
24
- console.log(err);
25
- return null;
26
- }
27
- }
28
- function hasRulesRequiringTypeChecking(eslintConfig) {
29
- knownRulesRequiringTypeChecking = resolveKnownRulesRequiringTypeChecking();
30
- if (!knownRulesRequiringTypeChecking) {
31
- /**
32
- * If (unexpectedly) known rules requiring type checking could not be resolved,
33
- * default to assuming that the rules are in use to align most closely with Nx
34
- * ESLint configs to date.
35
- */
36
- return true;
37
- }
38
- const allRulesInConfig = getAllRulesInConfig(eslintConfig);
39
- return allRulesInConfig.some((rule) => knownRulesRequiringTypeChecking.includes(rule));
40
- }
41
- exports.hasRulesRequiringTypeChecking = hasRulesRequiringTypeChecking;
42
- function removeParserOptionsProjectIfNotRequired(json) {
43
- // At least one rule requiring type-checking is in use, do not migrate the config
44
- if (hasRulesRequiringTypeChecking(json)) {
45
- return json;
46
- }
47
- removeProjectParserOptionFromConfig(json);
48
- return json;
49
- }
50
- exports.removeParserOptionsProjectIfNotRequired = removeParserOptionsProjectIfNotRequired;
51
- function determineEnabledRules(rules) {
52
- return Object.entries(rules)
53
- .filter(([key, value]) => {
54
- return !(typeof value === 'string' && value === 'off');
55
- })
56
- .map(([ruleName]) => ruleName);
57
- }
58
- function getAllRulesInConfig(json) {
59
- var _a;
60
- let allRules = json.rules ? determineEnabledRules(json.rules) : [];
61
- if (((_a = json.overrides) === null || _a === void 0 ? void 0 : _a.length) > 0) {
62
- for (const o of json.overrides) {
63
- if (o.rules) {
64
- allRules = allRules = [...allRules, ...determineEnabledRules(o.rules)];
65
- }
66
- }
67
- }
68
- return allRules;
69
- }
70
- function removeProjectParserOptionFromConfig(json) {
71
- var _a, _b;
72
- (_a = json.parserOptions) === null || _a === void 0 ? true : delete _a.project;
73
- // If parserOptions is left empty by this removal, also clean up the whole object
74
- if (json.parserOptions && Object.keys(json.parserOptions).length === 0) {
75
- delete json.parserOptions;
76
- }
77
- if (json.overrides) {
78
- for (const override of json.overrides) {
79
- (_b = override.parserOptions) === null || _b === void 0 ? true : delete _b.project;
80
- // If parserOptions is left empty by this removal, also clean up the whole object
81
- if (override.parserOptions &&
82
- Object.keys(override.parserOptions).length === 0) {
83
- delete override.parserOptions;
84
- }
85
- }
86
- }
87
- }
88
- //# sourceMappingURL=rules-requiring-type-checking.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rules-requiring-type-checking.js","sourceRoot":"","sources":["../../../../../packages/linter/src/utils/rules-requiring-type-checking.ts"],"names":[],"mappings":";;;AAEA,6CAA6C;AAC7C,IAAI,+BAA+B,GAAoB,IAAI,CAAC;AAE5D,SAAS,sCAAsC;IAC7C,IAAI,+BAA+B,EAAE;QACnC,OAAO,+BAA+B,CAAC;KACxC;IACD,IAAI;QACF,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;QAC9D,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;aACjD,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE;;YAC1B,IAAI,MAAA,MAAC,MAAc,CAAC,IAAI,0CAAE,IAAI,0CAAE,oBAAoB,EAAE;gBACpD,OAAO,sBAAsB,QAAQ,EAAE,CAAC;aACzC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;aACD,MAAM,CAAC,OAAO,CAAC,CAAC;QACnB,OAAO,sBAAsB,CAAC;KAC/B;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AAED,SAAgB,6BAA6B,CAC3C,YAA2B;IAE3B,+BAA+B,GAAG,sCAAsC,EAAE,CAAC;IAC3E,IAAI,CAAC,+BAA+B,EAAE;QACpC;;;;WAIG;QACH,OAAO,IAAI,CAAC;KACb;IACD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC3D,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACpC,+BAA+B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAC/C,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AAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;QACtE,OAAO,IAAI,CAAC,aAAa,CAAC;KAC3B;IACD,IAAI,IAAI,CAAC,SAAS,EAAE;QAClB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE;YAC9B,MAAA,QAAQ,CAAC,aAAa,+CAAE,OAAO,CAAC;YACvC,iFAAiF;YACjF,IACE,QAAQ,CAAC,aAAa;gBACtB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAChD;gBACA,OAAO,QAAQ,CAAC,aAAa,CAAC;aAC/B;SACF;KACF;AACH,CAAC"}
@@ -1,2 +0,0 @@
1
- import type { Tree } from '@angular-devkit/schematics';
2
- export declare function runMigration<T extends object = any>(migrationName: string, options: T, tree: Tree): Promise<import("@angular-devkit/schematics/testing").UnitTestTree>;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runMigration = void 0;
4
- const testing_1 = require("@angular-devkit/schematics/testing");
5
- const path_1 = require("path");
6
- const migrationTestRunner = new testing_1.SchematicTestRunner('@nrwl/linter-migrations', (0, path_1.join)(__dirname, '../../migrations.json'));
7
- function runMigration(migrationName, options, tree) {
8
- return migrationTestRunner
9
- .runSchematicAsync(migrationName, options, tree)
10
- .toPromise();
11
- }
12
- exports.runMigration = runMigration;
13
- //# sourceMappingURL=testing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../../../packages/linter/src/utils/testing.ts"],"names":[],"mappings":";;;AAAA,gEAAyE;AACzE,+BAA4B;AAG5B,MAAM,mBAAmB,GAAG,IAAI,6BAAmB,CACjD,yBAAyB,EACzB,IAAA,WAAI,EAAC,SAAS,EAAE,uBAAuB,CAAC,CACzC,CAAC;AAEF,SAAgB,YAAY,CAC1B,aAAqB,EACrB,OAAU,EACV,IAAU;IAEV,OAAO,mBAAmB;SACvB,iBAAiB,CAAI,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC;SAClD,SAAS,EAAE,CAAC;AACjB,CAAC;AARD,oCAQC"}
@@ -1,5 +0,0 @@
1
- export declare const nxVersion: any;
2
- export declare const tslintToEslintConfigVersion = "^2.13.0";
3
- export declare const typescriptESLintVersion = "^5.36.1";
4
- export declare const eslintVersion = "~8.15.0";
5
- export declare const eslintConfigPrettierVersion = "8.1.0";
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.eslintConfigPrettierVersion = exports.eslintVersion = exports.typescriptESLintVersion = exports.tslintToEslintConfigVersion = exports.nxVersion = void 0;
4
- exports.nxVersion = require('../../package.json').version;
5
- exports.tslintToEslintConfigVersion = '^2.13.0';
6
- exports.typescriptESLintVersion = '^5.36.1';
7
- exports.eslintVersion = '~8.15.0';
8
- exports.eslintConfigPrettierVersion = '8.1.0';
9
- //# sourceMappingURL=versions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/linter/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAElD,QAAA,2BAA2B,GAAG,SAAS,CAAC;AAExC,QAAA,uBAAuB,GAAG,SAAS,CAAC;AACpC,QAAA,aAAa,GAAG,SAAS,CAAC;AAC1B,QAAA,2BAA2B,GAAG,OAAO,CAAC"}
@@ -1 +0,0 @@
1
- export declare const workspaceLintPluginDir: string;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.workspaceLintPluginDir = void 0;
4
- const devkit_1 = require("@nrwl/devkit");
5
- exports.workspaceLintPluginDir = (0, devkit_1.joinPathFragments)('tools/eslint-rules');
6
- //# sourceMappingURL=workspace-lint-rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace-lint-rules.js","sourceRoot":"","sources":["../../../../../packages/linter/src/utils/workspace-lint-rules.ts"],"names":[],"mappings":";;;AAAA,yCAAiD;AAEpC,QAAA,sBAAsB,GAAG,IAAA,0BAAiB,EAAC,oBAAoB,CAAC,CAAC"}