@nrwl/linter 15.3.0-beta.2 → 15.3.0-beta.4

Sign up to get free protection for your applications and to get access to all the features.
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.3.0-beta.2](https://github.com/nrwl/nx/compare/15.2.0...15.3.0-beta.2) (2022-11-25)
6
+ # [15.3.0-beta.4](https://github.com/nrwl/nx/compare/15.2.0...15.3.0-beta.4) (2022-11-28)
7
7
 
8
8
  **Note:** Version bump only for package @nrwl/linter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrwl/linter",
3
- "version": "15.3.0-beta.2",
3
+ "version": "15.3.0-beta.4",
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": {
@@ -30,14 +30,13 @@
30
30
  "builders": "./executors.json",
31
31
  "schematics": "./generators.json",
32
32
  "peerDependencies": {
33
- "eslint": "^8.0.0",
34
- "js-yaml": "4.1.0"
33
+ "eslint": "^8.0.0"
35
34
  },
36
35
  "dependencies": {
37
- "@nrwl/devkit": "15.3.0-beta.2",
38
- "@nrwl/jest": "15.3.0-beta.2",
36
+ "@nrwl/devkit": "15.3.0-beta.4",
37
+ "@nrwl/jest": "15.3.0-beta.4",
39
38
  "@phenomnomnominal/tsquery": "4.1.1",
40
- "nx": "15.3.0-beta.2",
39
+ "nx": "15.3.0-beta.4",
41
40
  "tmp": "~0.2.1",
42
41
  "tslib": "^2.3.0"
43
42
  },
@@ -50,5 +49,5 @@
50
49
  "access": "public"
51
50
  },
52
51
  "types": "./index.d.ts",
53
- "gitHead": "70fa4b9e4127a5f17c084b7f0620dbf65ffd0499"
52
+ "gitHead": "1c70ac9571f64ecfd74d80546ad2b3e17c15866b"
54
53
  }
@@ -5,24 +5,8 @@ const devkit_1 = require("@nrwl/devkit");
5
5
  const path_1 = require("path");
6
6
  const eslint_file_1 = require("../utils/eslint-file");
7
7
  const global_eslint_config_1 = require("./global-eslint-config");
8
- const FILE_EXTENSION_REGEX = /(?<!(^|\/))(\.[^/.]+)$/;
9
8
  function migrateConfigToMonorepoStyle(projects, tree, unitTestRunner) {
10
- var _a, _b, _c;
11
- // copy the root's .eslintrc.json to new name
12
- const rootProject = projects.find((p) => p.root === '.');
13
- const eslintPath = ((_c = (_b = (_a = rootProject.targets) === null || _a === void 0 ? void 0 : _a.lint) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.eslintConfig) || (0, eslint_file_1.findEslintFile)(tree);
14
- const pathSegments = eslintPath.split(FILE_EXTENSION_REGEX).filter(Boolean);
15
- const rootProjEslintPath = pathSegments.length > 1
16
- ? pathSegments.join(`.${rootProject.name}`)
17
- : `.${rootProject.name}.${rootProject.name}`;
18
- tree.write(rootProjEslintPath, tree.read(eslintPath));
19
- // update root project's configuration
20
- const lintTarget = findLintTarget(rootProject);
21
- lintTarget.options.eslintConfig = rootProjEslintPath;
22
- (0, devkit_1.updateProjectConfiguration)(tree, rootProject.name, rootProject);
23
- // replace root eslint with default global
24
- tree.delete(eslintPath);
25
- (0, devkit_1.writeJson)(tree, '.eslintrc.json', (0, global_eslint_config_1.getGlobalEsLintConfiguration)(unitTestRunner));
9
+ (0, devkit_1.writeJson)(tree, '.eslintrc.base.json', (0, global_eslint_config_1.getGlobalEsLintConfiguration)(unitTestRunner));
26
10
  // update extens in all projects' eslint configs
27
11
  projects.forEach((project) => {
28
12
  const lintTarget = findLintTarget(project);
@@ -53,7 +37,7 @@ function migrateEslintFile(projectEslintPath, tree) {
53
37
  }
54
38
  // add extends
55
39
  json.extends = json.extends || [];
56
- const pathToRootConfig = `${(0, devkit_1.offsetFromRoot)((0, path_1.dirname)(projectEslintPath))}.eslintrc.json`;
40
+ const pathToRootConfig = `${(0, devkit_1.offsetFromRoot)((0, path_1.dirname)(projectEslintPath))}.eslintrc.base.json`;
57
41
  if (json.extends.indexOf(pathToRootConfig) === -1) {
58
42
  json.extends.push(pathToRootConfig);
59
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"init-migration.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/init/init-migration.ts"],"names":[],"mappings":";;;AAAA,yCASsB;AACtB,+BAAyC;AACzC,sDAAsD;AACtD,iEAAsE;AAEtE,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAEtD,SAAgB,4BAA4B,CAC1C,QAAgC,EAChC,IAAU,EACV,cAAsB;;IAEtB,6CAA6C;IAC7C,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;IACzD,MAAM,UAAU,GACd,CAAA,MAAA,MAAA,MAAA,WAAW,CAAC,OAAO,0CAAE,IAAI,0CAAE,OAAO,0CAAE,YAAY,KAAI,IAAA,4BAAc,EAAC,IAAI,CAAC,CAAC;IAC3E,MAAM,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5E,MAAM,kBAAkB,GACtB,YAAY,CAAC,MAAM,GAAG,CAAC;QACrB,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC;QAC3C,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC;IACjD,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAEtD,sCAAsC;IACtC,MAAM,UAAU,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IAC/C,UAAU,CAAC,OAAO,CAAC,YAAY,GAAG,kBAAkB,CAAC;IACrD,IAAA,mCAA0B,EAAC,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,WAAW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AAC;KACvE;IACD,IAAI,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAC3E,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;KACvE;AACH,CAAC"}
1
+ {"version":3,"file":"init-migration.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/init/init-migration.ts"],"names":[],"mappings":";;;AAAA,yCAQsB;AACtB,+BAA+B;AAC/B,sDAAsD;AACtD,iEAAsE;AAEtE,SAAgB,4BAA4B,CAC1C,QAAgC,EAChC,IAAU,EACV,cAAsB;IAEtB,IAAA,kBAAS,EACP,IAAI,EACJ,qBAAqB,EACrB,IAAA,mDAA4B,EAAC,cAAc,CAAC,CAC7C,CAAC;IAEF,gDAAgD;IAChD,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3B,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,UAAU,EAAE;YACd,MAAM,iBAAiB,GAAG,IAAA,0BAAiB,EACzC,OAAO,CAAC,IAAI,EACZ,UAAU,CAAC,OAAO,CAAC,YAAY,IAAI,IAAA,4BAAc,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CACtE,CAAC;YACF,iBAAiB,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;SAC5C;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAtBD,oEAsBC;AAED,SAAgB,cAAc,CAC5B,OAA6B;;IAE7B,OAAO,MAAA,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CACzC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CACjB,IAAI,KAAK,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,qBAAqB,CAC/D,0CAAG,CAAC,CAAC,CAAC;AACT,CAAC;AAPD,wCAOC;AAED,SAAS,iBAAiB,C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AAC,MAAM,KAAK,CAAC,EAAE;4BACjC,OAAO,QAAQ,CAAC,OAAO,CAAC;yBACzB;qBACF;gBACH,CAAC,CAAC,CAAC;aACJ;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QACH,OAAO;KACR;IACD,IACE,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC;QAClC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,EACnC;QACA,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;KACvE;IACD,IAAI,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAC3E,OAAO,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;KACvE;AACH,CAAC"}
@@ -113,6 +113,10 @@ exports.lintProjectGenerator = lintProjectGenerator;
113
113
  * @returns
114
114
  */
115
115
  function isMigrationToMonorepoNeeded(projects, tree) {
116
+ // the base config is already created, migration has been done
117
+ if (tree.exists('.eslintrc.base.json')) {
118
+ return false;
119
+ }
116
120
  const configs = Object.values(projects);
117
121
  if (configs.length === 1) {
118
122
  return false;
@@ -127,13 +131,6 @@ function isMigrationToMonorepoNeeded(projects, tree) {
127
131
  if (!lintTarget) {
128
132
  return false;
129
133
  }
130
- // if there is no override for `eslintConfig` we should migrate
131
- if (!lintTarget.options.eslintConfig) {
132
- return true;
133
- }
134
- // check if target has `eslintConfig` override and if it's not pointing to the source .eslintrc
135
- const rootEslintrc = (0, eslint_file_1.findEslintFile)(tree);
136
- return (lintTarget.options.eslintConfig === rootEslintrc ||
137
- lintTarget.options.eslintConfig === `./${rootEslintrc}`);
134
+ return true;
138
135
  }
139
136
  //# sourceMappingURL=lint-project.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lint-project.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/lint-project/lint-project.ts"],"names":[],"mappings":";;;;AACA,yCAMsB;AAGtB,sDAAsD;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,CAAC"}
1
+ {"version":3,"file":"lint-project.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/lint-project/lint-project.ts"],"names":[],"mappings":";;;;AACA,yCAMsB;AAGtB,sDAAsD;AACtD,+BAA4B;AAC5B,uCAAiD;AACjD,2DAGgC;AAChC,yFAA8E;AAc9E,SAAS,yBAAyB,CAChC,IAAU,EACV,aAAmC,EACnC,uBAAgC;IAEhC,MAAM,YAAY,GAAG,IAAA,4BAAc,EAAC,IAAI,CAAC,CAAC;IAC1C,IAAA,kBAAS,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,aAAa,CAAC,IAAI,EAAE,gBAAgB,CAAC,EAAE;QAC1D,OAAO,EAAE,YAAY;YACnB,CAAC,CAAC,CAAC,GAAG,IAAA,uBAAc,EAAC,aAAa,CAAC,IAAI,CAAC,GAAG,YAAY,EAAE,CAAC;YAC1D,CAAC,CAAC,SAAS;QACb,8EAA8E;QAC9E,cAAc,EAAE,CAAC,OAAO,CAAC;QACzB,SAAS,EAAE;YACT;gBACE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;gBACzC;;;;;;;;;;;;mBAYG;gBACH,aAAa,EAAE,CAAC,uBAAuB;oBACrC,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC;wBACE,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC,IAAI,mBAAmB,CAAC;qBACpD;gBACL;;;mBAGG;gBACH,KAAK,EAAE,EAAE;aACV;YACD;gBACE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;gBACxB,KAAK,EAAE,EAAE;aACV;YACD;gBACE,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;gBACxB,KAAK,EAAE,EAAE;aACV;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,cAAc,CAC5B,WAAmB,EACnB,SAAiB,EACjB,WAAqB;IAErB,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAA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wl/devkit';
2
2
  export declare const eslintConfigFileWhitelist: string[];
3
+ export declare const baseEsLintConfigFile = ".eslintrc.base.json";
3
4
  export declare function findEslintFile(tree: Tree, projectRoot?: string): string | null;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findEslintFile = exports.eslintConfigFileWhitelist = void 0;
3
+ exports.findEslintFile = exports.baseEsLintConfigFile = exports.eslintConfigFileWhitelist = void 0;
4
4
  const devkit_1 = require("@nrwl/devkit");
5
5
  exports.eslintConfigFileWhitelist = [
6
6
  '.eslintrc',
@@ -11,7 +11,11 @@ exports.eslintConfigFileWhitelist = [
11
11
  '.eslintrc.json',
12
12
  'eslint.config.js', // new format that requires `ESLINT_USE_FLAT_CONFIG=true`
13
13
  ];
14
+ exports.baseEsLintConfigFile = '.eslintrc.base.json';
14
15
  function findEslintFile(tree, projectRoot = '') {
16
+ if (projectRoot === '' && tree.exists(exports.baseEsLintConfigFile)) {
17
+ return exports.baseEsLintConfigFile;
18
+ }
15
19
  for (const file of exports.eslintConfigFileWhitelist) {
16
20
  if (tree.exists((0, devkit_1.joinPathFragments)(projectRoot, file))) {
17
21
  return file;
@@ -1 +1 @@
1
- {"version":3,"file":"eslint-file.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/utils/eslint-file.ts"],"names":[],"mappings":";;;AAAA,yCAAuD;AAE1C,QAAA,yBAAyB,GAAG;IACvC,WAAW;IACX,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,eAAe;IACf,gBAAgB;IAChB,kBAAkB,EAAE,yDAAyD;CAC9E,CAAC;AAEF,SAAgB,cAAc,CAAC,IAAU,EAAE,WAAW,GAAG,EAAE;IACzD,KAAK,MAAM,IAAI,IAAI,iCAAyB,EAAE;QAC5C,IAAI,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,WAAW,EAAE,IAAI,CAAC,CAAC,EAAE;YACrD,OAAO,IAAI,CAAC;SACb;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AARD,wCAQC"}
1
+ {"version":3,"file":"eslint-file.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/utils/eslint-file.ts"],"names":[],"mappings":";;;AAAA,yCAAuD;AAE1C,QAAA,yBAAyB,GAAG;IACvC,WAAW;IACX,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,eAAe;IACf,gBAAgB;IAChB,kBAAkB,EAAE,yDAAyD;CAC9E,CAAC;AAEW,QAAA,oBAAoB,GAAG,qBAAqB,CAAC;AAE1D,SAAgB,cAAc,CAAC,IAAU,EAAE,WAAW,GAAG,EAAE;IACzD,IAAI,WAAW,KAAK,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,4BAAoB,CAAC,EAAE;QAC3D,OAAO,4BAAoB,CAAC;KAC7B;IACD,KAAK,MAAM,IAAI,IAAI,iCAAyB,EAAE;QAC5C,IAAI,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,WAAW,EAAE,IAAI,CAAC,CAAC,EAAE;YACrD,OAAO,IAAI,CAAC;SACb;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAXD,wCAWC"}