@nrwl/linter 15.0.0-beta.4 → 15.0.0-rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/migrations.json +0 -84
  3. package/package.json +5 -5
  4. package/src/executors/eslint/schema.json +2 -0
  5. package/src/executors/lint/schema.json +2 -0
  6. package/src/generators/utils/eslint-file.d.ts +1 -0
  7. package/src/generators/utils/eslint-file.js +10 -3
  8. package/src/generators/utils/eslint-file.js.map +1 -1
  9. package/src/migrations/update-15-0-0/add-eslint-inputs.d.ts +1 -1
  10. package/src/migrations/update-15-0-0/add-eslint-inputs.js +5 -4
  11. package/src/migrations/update-15-0-0/add-eslint-inputs.js.map +1 -1
  12. package/src/migrations/update-10-3-0/add-json-ext-to-eslintrc.d.ts +0 -1
  13. package/src/migrations/update-10-3-0/add-json-ext-to-eslintrc.js +0 -52
  14. package/src/migrations/update-10-3-0/add-json-ext-to-eslintrc.js.map +0 -1
  15. package/src/migrations/update-10-3-0/add-root-eslintrc-json-to-workspace-implicit-deps.d.ts +0 -1
  16. package/src/migrations/update-10-3-0/add-root-eslintrc-json-to-workspace-implicit-deps.js +0 -18
  17. package/src/migrations/update-10-3-0/add-root-eslintrc-json-to-workspace-implicit-deps.js.map +0 -1
  18. package/src/migrations/update-10-3-0/update-10-3-0.d.ts +0 -1
  19. package/src/migrations/update-10-3-0/update-10-3-0.js +0 -20
  20. package/src/migrations/update-10-3-0/update-10-3-0.js.map +0 -1
  21. package/src/migrations/update-10-3-0/update-eslint-builder-and-config.d.ts +0 -1
  22. package/src/migrations/update-10-3-0/update-eslint-builder-and-config.js +0 -81
  23. package/src/migrations/update-10-3-0/update-eslint-builder-and-config.js.map +0 -1
  24. package/src/migrations/update-10-3-1/revert-node-modules-files-in-eslint-builder-options.d.ts +0 -1
  25. package/src/migrations/update-10-3-1/revert-node-modules-files-in-eslint-builder-options.js +0 -24
  26. package/src/migrations/update-10-3-1/revert-node-modules-files-in-eslint-builder-options.js.map +0 -1
  27. package/src/migrations/update-10-4-0/update-eslint-configs-to-use-nx-presets.d.ts +0 -7
  28. package/src/migrations/update-10-4-0/update-eslint-configs-to-use-nx-presets.js +0 -447
  29. package/src/migrations/update-10-4-0/update-eslint-configs-to-use-nx-presets.js.map +0 -1
  30. package/src/migrations/update-10-4-0/update-root-eslint-config-to-use-overrides.d.ts +0 -1
  31. package/src/migrations/update-10-4-0/update-root-eslint-config-to-use-overrides.js +0 -107
  32. package/src/migrations/update-10-4-0/update-root-eslint-config-to-use-overrides.js.map +0 -1
  33. package/src/migrations/update-11-5-0/always-use-project-level-tsconfigs-with-eslint.d.ts +0 -3
  34. package/src/migrations/update-11-5-0/always-use-project-level-tsconfigs-with-eslint.js +0 -95
  35. package/src/migrations/update-11-5-0/always-use-project-level-tsconfigs-with-eslint.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,6 @@
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
- # [15.0.0-beta.4](https://github.com/nrwl/nx/compare/14.8.0...15.0.0-beta.4) (2022-10-11)
6
+ # [15.0.0-rc1](https://github.com/nrwl/nx/compare/14.8.0...15.0.0-rc1) (2022-10-13)
7
7
 
8
8
  **Note:** Version bump only for package @nrwl/linter
package/migrations.json CHANGED
@@ -1,46 +1,5 @@
1
1
  {
2
2
  "schematics": {
3
- "update-10.3.0": {
4
- "version": "10.3.0-beta.1",
5
- "description": "Update @typescript-eslint to v4.3",
6
- "factory": "./src/migrations/update-10-3-0/update-10-3-0"
7
- },
8
- "update-eslint-builder-and-config": {
9
- "version": "10.3.0-beta.0",
10
- "description": "Migrate to the new ESLint builder and ESLint config style",
11
- "factory": "./src/migrations/update-10-3-0/update-eslint-builder-and-config"
12
- },
13
- "add-json-ext-to-eslintrc": {
14
- "version": "10.3.0-beta.2",
15
- "description": "Add explicit .json file extension to .eslintrc files, not using an extension is deprecated",
16
- "factory": "./src/migrations/update-10-3-0/add-json-ext-to-eslintrc"
17
- },
18
- "add-root-eslintrc-json-to-workspace-implicit-deps": {
19
- "version": "10.3.0-beta.3",
20
- "description": "Update implicitDependencies within nx.json to include root .eslintrc.json",
21
- "factory": "./src/migrations/update-10-3-0/add-root-eslintrc-json-to-workspace-implicit-deps"
22
- },
23
- "revert-node-modules-files-in-eslint-builder-options": {
24
- "version": "10.3.1-beta.1",
25
- "description": "Revert any node_modules lintFilesPatterns that were accidentally included by update-eslint-builder-and-config",
26
- "factory": "./src/migrations/update-10-3-1/revert-node-modules-files-in-eslint-builder-options"
27
- },
28
- "update-eslint-configs-to-use-nx-presets": {
29
- "version": "10.4.0-beta.0",
30
- "description": "Update ESLint config files to use preset configs which eslint-plugin-nx exports",
31
- "factory": "./src/migrations/update-10-4-0/update-eslint-configs-to-use-nx-presets"
32
- },
33
- "update-root-eslint-config-to-use-overrides": {
34
- "version": "10.4.0-beta.1",
35
- "description": "Update root ESLint config to use overrides",
36
- "factory": "./src/migrations/update-10-4-0/update-root-eslint-config-to-use-overrides"
37
- },
38
- "always-use-project-level-tsconfigs-with-eslint": {
39
- "cli": "nx",
40
- "version": "11.5.0-beta.0",
41
- "description": "Update project .eslintrc.json files to always use project level tsconfigs",
42
- "factory": "./src/migrations/update-11-5-0/always-use-project-level-tsconfigs-with-eslint"
43
- },
44
3
  "remove-eslint-project-config-if-no-type-checking-rules": {
45
4
  "cli": "nx",
46
5
  "version": "12.4.0-beta.0",
@@ -97,49 +56,6 @@
97
56
  }
98
57
  },
99
58
  "packageJsonUpdates": {
100
- "10.3.0": {
101
- "version": "10.3.0-beta.1",
102
- "packages": {
103
- "@typescript-eslint/parser": {
104
- "version": "4.3.0",
105
- "alwaysAddToPackageJson": false
106
- },
107
- "@typescript-eslint/eslint-plugin": {
108
- "version": "4.3.0",
109
- "alwaysAddToPackageJson": false
110
- },
111
- "eslint": {
112
- "version": "7.10.0",
113
- "alwaysAddToPackageJson": false
114
- }
115
- }
116
- },
117
- "11.5.0": {
118
- "version": "11.5.0-beta.0",
119
- "packages": {
120
- "eslint-config-prettier": {
121
- "version": "8.1.0",
122
- "alwaysAddToPackageJson": false
123
- }
124
- }
125
- },
126
- "11.6.0": {
127
- "version": "11.6.0-beta.1",
128
- "packages": {
129
- "@typescript-eslint/parser": {
130
- "version": "4.19.0",
131
- "alwaysAddToPackageJson": false
132
- },
133
- "@typescript-eslint/eslint-plugin": {
134
- "version": "4.19.0",
135
- "alwaysAddToPackageJson": false
136
- },
137
- "eslint": {
138
- "version": "7.22.0",
139
- "alwaysAddToPackageJson": false
140
- }
141
- }
142
- },
143
59
  "12.6.0": {
144
60
  "version": "12.6.0-beta.8",
145
61
  "packages": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrwl/linter",
3
- "version": "15.0.0-beta.4",
3
+ "version": "15.0.0-rc1",
4
4
  "private": false,
5
5
  "description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.",
6
6
  "repository": {
@@ -33,10 +33,10 @@
33
33
  "eslint": "^8.0.0"
34
34
  },
35
35
  "dependencies": {
36
- "@nrwl/devkit": "15.0.0-beta.4",
37
- "@nrwl/jest": "15.0.0-beta.4",
36
+ "@nrwl/devkit": "15.0.0-rc1",
37
+ "@nrwl/jest": "15.0.0-rc1",
38
38
  "@phenomnomnominal/tsquery": "4.1.1",
39
- "nx": "15.0.0-beta.4",
39
+ "nx": "15.0.0-rc1",
40
40
  "tmp": "~0.2.1",
41
41
  "tslib": "^2.3.0"
42
42
  },
@@ -49,5 +49,5 @@
49
49
  "access": "public"
50
50
  },
51
51
  "types": "./index.d.ts",
52
- "gitHead": "f9e57e26947a53ae5e37f70526451bcd7005331a"
52
+ "gitHead": "a947e2514942806016a24e2fd36faa882aab56a7"
53
53
  }
@@ -1,4 +1,6 @@
1
1
  {
2
+ "version": 2,
3
+ "outputCapture": "direct-nodejs",
2
4
  "$schema": "http://json-schema.org/schema",
3
5
  "title": "ESLint Lint Target",
4
6
  "description": "ESLint Lint Target.",
@@ -1,4 +1,6 @@
1
1
  {
2
+ "version": 2,
3
+ "outputCapture": "direct-nodejs",
2
4
  "$schema": "http://json-schema.org/schema",
3
5
  "title": "Lint Target",
4
6
  "description": "Linter.",
@@ -1,2 +1,3 @@
1
1
  import type { Tree } from '@nrwl/devkit';
2
+ export declare const eslintConfigFileWhitelist: string[];
2
3
  export declare function findEslintFile(tree: Tree): string | null;
@@ -1,9 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findEslintFile = void 0;
4
- const eslintFileList = ['.eslintrc.json', '.eslintrc.js'];
3
+ exports.findEslintFile = exports.eslintConfigFileWhitelist = void 0;
4
+ exports.eslintConfigFileWhitelist = [
5
+ '.eslintrc',
6
+ '.eslintrc.js',
7
+ '.eslintrc.cjs',
8
+ '.eslintrc.yaml',
9
+ '.eslintrc.yml',
10
+ '.eslintrc.json',
11
+ ];
5
12
  function findEslintFile(tree) {
6
- for (const file of eslintFileList) {
13
+ for (const file of exports.eslintConfigFileWhitelist) {
7
14
  if (tree.exists(file)) {
8
15
  return file;
9
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"eslint-file.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/utils/eslint-file.ts"],"names":[],"mappings":";;;AAEA,MAAM,cAAc,GAAG,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAE1D,SAAgB,cAAc,CAAC,IAAU;IACvC,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE;QACjC,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACrB,OAAO,IAAI,CAAC;SACb;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAPD,wCAOC"}
1
+ {"version":3,"file":"eslint-file.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/utils/eslint-file.ts"],"names":[],"mappings":";;;AAEa,QAAA,yBAAyB,GAAG;IACvC,WAAW;IACX,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,eAAe;IACf,gBAAgB;CACjB,CAAC;AAEF,SAAgB,cAAc,CAAC,IAAU;IACvC,KAAK,MAAM,IAAI,IAAI,iCAAyB,EAAE;QAC5C,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACrB,OAAO,IAAI,CAAC;SACb;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AARD,wCAQC"}
@@ -1,2 +1,2 @@
1
1
  import { Tree } from '@nrwl/devkit';
2
- export default function (tree: Tree): Promise<void>;
2
+ export default function addEslintInputs(tree: Tree): Promise<void>;
@@ -3,15 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nrwl/devkit");
5
5
  const executor_options_utils_1 = require("@nrwl/workspace/src/utilities/executor-options-utils");
6
- function default_1(tree) {
6
+ const eslint_file_1 = require("../../generators/utils/eslint-file");
7
+ function addEslintInputs(tree) {
7
8
  var _a, _b, _c, _d;
8
9
  var _e;
9
10
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
11
  const workspaceConfiguration = (0, devkit_1.readWorkspaceConfiguration)(tree);
11
- const globalEslintFile = ['.eslintrc.js', '.eslintrc.json'].find((file) => tree.exists(file));
12
+ const globalEslintFile = eslint_file_1.eslintConfigFileWhitelist.find((file) => tree.exists(file));
12
13
  if (globalEslintFile && ((_a = workspaceConfiguration.namedInputs) === null || _a === void 0 ? void 0 : _a.production)) {
13
14
  const productionFileset = new Set(workspaceConfiguration.namedInputs.production);
14
- productionFileset.add('!{projectRoot}/.eslintrc.json');
15
+ productionFileset.add(`!{projectRoot}/${globalEslintFile}`);
15
16
  workspaceConfiguration.namedInputs.production =
16
17
  Array.from(productionFileset);
17
18
  }
@@ -29,7 +30,7 @@ function default_1(tree) {
29
30
  yield (0, devkit_1.formatFiles)(tree);
30
31
  });
31
32
  }
32
- exports.default = default_1;
33
+ exports.default = addEslintInputs;
33
34
  function getEslintTargets(tree) {
34
35
  const eslintTargetNames = new Set();
35
36
  (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/linter:eslint', (_, __, target) => {
@@ -1 +1 @@
1
- {"version":3,"file":"add-eslint-inputs.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AACtB,iGAA8F;AAE9F,mBAA+B,IAAU;;;;QACvC,MAAM,sBAAsB,GAAG,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC;QAEhE,MAAM,gBAAgB,GAAG,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACxE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAClB,CAAC;QAEF,IAAI,gBAAgB,KAAI,MAAA,sBAAsB,CAAC,WAAW,0CAAE,UAAU,CAAA,EAAE;YACtE,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAC/B,sBAAsB,CAAC,WAAW,CAAC,UAAU,CAC9C,CAAC;YACF,iBAAiB,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;YACvD,sBAAsB,CAAC,WAAW,CAAC,UAAU;gBAC3C,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;SACjC;QAED,KAAK,MAAM,UAAU,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE;YAC/C,MAAA,sBAAsB,CAAC,cAAc,oCAArC,sBAAsB,CAAC,cAAc,GAAK,EAAE,EAAC;YAC7C,MAAM,kBAAkB,GAAG,aAAC,sBAAsB,CAAC,cAAc,EAC/D,UAAU,wCAAV,UAAU,IACN,EAAE,EAAC,CAAC;YAEV,MAAA,kBAAkB,CAAC,MAAM,oCAAzB,kBAAkB,CAAC,MAAM,GAAK;gBAC5B,SAAS;gBACT,GAAG,CAAC,gBAAgB;oBAClB,CAAC,CAAC,CAAC,IAAA,0BAAiB,EAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;oBAC1D,CAAC,CAAC,EAAE,CAAC;aACR,EAAC;SACH;QAED,IAAA,qCAA4B,EAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;QAE3D,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;;CACzB;AAjCD,4BAiCC;AAED,SAAS,gBAAgB,CAAC,IAAU;IAClC,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5C,IAAA,+CAAsB,EAAC,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;QACpE,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IACH,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
1
+ {"version":3,"file":"add-eslint-inputs.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AACtB,iGAA8F;AAC9F,oEAA+E;AAE/E,SAA8B,eAAe,CAAC,IAAU;;;;QACtD,MAAM,sBAAsB,GAAG,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC;QAEhE,MAAM,gBAAgB,GAAG,uCAAyB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAC/D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAClB,CAAC;QAEF,IAAI,gBAAgB,KAAI,MAAA,sBAAsB,CAAC,WAAW,0CAAE,UAAU,CAAA,EAAE;YACtE,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAC/B,sBAAsB,CAAC,WAAW,CAAC,UAAU,CAC9C,CAAC;YAEF,iBAAiB,CAAC,GAAG,CAAC,kBAAkB,gBAAgB,EAAE,CAAC,CAAC;YAE5D,sBAAsB,CAAC,WAAW,CAAC,UAAU;gBAC3C,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;SACjC;QAED,KAAK,MAAM,UAAU,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE;YAC/C,MAAA,sBAAsB,CAAC,cAAc,oCAArC,sBAAsB,CAAC,cAAc,GAAK,EAAE,EAAC;YAE7C,MAAM,kBAAkB,GAAG,aAAC,sBAAsB,CAAC,cAAc,EAC/D,UAAU,wCAAV,UAAU,IACN,EAAE,EAAC,CAAC;YAEV,MAAA,kBAAkB,CAAC,MAAM,oCAAzB,kBAAkB,CAAC,MAAM,GAAK;gBAC5B,SAAS;gBACT,GAAG,CAAC,gBAAgB;oBAClB,CAAC,CAAC,CAAC,IAAA,0BAAiB,EAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;oBAC1D,CAAC,CAAC,EAAE,CAAC;aACR,EAAC;SACH;QAED,IAAA,qCAA4B,EAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;QAE3D,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;;CACzB;AApCD,kCAoCC;AAED,SAAS,gBAAgB,CAAC,IAAU;IAClC,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5C,IAAA,+CAAsB,EAAC,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;QACpE,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;IACH,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
@@ -1 +0,0 @@
1
- export default function (): import("@angular-devkit/schematics").Rule;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const core_1 = require("@angular-devkit/core");
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const workspace_1 = require("@nrwl/workspace");
6
- function updateESLintConfigReferencesInWorkspace() {
7
- return (0, workspace_1.updateBuilderConfig)((options, target, project) => {
8
- if (target.builder === '@nrwl/linter:lint' &&
9
- (options === null || options === void 0 ? void 0 : options.linter) === 'tslint') {
10
- return options;
11
- }
12
- if (target.builder === '@nrwl/linter:eslint') {
13
- if (!options.eslintConfig) {
14
- return options;
15
- }
16
- options.eslintConfig = `${options.eslintConfig}.json`;
17
- return options;
18
- }
19
- if (target.builder === '@nrwl/linter:lint') {
20
- if (!options.config) {
21
- return options;
22
- }
23
- options.config = `${options.config}.json`;
24
- return options;
25
- }
26
- }, '@nrwl/linter:eslint', '@nrwl/linter:lint');
27
- }
28
- function renameESLintConfigFiles() {
29
- return (0, workspace_1.visitNotIgnoredFiles)((file, host, context) => {
30
- if ((0, core_1.basename)(file) !== '.eslintrc') {
31
- return;
32
- }
33
- // Using .eslintrc without an explicit file extension is deprecated
34
- const newFilePath = `${file}.json`;
35
- context.logger.info(`Renaming ${file} to ${newFilePath}`);
36
- try {
37
- return host.rename(file, newFilePath);
38
- }
39
- catch (e) {
40
- context.logger.error(e);
41
- }
42
- });
43
- }
44
- function default_1() {
45
- return (0, schematics_1.chain)([
46
- renameESLintConfigFiles,
47
- updateESLintConfigReferencesInWorkspace,
48
- (0, workspace_1.formatFiles)(),
49
- ]);
50
- }
51
- exports.default = default_1;
52
- //# sourceMappingURL=add-json-ext-to-eslintrc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-json-ext-to-eslintrc.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-10-3-0/add-json-ext-to-eslintrc.ts"],"names":[],"mappings":";;AAAA,+CAAgD;AAChD,2DAAmD;AACnD,+CAIyB;AAEzB,SAAS,uCAAuC;IAC9C,OAAO,IAAA,+BAAmB,EACxB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;QAC3B,IACE,MAAM,CAAC,OAAO,KAAK,mBAAmB;YACtC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,MAAK,QAAQ,EAC5B;YACA,OAAO,OAAO,CAAC;SAChB;QAED,IAAI,MAAM,CAAC,OAAO,KAAK,qBAAqB,EAAE;YAC5C,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;gBACzB,OAAO,OAAO,CAAC;aAChB;YACD,OAAO,CAAC,YAAY,GAAG,GAAG,OAAO,CAAC,YAAY,OAAO,CAAC;YACtD,OAAO,OAAO,CAAC;SAChB;QAED,IAAI,MAAM,CAAC,OAAO,KAAK,mBAAmB,EAAE;YAC1C,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;gBACnB,OAAO,OAAO,CAAC;aAChB;YACD,OAAO,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC;YAC1C,OAAO,OAAO,CAAC;SAChB;IACH,CAAC,EACD,qBAAqB,EACrB,mBAAmB,CACpB,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB;IAC9B,OAAO,IAAA,gCAAoB,EAAC,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;QAClD,IAAI,IAAA,eAAQ,EAAC,IAAI,CAAC,KAAK,WAAW,EAAE;YAClC,OAAO;SACR;QACD,mEAAmE;QACnE,MAAM,WAAW,GAAG,GAAG,IAAI,OAAO,CAAC;QACnC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,IAAI,OAAO,WAAW,EAAE,CAAC,CAAC;QAC1D,IAAI;YACF,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;SACvC;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACzB;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;IACE,OAAO,IAAA,kBAAK,EAAC;QACX,uBAAuB;QACvB,uCAAuC;QACvC,IAAA,uBAAW,GAAE;KACd,CAAC,CAAC;AACL,CAAC;AAND,4BAMC"}
@@ -1 +0,0 @@
1
- export default function (): import("@angular-devkit/schematics").Rule;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schematics_1 = require("@angular-devkit/schematics");
4
- const workspace_1 = require("@nrwl/workspace");
5
- function addRootESLintrcToImplicitDependencies(host) {
6
- return host.exists('nx.json')
7
- ? (0, workspace_1.updateJsonInTree)('nx.json', (json) => {
8
- json.implicitDependencies || (json.implicitDependencies = {});
9
- json.implicitDependencies['.eslintrc.json'] = '*';
10
- return json;
11
- })
12
- : (0, schematics_1.noop)();
13
- }
14
- function default_1() {
15
- return (0, schematics_1.chain)([addRootESLintrcToImplicitDependencies, (0, workspace_1.formatFiles)()]);
16
- }
17
- exports.default = default_1;
18
- //# sourceMappingURL=add-root-eslintrc-json-to-workspace-implicit-deps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-root-eslintrc-json-to-workspace-implicit-deps.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-10-3-0/add-root-eslintrc-json-to-workspace-implicit-deps.ts"],"names":[],"mappings":";;AAAA,2DAA+D;AAC/D,+CAAgE;AAEhE,SAAS,qCAAqC,CAAC,IAAU;IACvD,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;QAC3B,CAAC,CAAC,IAAA,4BAAgB,EAAC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;YACnC,IAAI,CAAC,oBAAoB,KAAzB,IAAI,CAAC,oBAAoB,GAAK,EAAE,EAAC;YACjC,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC;YAClD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;QACJ,CAAC,CAAC,IAAA,iBAAI,GAAE,CAAC;AACb,CAAC;AAED;IACE,OAAO,IAAA,kBAAK,EAAC,CAAC,qCAAqC,EAAE,IAAA,uBAAW,GAAE,CAAC,CAAC,CAAC;AACvE,CAAC;AAFD,4BAEC"}
@@ -1 +0,0 @@
1
- export default function (): import("@angular-devkit/schematics").Rule;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schematics_1 = require("@angular-devkit/schematics");
4
- const workspace_1 = require("@nrwl/workspace");
5
- const path_1 = require("path");
6
- const updatePackages = (0, workspace_1.updatePackagesInPackageJson)((0, path_1.join)(__dirname, '../../..', 'migrations.json'), '10.3.0');
7
- const addLintRule = (host) => {
8
- return host.exists('.eslintrc')
9
- ? (0, workspace_1.updateJsonInTree)('.eslintrc', (json) => {
10
- json.rules || (json.rules = {});
11
- json.rules['@typescript-eslint/explicit-module-boundary-types'] = 'off';
12
- return json;
13
- })
14
- : (0, schematics_1.noop)();
15
- };
16
- function default_1() {
17
- return (0, schematics_1.chain)([updatePackages, addLintRule, (0, workspace_1.formatFiles)()]);
18
- }
19
- exports.default = default_1;
20
- //# sourceMappingURL=update-10-3-0.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-10-3-0.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-10-3-0/update-10-3-0.ts"],"names":[],"mappings":";;AAAA,2DAA+D;AAC/D,+CAIyB;AACzB,+BAA4B;AAE5B,MAAM,cAAc,GAAG,IAAA,uCAA2B,EAChD,IAAA,WAAI,EAAC,SAAS,EAAE,UAAU,EAAE,iBAAiB,CAAC,EAC9C,QAAQ,CACT,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,IAAU,EAAE,EAAE;IACjC,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QAC7B,CAAC,CAAC,IAAA,4BAAgB,EAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE;YACrC,IAAI,CAAC,KAAK,KAAV,IAAI,CAAC,KAAK,GAAK,EAAE,EAAC;YAClB,IAAI,CAAC,KAAK,CAAC,mDAAmD,CAAC,GAAG,KAAK,CAAC;YACxE,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;QACJ,CAAC,CAAC,IAAA,iBAAI,GAAE,CAAC;AACb,CAAC,CAAC;AAEF;IACE,OAAO,IAAA,kBAAK,EAAC,CAAC,cAAc,EAAE,WAAW,EAAE,IAAA,uBAAW,GAAE,CAAC,CAAC,CAAC;AAC7D,CAAC;AAFD,4BAEC"}
@@ -1 +0,0 @@
1
- export default function (): import("@angular-devkit/schematics").Rule;
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schematics_1 = require("@angular-devkit/schematics");
4
- const workspace_1 = require("@nrwl/workspace");
5
- const core_1 = require("@angular-devkit/core");
6
- /**
7
- * When migrating projects we need to look up any relevant tsconfig files
8
- * to figure out what glob patterns will stand the best chance of keeping
9
- * the file includes behavior as consistent as possible, before and after
10
- * the migration.
11
- */
12
- function updateESLintBuilder(host) {
13
- return (0, workspace_1.updateBuilderConfig)((options, target, project) => {
14
- if (options.linter === 'tslint') {
15
- return options;
16
- }
17
- target.builder = '@nrwl/linter:eslint';
18
- const tsconfigs = [];
19
- if (options.tsConfig) {
20
- const normalizedTsConfigOption = Array.isArray(options.tsConfig)
21
- ? options.tsConfig
22
- : [options.tsConfig];
23
- normalizedTsConfigOption.forEach((tsConfigPath) => {
24
- try {
25
- tsconfigs.push((0, workspace_1.readJsonInTree)(host, tsConfigPath));
26
- }
27
- catch (_a) { }
28
- try {
29
- tsconfigs.push((0, workspace_1.readJsonInTree)(host, `${project.root}/tsconfig.json`));
30
- }
31
- catch (_b) { }
32
- });
33
- }
34
- else {
35
- try {
36
- tsconfigs.push((0, workspace_1.readJsonInTree)(host, `${project.root}/tsconfig.json`));
37
- }
38
- catch (_a) { }
39
- try {
40
- tsconfigs.push((0, workspace_1.readJsonInTree)(host, `${project.root}/tsconfig.app.json`));
41
- }
42
- catch (_b) { }
43
- try {
44
- tsconfigs.push((0, workspace_1.readJsonInTree)(host, `${project.root}/tsconfig.lib.json`));
45
- }
46
- catch (_c) { }
47
- try {
48
- tsconfigs.push((0, workspace_1.readJsonInTree)(host, `${project.root}/tsconfig.spec.json`));
49
- }
50
- catch (_d) { }
51
- try {
52
- tsconfigs.push((0, workspace_1.readJsonInTree)(host, `${project.root}/tsconfig.e2e.json`));
53
- }
54
- catch (_e) { }
55
- }
56
- const defaultLintFilePatterns = [`${project.root}/**/*.ts`];
57
- // Merge any available `includes` and `files` from the tsconfig files
58
- let lintFilePatterns = !tsconfigs.length
59
- ? defaultLintFilePatterns
60
- : tsconfigs
61
- .map((tsconfig) => {
62
- return [...(tsconfig.include || []), ...(tsconfig.files || [])];
63
- })
64
- .reduce((flat, val) => flat.concat(val), [])
65
- .map((pattern) => (0, core_1.join)((0, core_1.normalize)(project.root), pattern))
66
- /**
67
- * Exclude any files coming from node_modules, they will be ignored by ESLint
68
- * and it will print a warning about it. We shouldn't be spending time linting
69
- * 3rd party files anyway, and if they are relevant to the TypeScript Program
70
- * for the linting run they will still be included in that.
71
- */
72
- .filter((pattern) => !pattern.includes('node_modules'));
73
- lintFilePatterns = [...new Set(lintFilePatterns)];
74
- return { lintFilePatterns };
75
- }, '@nrwl/linter:lint');
76
- }
77
- function default_1() {
78
- return (0, schematics_1.chain)([updateESLintBuilder, (0, workspace_1.formatFiles)()]);
79
- }
80
- exports.default = default_1;
81
- //# sourceMappingURL=update-eslint-builder-and-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-eslint-builder-and-config.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-10-3-0/update-eslint-builder-and-config.ts"],"names":[],"mappings":";;AAAA,2DAAyD;AACzD,+CAIyB;AACzB,+CAAuD;AAEvD;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,IAAU;IACrC,OAAO,IAAA,+BAAmB,EAAC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;QACtD,IAAI,OAAO,CAAC,MAAM,KAAK,QAAQ,EAAE;YAC/B,OAAO,OAAO,CAAC;SAChB;QACD,MAAM,CAAC,OAAO,GAAG,qBAAqB,CAAC;QAEvC,MAAM,SAAS,GAAG,EAAE,CAAC;QAErB,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,MAAM,wBAAwB,GAAG,KAAK,CAAC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,GAAE;SACX;QAED,MAAM,uBAAuB,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,UAAU,CAAC,CAAC;QAE5D,qEAAqE;QACrE,IAAI,gBAAgB,GAAG,CAAC,SAAS,CAAC,MAAM;YACtC,CAAC,CAAC,uBAAuB;YACzB,CAAC,CAAC,SAAS;iBACN,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;gBAChB,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;YAClE,CAAC,CAAC;iBACD,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;iBAC3C,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,WAAI,EAAC,IAAA,gBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;gBACzD;;;;;mBAKG;iBACF,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;QAE9D,gBAAgB,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAElD,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC9B,CAAC,EAAE,mBAAmB,CAAC,CAAC;AAC1B,CAAC;AAED;IACE,OAAO,IAAA,kBAAK,EAAC,CAAC,mBAAmB,EAAE,IAAA,uBAAW,GAAE,CAAC,CAAC,CAAC;AACrD,CAAC;AAFD,4BAEC"}
@@ -1 +0,0 @@
1
- export default function (): import("@angular-devkit/schematics").Rule;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schematics_1 = require("@angular-devkit/schematics");
4
- const workspace_1 = require("@nrwl/workspace");
5
- /**
6
- * The migration for v10.3.0 called "update-eslint-builder-and-config" initially had a bug
7
- * where it included files from node_modules in the `lintFilePatterns` option if they were
8
- * explicitly included in any of the relevant tsconfig files.
9
- *
10
- * This has now been fixed in the original migration, but this extra migration will handle
11
- * fixing up any setups which migrated in the interim and are currently experiencing lint
12
- * warnings as a result.
13
- */
14
- function updateESLintBuilder() {
15
- return (0, workspace_1.updateBuilderConfig)((options) => {
16
- const lintFilePatterns = options.lintFilePatterns || [];
17
- return Object.assign(Object.assign({}, options), { lintFilePatterns: lintFilePatterns.filter((pattern) => !pattern.includes('node_modules')) });
18
- }, '@nrwl/linter:eslint');
19
- }
20
- function default_1() {
21
- return (0, schematics_1.chain)([updateESLintBuilder, (0, workspace_1.formatFiles)()]);
22
- }
23
- exports.default = default_1;
24
- //# sourceMappingURL=revert-node-modules-files-in-eslint-builder-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"revert-node-modules-files-in-eslint-builder-options.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-10-3-1/revert-node-modules-files-in-eslint-builder-options.ts"],"names":[],"mappings":";;AAAA,2DAAmD;AACnD,+CAAmE;AAEnE;;;;;;;;GAQG;AACH,SAAS,mBAAmB;IAC1B,OAAO,IAAA,+BAAmB,EAAC,CAAC,OAAO,EAAE,EAAE;QACrC,MAAM,gBAAgB,GACnB,OAAO,CAAC,gBAA6B,IAAI,EAAE,CAAC;QAC/C,uCACK,OAAO,KACV,gBAAgB,EAAE,gBAAgB,CAAC,MAAM,CACvC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAC/C,IACD;IACJ,CAAC,EAAE,qBAAqB,CAAC,CAAC;AAC5B,CAAC;AAED;IACE,OAAO,IAAA,kBAAK,EAAC,CAAC,mBAAmB,EAAE,IAAA,uBAAW,GAAE,CAAC,CAAC,CAAC;AACrD,CAAC;AAFD,4BAEC"}
@@ -1,7 +0,0 @@
1
- import type { Linter } from 'eslint';
2
- export default function (): import("@angular-devkit/schematics").Rule;
3
- export declare function updateExtendsAndRemoveDuplication(json: Linter.Config, configBeingExtended: Linter.Config, deleteIfUltimatelyEmpty: boolean, extendsToAdd: string): void;
4
- export declare function updatePluginsAndRemoveDuplication(json: Linter.Config, configBeingExtended: Linter.Config, deleteIfUltimatelyEmpty: boolean, ensurePlugin?: string): void;
5
- export declare function updateParserOptionsAndRemoveDuplication(json: Linter.Config, configBeingExtended: Linter.Config): void;
6
- export declare function updateObjPropAndRemoveDuplication(json: Linter.Config, configBeingExtended: Linter.Config, objPropName: string, deleteIfUltimatelyEmpty: boolean): void;
7
- export declare function updateOverridesAndRemoveDuplication(json: Linter.Config, configBeingExtended: Linter.Config, deleteIfUltimatelyEmpty: boolean): void;
@@ -1,447 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateOverridesAndRemoveDuplication = exports.updateObjPropAndRemoveDuplication = exports.updateParserOptionsAndRemoveDuplication = exports.updatePluginsAndRemoveDuplication = exports.updateExtendsAndRemoveDuplication = void 0;
4
- const core_1 = require("@angular-devkit/core");
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const workspace_1 = require("@nrwl/workspace");
7
- const assert = require("assert");
8
- /**
9
- * We want to update the JSON in such a way that we:
10
- * - extend from our Nx shareable configs where applicable
11
- * - remove as much duplication between the JSON and the underlying
12
- * shareable config as is safely possible
13
- */
14
- function updateRootESLintConfig(host) {
15
- return host.exists('.eslintrc.json')
16
- ? (0, workspace_1.updateJsonInTree)('.eslintrc.json', (json) => {
17
- updateExtendsAndRemoveDuplication(json, currentTypescriptConfig, true, 'plugin:@nrwl/nx/typescript');
18
- /**
19
- * We always want to explicitly include the @nrwl/nx plugin
20
- * because we continue to use the @nrwl/nx/enforce-module-boundaries
21
- * in the first party config and it helps make things clearer
22
- */
23
- updatePluginsAndRemoveDuplication(json, currentTypescriptConfig, true, '@nrwl/nx');
24
- updateParserOptionsAndRemoveDuplication(json, currentTypescriptConfig);
25
- /**
26
- * In the case of the existing Nx root .eslintrc.json out of the box,
27
- * there is a single overrides for .tsx files. This is now covered
28
- * by the shared config, so if the user still has that defined we can
29
- * also remove that safely.
30
- */
31
- updateOverridesAndRemoveDuplication(json, currentTypescriptConfig, true);
32
- updateObjPropAndRemoveDuplication(json, currentTypescriptConfig, 'rules', false);
33
- if (json.parser === currentTypescriptConfig.parser) {
34
- delete json.parser;
35
- }
36
- return json;
37
- })
38
- : (0, schematics_1.noop)();
39
- }
40
- function updateReactESLintConfigs(host) {
41
- const workspace = (0, workspace_1.readWorkspace)(host);
42
- return (0, schematics_1.chain)([
43
- ...Object.keys(workspace.projects).map((k) => {
44
- const p = workspace.projects[k];
45
- const eslintConfigPath = (0, core_1.join)((0, core_1.normalize)(p.root), '.eslintrc.json');
46
- if (!host.exists(eslintConfigPath)) {
47
- return (0, schematics_1.noop)();
48
- }
49
- return (0, workspace_1.updateJsonInTree)(eslintConfigPath, (json) => {
50
- var _a, _b, _c;
51
- /**
52
- * There isn't a way to know for sure if a project was started with the Nx
53
- * original inline React ESLint config (for applications it is easy to know
54
- * from the project configuration, but that is not the case for all libraries).
55
- *
56
- * We therefore try and infer it based on the presence of react eslint plugins
57
- * within the config that is currently there.
58
- */
59
- if (((_a = json.plugins) === null || _a === void 0 ? void 0 : _a.includes('react')) ||
60
- ((_b = json.plugins) === null || _b === void 0 ? void 0 : _b.includes('react-hooks')) ||
61
- ((_c = json.plugins) === null || _c === void 0 ? void 0 : _c.includes('jsx-a11y'))) {
62
- updateExtendsAndRemoveDuplication(json, currentReactConfig, true, 'plugin:@nrwl/nx/react');
63
- updatePluginsAndRemoveDuplication(json, currentReactConfig, true);
64
- updateObjPropAndRemoveDuplication(json, currentReactConfig, 'rules', false);
65
- updateObjPropAndRemoveDuplication(json, currentReactConfig, 'env', true);
66
- updateObjPropAndRemoveDuplication(json, currentReactConfig, 'settings', true);
67
- }
68
- return json;
69
- });
70
- }),
71
- ]);
72
- }
73
- function default_1() {
74
- return (0, schematics_1.chain)([
75
- updateRootESLintConfig,
76
- updateReactESLintConfigs,
77
- (0, workspace_1.formatFiles)(),
78
- ]);
79
- }
80
- exports.default = default_1;
81
- const currentReactConfig = {
82
- rules: {
83
- 'array-callback-return': 'warn',
84
- 'dot-location': ['warn', 'property'],
85
- eqeqeq: ['warn', 'smart'],
86
- 'new-parens': 'warn',
87
- 'no-caller': 'warn',
88
- 'no-cond-assign': ['warn', 'except-parens'],
89
- 'no-const-assign': 'warn',
90
- 'no-control-regex': 'warn',
91
- 'no-delete-var': 'warn',
92
- 'no-dupe-args': 'warn',
93
- 'no-dupe-keys': 'warn',
94
- 'no-duplicate-case': 'warn',
95
- 'no-empty-character-class': 'warn',
96
- 'no-empty-pattern': 'warn',
97
- 'no-eval': 'warn',
98
- 'no-ex-assign': 'warn',
99
- 'no-extend-native': 'warn',
100
- 'no-extra-bind': 'warn',
101
- 'no-extra-label': 'warn',
102
- 'no-fallthrough': 'warn',
103
- 'no-func-assign': 'warn',
104
- 'no-implied-eval': 'warn',
105
- 'no-invalid-regexp': 'warn',
106
- 'no-iterator': 'warn',
107
- 'no-label-var': 'warn',
108
- 'no-labels': ['warn', { allowLoop: true, allowSwitch: false }],
109
- 'no-lone-blocks': 'warn',
110
- 'no-loop-func': 'warn',
111
- 'no-mixed-operators': [
112
- 'warn',
113
- {
114
- groups: [
115
- ['&', '|', '^', '~', '<<', '>>', '>>>'],
116
- ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
117
- ['&&', '||'],
118
- ['in', 'instanceof'],
119
- ],
120
- allowSamePrecedence: false,
121
- },
122
- ],
123
- 'no-multi-str': 'warn',
124
- 'no-native-reassign': 'warn',
125
- 'no-negated-in-lhs': 'warn',
126
- 'no-new-func': 'warn',
127
- 'no-new-object': 'warn',
128
- 'no-new-symbol': 'warn',
129
- 'no-new-wrappers': 'warn',
130
- 'no-obj-calls': 'warn',
131
- 'no-octal': 'warn',
132
- 'no-octal-escape': 'warn',
133
- 'no-redeclare': 'warn',
134
- 'no-regex-spaces': 'warn',
135
- 'no-restricted-syntax': ['warn', 'WithStatement'],
136
- 'no-script-url': 'warn',
137
- 'no-self-assign': 'warn',
138
- 'no-self-compare': 'warn',
139
- 'no-sequences': 'warn',
140
- 'no-shadow-restricted-names': 'warn',
141
- 'no-sparse-arrays': 'warn',
142
- 'no-template-curly-in-string': 'warn',
143
- 'no-this-before-super': 'warn',
144
- 'no-throw-literal': 'warn',
145
- 'no-restricted-globals': [
146
- 'error',
147
- 'addEventListener',
148
- 'blur',
149
- 'close',
150
- 'closed',
151
- 'confirm',
152
- 'defaultStatus',
153
- 'defaultstatus',
154
- 'event',
155
- 'external',
156
- 'find',
157
- 'focus',
158
- 'frameElement',
159
- 'frames',
160
- 'history',
161
- 'innerHeight',
162
- 'innerWidth',
163
- 'length',
164
- 'location',
165
- 'locationbar',
166
- 'menubar',
167
- 'moveBy',
168
- 'moveTo',
169
- 'name',
170
- 'onblur',
171
- 'onerror',
172
- 'onfocus',
173
- 'onload',
174
- 'onresize',
175
- 'onunload',
176
- 'open',
177
- 'opener',
178
- 'opera',
179
- 'outerHeight',
180
- 'outerWidth',
181
- 'pageXOffset',
182
- 'pageYOffset',
183
- 'parent',
184
- 'print',
185
- 'removeEventListener',
186
- 'resizeBy',
187
- 'resizeTo',
188
- 'screen',
189
- 'screenLeft',
190
- 'screenTop',
191
- 'screenX',
192
- 'screenY',
193
- 'scroll',
194
- 'scrollbars',
195
- 'scrollBy',
196
- 'scrollTo',
197
- 'scrollX',
198
- 'scrollY',
199
- 'self',
200
- 'status',
201
- 'statusbar',
202
- 'stop',
203
- 'toolbar',
204
- 'top',
205
- ],
206
- 'no-unexpected-multiline': 'warn',
207
- 'no-unreachable': 'warn',
208
- 'no-unused-expressions': 'off',
209
- 'no-unused-labels': 'warn',
210
- 'no-useless-computed-key': 'warn',
211
- 'no-useless-concat': 'warn',
212
- 'no-useless-escape': 'warn',
213
- 'no-useless-rename': [
214
- 'warn',
215
- {
216
- ignoreDestructuring: false,
217
- ignoreImport: false,
218
- ignoreExport: false,
219
- },
220
- ],
221
- 'no-with': 'warn',
222
- 'no-whitespace-before-property': 'warn',
223
- 'react-hooks/exhaustive-deps': 'warn',
224
- 'require-yield': 'warn',
225
- 'rest-spread-spacing': ['warn', 'never'],
226
- strict: ['warn', 'never'],
227
- 'unicode-bom': ['warn', 'never'],
228
- 'use-isnan': 'warn',
229
- 'valid-typeof': 'warn',
230
- 'no-restricted-properties': [
231
- 'error',
232
- {
233
- object: 'require',
234
- property: 'ensure',
235
- message: 'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
236
- },
237
- {
238
- object: 'System',
239
- property: 'import',
240
- message: 'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
241
- },
242
- ],
243
- 'getter-return': 'warn',
244
- 'import/first': 'error',
245
- 'import/no-amd': 'error',
246
- 'import/no-webpack-loader-syntax': 'error',
247
- 'react/forbid-foreign-prop-types': ['warn', { allowInPropTypes: true }],
248
- 'react/jsx-no-comment-textnodes': 'warn',
249
- 'react/jsx-no-duplicate-props': 'warn',
250
- 'react/jsx-no-target-blank': 'warn',
251
- 'react/jsx-no-undef': 'error',
252
- 'react/jsx-pascal-case': ['warn', { allowAllCaps: true, ignore: [] }],
253
- 'react/jsx-uses-react': 'warn',
254
- 'react/jsx-uses-vars': 'warn',
255
- 'react/no-danger-with-children': 'warn',
256
- 'react/no-direct-mutation-state': 'warn',
257
- 'react/no-is-mounted': 'warn',
258
- 'react/no-typos': 'error',
259
- 'react/react-in-jsx-scope': 'error',
260
- 'react/require-render-return': 'error',
261
- 'react/style-prop-object': 'warn',
262
- 'react/jsx-no-useless-fragment': 'warn',
263
- 'jsx-a11y/accessible-emoji': 'warn',
264
- 'jsx-a11y/alt-text': 'warn',
265
- 'jsx-a11y/anchor-has-content': 'warn',
266
- 'jsx-a11y/anchor-is-valid': [
267
- 'warn',
268
- { aspects: ['noHref', 'invalidHref'] },
269
- ],
270
- 'jsx-a11y/aria-activedescendant-has-tabindex': 'warn',
271
- 'jsx-a11y/aria-props': 'warn',
272
- 'jsx-a11y/aria-proptypes': 'warn',
273
- 'jsx-a11y/aria-role': 'warn',
274
- 'jsx-a11y/aria-unsupported-elements': 'warn',
275
- 'jsx-a11y/heading-has-content': 'warn',
276
- 'jsx-a11y/iframe-has-title': 'warn',
277
- 'jsx-a11y/img-redundant-alt': 'warn',
278
- 'jsx-a11y/no-access-key': 'warn',
279
- 'jsx-a11y/no-distracting-elements': 'warn',
280
- 'jsx-a11y/no-redundant-roles': 'warn',
281
- 'jsx-a11y/role-has-required-aria-props': 'warn',
282
- 'jsx-a11y/role-supports-aria-props': 'warn',
283
- 'jsx-a11y/scope': 'warn',
284
- 'react-hooks/rules-of-hooks': 'error',
285
- 'default-case': 'off',
286
- 'no-dupe-class-members': 'off',
287
- 'no-undef': 'off',
288
- '@typescript-eslint/consistent-type-assertions': 'warn',
289
- 'no-array-constructor': 'off',
290
- '@typescript-eslint/no-array-constructor': 'warn',
291
- '@typescript-eslint/no-namespace': 'error',
292
- 'no-use-before-define': 'off',
293
- '@typescript-eslint/no-use-before-define': [
294
- 'warn',
295
- {
296
- functions: false,
297
- classes: false,
298
- variables: false,
299
- typedefs: false,
300
- },
301
- ],
302
- 'no-unused-vars': 'off',
303
- '@typescript-eslint/no-unused-vars': [
304
- 'warn',
305
- { args: 'none', ignoreRestSiblings: true },
306
- ],
307
- 'no-useless-constructor': 'off',
308
- '@typescript-eslint/no-useless-constructor': 'warn',
309
- '@typescript-eslint/no-unused-expressions': [
310
- 'error',
311
- {
312
- allowShortCircuit: true,
313
- allowTernary: true,
314
- allowTaggedTemplates: true,
315
- },
316
- ],
317
- },
318
- env: {
319
- browser: true,
320
- commonjs: true,
321
- es6: true,
322
- jest: true,
323
- node: true,
324
- },
325
- settings: { react: { version: 'detect' } },
326
- plugins: ['import', 'jsx-a11y', 'react', 'react-hooks'],
327
- };
328
- const currentTypescriptConfig = {
329
- parser: '@typescript-eslint/parser',
330
- parserOptions: {
331
- ecmaVersion: 2020,
332
- sourceType: 'module',
333
- },
334
- plugins: ['@typescript-eslint'],
335
- extends: [
336
- 'eslint:recommended',
337
- 'plugin:@typescript-eslint/eslint-recommended',
338
- 'plugin:@typescript-eslint/recommended',
339
- 'prettier',
340
- 'prettier/@typescript-eslint',
341
- ],
342
- rules: {
343
- '@typescript-eslint/explicit-member-accessibility': 'off',
344
- '@typescript-eslint/explicit-module-boundary-types': 'off',
345
- '@typescript-eslint/explicit-function-return-type': 'off',
346
- '@typescript-eslint/no-parameter-properties': 'off',
347
- },
348
- overrides: [
349
- {
350
- files: ['*.tsx'],
351
- rules: {
352
- '@typescript-eslint/no-unused-vars': 'off',
353
- },
354
- },
355
- ],
356
- };
357
- function ensureStringArray(val) {
358
- if (typeof val === 'string') {
359
- return [val];
360
- }
361
- return val || [];
362
- }
363
- function updateExtendsAndRemoveDuplication(json, configBeingExtended, deleteIfUltimatelyEmpty, extendsToAdd) {
364
- // Extends can be a string or an array, normalize first
365
- json.extends = ensureStringArray(json.extends);
366
- configBeingExtended.extends = ensureStringArray(configBeingExtended.extends);
367
- json.extends.unshift(extendsToAdd);
368
- json.extends = json.extends.filter((extended) => !configBeingExtended.extends.includes(extended));
369
- json.extends = Array.from(new Set(json.extends));
370
- if (deleteIfUltimatelyEmpty && json.extends.length === 0) {
371
- delete json.extends;
372
- }
373
- }
374
- exports.updateExtendsAndRemoveDuplication = updateExtendsAndRemoveDuplication;
375
- function updatePluginsAndRemoveDuplication(json, configBeingExtended, deleteIfUltimatelyEmpty, ensurePlugin) {
376
- json.plugins || (json.plugins = []);
377
- configBeingExtended.plugins || (configBeingExtended.plugins = []);
378
- if (ensurePlugin && !json.plugins.includes(ensurePlugin)) {
379
- json.plugins.unshift(ensurePlugin);
380
- }
381
- json.plugins = json.plugins.filter((extended) => !configBeingExtended.plugins.includes(extended));
382
- json.plugins = Array.from(new Set(json.plugins));
383
- if (deleteIfUltimatelyEmpty && json.plugins.length === 0) {
384
- delete json.plugins;
385
- }
386
- }
387
- exports.updatePluginsAndRemoveDuplication = updatePluginsAndRemoveDuplication;
388
- function updateParserOptionsAndRemoveDuplication(json, configBeingExtended) {
389
- json.parserOptions || (json.parserOptions = {});
390
- configBeingExtended.parserOptions || (configBeingExtended.parserOptions = {});
391
- /**
392
- * If the user is still using the 2018 ecmaVersion that Nx set for them
393
- * previously we can just remove it and let them inherit the new 2020 value.
394
- * If the user has set something else (other than 2018 or 2020), we just leave it.
395
- */
396
- if (Number(json.parserOptions.ecmaVersion) === 2018 ||
397
- Number(json.parserOptions.ecmaVersion) ===
398
- Number(configBeingExtended.parserOptions.ecmaVersion)) {
399
- delete json.parserOptions.ecmaVersion;
400
- }
401
- for (const [parserOptionName, parserOptionVal] of Object.entries(json.parserOptions)) {
402
- if (parserOptionVal === configBeingExtended.parserOptions[parserOptionName]) {
403
- delete json.parserOptions[parserOptionName];
404
- }
405
- }
406
- }
407
- exports.updateParserOptionsAndRemoveDuplication = updateParserOptionsAndRemoveDuplication;
408
- function updateObjPropAndRemoveDuplication(json, configBeingExtended, objPropName, deleteIfUltimatelyEmpty) {
409
- json[objPropName] || (json[objPropName] = {});
410
- configBeingExtended[objPropName] || (configBeingExtended[objPropName] = {});
411
- for (const [name, val] of Object.entries(json[objPropName])) {
412
- const valueOfSamePropInExtendedConfig = configBeingExtended[objPropName][name];
413
- try {
414
- assert.deepStrictEqual(val, valueOfSamePropInExtendedConfig);
415
- delete json[objPropName][name];
416
- }
417
- catch (_a) { }
418
- }
419
- if (deleteIfUltimatelyEmpty && Object.keys(json[objPropName]).length === 0) {
420
- delete json[objPropName];
421
- }
422
- }
423
- exports.updateObjPropAndRemoveDuplication = updateObjPropAndRemoveDuplication;
424
- function updateOverridesAndRemoveDuplication(json, configBeingExtended, deleteIfUltimatelyEmpty) {
425
- if (!Array.isArray(json.overrides) || !json.overrides.length) {
426
- return;
427
- }
428
- if (!Array.isArray(configBeingExtended.overrides) ||
429
- !configBeingExtended.overrides.length) {
430
- return;
431
- }
432
- json.overrides = json.overrides.filter((o) => {
433
- for (const extendedOverride of configBeingExtended.overrides) {
434
- try {
435
- assert.deepStrictEqual(o, extendedOverride);
436
- return false;
437
- }
438
- catch (_a) { }
439
- }
440
- return false;
441
- });
442
- if (deleteIfUltimatelyEmpty && json.overrides.length === 0) {
443
- delete json.overrides;
444
- }
445
- }
446
- exports.updateOverridesAndRemoveDuplication = updateOverridesAndRemoveDuplication;
447
- //# sourceMappingURL=update-eslint-configs-to-use-nx-presets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-eslint-configs-to-use-nx-presets.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-10-4-0/update-eslint-configs-to-use-nx-presets.ts"],"names":[],"mappings":";;;AAAA,+CAAuD;AACvD,2DAA+D;AAC/D,+CAA+E;AAC/E,iCAAiC;AAGjC;;;;;GAKG;AACH,SAAS,sBAAsB,CAAC,IAAU;IACxC,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;QAClC,CAAC,CAAC,IAAA,4BAAgB,EAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,EAAE;YAC1C,iCAAiC,CAC/B,IAAI,EACJ,uBAAuB,EACvB,IAAI,EACJ,4BAA4B,CAC7B,CAAC;YAEF;;;;eAIG;YACH,iCAAiC,CAC/B,IAAI,EACJ,uBAAuB,EACvB,IAAI,EACJ,UAAU,CACX,CAAC;YAEF,uCAAuC,CAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC;YAEvE;;;;;eAKG;YACH,mCAAmC,CACjC,IAAI,EACJ,uBAAuB,EACvB,IAAI,CACL,CAAC;YAEF,iCAAiC,CAC/B,IAAI,EACJ,uBAAuB,EACvB,OAAO,EACP,KAAK,CACN,CAAC;YAEF,IAAI,IAAI,CAAC,MAAM,KAAK,uBAAuB,CAAC,MAAM,EAAE;gBAClD,OAAO,IAAI,CAAC,MAAM,CAAC;aACpB;YAED,OA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C,SAAS,CAAC,MAAM,EACrC;QACA,OAAO;KACR;IACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QAC3C,KAAK,MAAM,gBAAgB,IAAI,mBAAmB,CAAC,SAAS,EAAE;YAC5D,IAAI;gBACF,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC;gBAC5C,OAAO,KAAK,CAAC;aACd;YAAC,WAAM,GAAE;SACX;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC,CAAC;IACH,IAAI,uBAAuB,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1D,OAAO,IAAI,CAAC,SAAS,CAAC;KACvB;AACH,CAAC;AA1BD,kFA0BC"}
@@ -1 +0,0 @@
1
- export default function (): import("@angular-devkit/schematics").Rule;
@@ -1,107 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schematics_1 = require("@angular-devkit/schematics");
4
- const workspace_1 = require("@nrwl/workspace");
5
- /**
6
- * We want to update the JSON in such a way that we:
7
- * - translate the config to use overrides
8
- * - don't break existing setups
9
- *
10
- * In order to achieve the second point we need to assume
11
- * that any existing top level rules/plugins etc are intended
12
- * to be run on all source files.
13
- */
14
- function updateRootESLintConfig(host) {
15
- return host.exists('.eslintrc.json')
16
- ? (0, workspace_1.updateJsonInTree)('.eslintrc.json', (json) => {
17
- /**
18
- * If the user already has overrides specified it is likely they have "forged their own path"
19
- * when it comes to their ESLint setup, so we do nothing.
20
- */
21
- if (Array.isArray(json.overrides)) {
22
- return json;
23
- }
24
- let normalizedExtends = undefined;
25
- if (json.extends) {
26
- if (typeof json.extends === 'string') {
27
- normalizedExtends = [json.extends];
28
- }
29
- else if (Array.isArray(json.extends)) {
30
- normalizedExtends = json.extends;
31
- }
32
- }
33
- json.overrides = [
34
- /**
35
- * This configuration is intended to apply to all "source code" (but not
36
- * markup like HTML, or other custom file types like GraphQL).
37
- *
38
- * This is where we will apply any top-level config that the user currently
39
- * has to ensure that it behaves the same before and after the migration.
40
- */
41
- {
42
- files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
43
- extends: undefinedIfEmptyArr(normalizedExtends
44
- ? normalizedExtends.filter((e) => e !== 'plugin:@nrwl/nx/typescript')
45
- : normalizedExtends),
46
- env: json.env,
47
- settings: json.settings,
48
- parser: json.parser,
49
- parserOptions: json.parserOptions,
50
- plugins: undefinedIfEmptyArr(json.plugins.filter((p) => p !== '@nrwl/nx') // remains at top-level, used everywhere
51
- ),
52
- rules: json.rules || {},
53
- },
54
- /**
55
- * This configuration is intended to apply to all TypeScript source files.
56
- * See the eslint-plugin-nx package for what is in the referenced shareable config.
57
- */
58
- {
59
- files: ['*.ts', '*.tsx'],
60
- extends: ['plugin:@nrwl/nx/typescript'],
61
- parserOptions: { project: './tsconfig.*?.json' },
62
- /**
63
- * Having an empty rules object present makes it more obvious to the user where they would
64
- * extend things from if they needed to
65
- */
66
- rules: {},
67
- },
68
- /**
69
- * This configuration is intended to apply to all JavaScript source files.
70
- * See the eslint-plugin-nx package for what is in the referenced shareable config.
71
- */
72
- {
73
- files: ['*.js', '*.jsx'],
74
- extends: ['plugin:@nrwl/nx/javascript'],
75
- /**
76
- * Having an empty rules object present makes it more obvious to the user where they would
77
- * extend things from if they needed to
78
- */
79
- rules: {},
80
- },
81
- ];
82
- /**
83
- * Clean up after copying config to main override
84
- */
85
- json.plugins = ['@nrwl/nx'];
86
- delete json.rules;
87
- delete json.extends;
88
- delete json.env;
89
- delete json.settings;
90
- delete json.globals;
91
- delete json.parser;
92
- delete json.parserOptions;
93
- return json;
94
- })
95
- : (0, schematics_1.noop)();
96
- }
97
- function undefinedIfEmptyArr(possibleArr) {
98
- if (Array.isArray(possibleArr) && possibleArr.length === 0) {
99
- return undefined;
100
- }
101
- return possibleArr;
102
- }
103
- function default_1() {
104
- return (0, schematics_1.chain)([updateRootESLintConfig, (0, workspace_1.formatFiles)()]);
105
- }
106
- exports.default = default_1;
107
- //# sourceMappingURL=update-root-eslint-config-to-use-overrides.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-root-eslint-config-to-use-overrides.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-10-4-0/update-root-eslint-config-to-use-overrides.ts"],"names":[],"mappings":";;AAAA,2DAA+D;AAC/D,+CAAgE;AAGhE;;;;;;;;GAQG;AACH,SAAS,sBAAsB,CAAC,IAAU;IACxC,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;QAClC,CAAC,CAAC,IAAA,4BAAgB,EAAC,gBAAgB,EAAE,CAAC,IAAmB,EAAE,EAAE;YACzD;;;eAGG;YACH,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;gBACjC,OAAO,IAAI,CAAC;aACb;YAED,IAAI,iBAAiB,GAAyB,SAAS,CAAC;YACxD,IAAI,IAAI,CAAC,OAAO,EAAE;gBAChB,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE;oBACpC,iBAAiB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBACpC;qBAAM,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;oBACtC,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC;iBAClC;aACF;YAED,IAAI,CAAC,SAAS,GAAG;gBACf;;;;;;mBAMG;gBACH;oBACE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;oBACzC,OAAO,EAAE,mBAAmB,CAC1B,iBAAiB;wBACf,CAAC,CAAC,iBAAiB,CAAC,MAAM,CACtB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,4BAA4B,CAC1C;wBACH,CAAC,CAAC,iBAAiB,CACtB;oBACD,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,QAAQ,EA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S,CAAC;KAClB;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;IACE,OAAO,IAAA,kBAAK,EAAC,CAAC,sBAAsB,EAAE,IAAA,uBAAW,GAAE,CAAC,CAAC,CAAC;AACxD,CAAC;AAFD,4BAEC"}
@@ -1,3 +0,0 @@
1
- import type { Tree } from '@nrwl/devkit';
2
- export declare function updateTsConfigsWithEslint(host: Tree): Promise<void>;
3
- export default updateTsConfigsWithEslint;
@@ -1,95 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateTsConfigsWithEslint = void 0;
4
- const tslib_1 = require("tslib");
5
- const devkit_1 = require("@nrwl/devkit");
6
- const path_1 = require("path");
7
- function updateRootESLintConfig(host) {
8
- if (!host.exists('.eslintrc.json')) {
9
- return;
10
- }
11
- (0, devkit_1.updateJson)(host, '.eslintrc.json', (json) => {
12
- /**
13
- * If the user is still using OOTB Nx config, then they will have a "project"
14
- * parserOption set for TS files in their root config.
15
- *
16
- * We remove this to both be consistent with new workspace generation, and
17
- * to ensure they receive an explicit error if they miss off project level
18
- * configuration (instead of there being a silent, much slower fallback).
19
- */
20
- if (json.overrides) {
21
- json.overrides = json.overrides.map((o) => {
22
- if (o.parserOptions && o.parserOptions.project) {
23
- delete o.parserOptions.project;
24
- // If the parserOptions object is now empty as a result, delete it too
25
- if (Object.keys(o.parserOptions).length === 0) {
26
- delete o.parserOptions;
27
- }
28
- }
29
- return o;
30
- });
31
- }
32
- return json;
33
- });
34
- }
35
- function updateProjectESLintConfigs(host) {
36
- const projects = (0, devkit_1.getProjects)(host);
37
- projects.forEach((p) => {
38
- var _a, _b;
39
- const eslintConfigPath = (0, path_1.join)(p.root, '.eslintrc.json');
40
- if (!host.exists(eslintConfigPath)) {
41
- return;
42
- }
43
- const isNextJs = ((_b = (_a = p.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/next:build';
44
- const parserOptionsProjectVal = isNextJs
45
- ? [`${p.root}/tsconfig(.*)?.json`]
46
- : [`${p.root}/tsconfig.*?.json`];
47
- return (0, devkit_1.updateJson)(host, eslintConfigPath, (json) => {
48
- if (!json.overrides) {
49
- json.overrides = [
50
- {
51
- files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
52
- parserOptions: {
53
- project: parserOptionsProjectVal,
54
- },
55
- /**
56
- * Having an empty rules object present makes it more obvious to the user where they would
57
- * extend things from if they needed to
58
- */
59
- rules: {},
60
- },
61
- {
62
- files: ['*.ts', '*.tsx'],
63
- rules: {},
64
- },
65
- {
66
- files: ['*.js', '*.jsx'],
67
- rules: {},
68
- },
69
- ];
70
- }
71
- else {
72
- if (!json.overrides.some((o) => o.parserOptions && o.parserOptions.project)) {
73
- json.overrides.unshift({
74
- files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
75
- parserOptions: {
76
- project: parserOptionsProjectVal,
77
- },
78
- rules: {},
79
- });
80
- }
81
- }
82
- return json;
83
- });
84
- });
85
- }
86
- function updateTsConfigsWithEslint(host) {
87
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
88
- updateRootESLintConfig(host);
89
- updateProjectESLintConfigs(host);
90
- yield (0, devkit_1.formatFiles)(host);
91
- });
92
- }
93
- exports.updateTsConfigsWithEslint = updateTsConfigsWithEslint;
94
- exports.default = updateTsConfigsWithEslint;
95
- //# sourceMappingURL=always-use-project-level-tsconfigs-with-eslint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"always-use-project-level-tsconfigs-with-eslint.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/migrations/update-11-5-0/always-use-project-level-tsconfigs-with-eslint.ts"],"names":[],"mappings":";;;;AAAA,yCAAoE;AAGpE,+BAA4B;AAE5B,SAAS,sBAAsB,CAAC,IAAU;IACxC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE;QAClC,OAAO;KACR;IACD,IAAA,mBAAU,EAAC,IAAI,EAAE,gBAAgB,EAAE,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