@nrwl/linter 14.7.0-beta.0 → 14.7.0-beta.3

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
- # [14.7.0-beta.0](https://github.com/nrwl/nx/compare/14.6.3...14.7.0-beta.0) (2022-09-06)
6
+ # [14.7.0-beta.3](https://github.com/nrwl/nx/compare/14.6.3...14.7.0-beta.3) (2022-09-09)
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": "14.7.0-beta.0",
3
+ "version": "14.7.0-beta.3",
4
4
  "description": "The Linter plugin contains executors, generator, plugin and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,10 +33,10 @@
33
33
  "eslint": "^8.0.0"
34
34
  },
35
35
  "dependencies": {
36
- "@nrwl/devkit": "14.7.0-beta.0",
37
- "@nrwl/jest": "14.7.0-beta.0",
36
+ "@nrwl/devkit": "14.7.0-beta.3",
37
+ "@nrwl/jest": "14.7.0-beta.3",
38
38
  "@phenomnomnominal/tsquery": "4.1.1",
39
- "nx": "14.7.0-beta.0",
39
+ "nx": "14.7.0-beta.3",
40
40
  "tmp": "~0.2.1",
41
41
  "tslib": "^2.3.0"
42
42
  },
@@ -45,5 +45,5 @@
45
45
  "optional": true
46
46
  }
47
47
  },
48
- "gitHead": "8c78beaa74c0c0c4d1c7a3512b6e9e18843bbd5a"
48
+ "gitHead": "6d0c6a83d42145984bafc9dd904c6885eaa53865"
49
49
  }
@@ -150,14 +150,34 @@ function initTsLint(tree, options) {
150
150
  })
151
151
  : () => { };
152
152
  }
153
+ function addTargetDefaults(tree) {
154
+ var _a, _b, _c, _d;
155
+ var _e, _f;
156
+ const workspaceConfiguration = (0, devkit_1.readWorkspaceConfiguration)(tree);
157
+ const productionFileSet = (_a = workspaceConfiguration.namedInputs) === null || _a === void 0 ? void 0 : _a.production;
158
+ if (productionFileSet) {
159
+ // Remove .eslintrc.json
160
+ productionFileSet.push('!{projectRoot}/.eslintrc.json');
161
+ // Dedupe and set
162
+ workspaceConfiguration.namedInputs.production = Array.from(new Set(productionFileSet));
163
+ }
164
+ (_b = workspaceConfiguration.targetDefaults) !== null && _b !== void 0 ? _b : (workspaceConfiguration.targetDefaults = {});
165
+ (_c = (_e = workspaceConfiguration.targetDefaults).lint) !== null && _c !== void 0 ? _c : (_e.lint = {});
166
+ (_d = (_f = workspaceConfiguration.targetDefaults.lint).inputs) !== null && _d !== void 0 ? _d : (_f.inputs = [
167
+ 'default',
168
+ `{workspaceRoot}/.eslintrc.json`,
169
+ ]);
170
+ (0, devkit_1.updateWorkspaceConfiguration)(tree, workspaceConfiguration);
171
+ }
153
172
  function initEsLint(tree, options) {
154
- if ((0, eslint_file_1.containsEslint)(tree)) {
173
+ if ((0, eslint_file_1.findEslintFile)(tree)) {
155
174
  return () => { };
156
175
  }
157
176
  if (!options.skipPackageJson) {
158
177
  (0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@nrwl/linter'], []);
159
178
  }
160
179
  (0, devkit_1.writeJson)(tree, '.eslintrc.json', getGlobalEsLintConfiguration(options.unitTestRunner));
180
+ addTargetDefaults(tree);
161
181
  if (tree.exists('.vscode/extensions.json')) {
162
182
  (0, devkit_1.updateJson)(tree, '.vscode/extensions.json', (json) => {
163
183
  json.recommendations || (json.recommendations = []);
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/init/init.ts"],"names":[],"mappings":";;;AACA,yCAKsB;AACtB,mDAO8B;AAE9B,4CAAyC;AACzC,sDAAsD;AAStD,MAAM,yBAAyB,GAAG;IAChC,cAAc,EAAE,CAAC,yCAAyC,CAAC;IAC3D,aAAa,EAAE;QACb,OAAO,EAAE,CAAC,MAAM,C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AC,CAAC;aACtC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,CAAC,OAAO,CAAC,eAAe;QAC7B,CAAC,CAAC,IAAA,qCAA4B,EAC1B,IAAI,EACJ,EAAE,EACF;YACE,cAAc,EAAE,oBAAS;YACzB,wBAAwB,EAAE,oBAAS;YACnC,2BAA2B,EAAE,kCAAuB;YACpD,kCAAkC,EAAE,kCAAuB;YAC3D,MAAM,EAAE,wBAAa;YACrB,wBAAwB,EAAE,sCAA2B;SACtD,CACF;QACH,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC;AACf,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAAU,EAAE,OAA0B;IACtE,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,KAAK,eAAM,CAAC,MAAM,EAAE;QACvD,OAAO,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KAClC;SAAM,IAAI,OAAO,CAAC,MAAM,KAAK,eAAM,CAAC,MAAM,EAAE;QAC3C,OAAO,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KAClC;AACH,CAAC;AAND,8CAMC"}
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/init/init.ts"],"names":[],"mappings":";;;AACA,yCAOsB;AACtB,mDAO8B;AAE9B,4CAAyC;AACzC,sDAAsD;AAStD,MAAM,yBAAyB,GAAG;IAChC,cAAc,EAAE,CAAC,yCAAyC,CAAC;IAC3D,aAAa,EAAE;QACb,OAAO,EAAE,CAAC,MAAM,CAAC;KAClB;IACD,KAAK,EAAE;QACL,wBAAwB,EAAE,IAAI;QAC9B,gBAAgB,EAAE,IAAI;QACtB,YAAY,EAAE,IAAI;QAClB,WAAW,EAAE;YACX,QAAQ,EAAE,MAAM;SACjB;QACD,KAAK,EAAE,IAAI;QACX,kBAAkB,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC;QACrC,6BA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E,OAAO,CAAC,CAAC;KAClC;AACH,CAAC;AAND,8CAMC"}
@@ -18,8 +18,11 @@ function createTsLintConfiguration(tree, projectConfig) {
18
18
  });
19
19
  }
20
20
  function createEsLintConfiguration(tree, projectConfig, setParserOptionsProject) {
21
+ const eslintConfig = (0, eslint_file_1.findEslintFile)(tree);
21
22
  (0, devkit_1.writeJson)(tree, (0, path_1.join)(projectConfig.root, `.eslintrc.json`), {
22
- extends: [`${(0, devkit_1.offsetFromRoot)(projectConfig.root)}${(0, eslint_file_1.findEslintFile)(tree)}`],
23
+ extends: eslintConfig
24
+ ? [`${(0, devkit_1.offsetFromRoot)(projectConfig.root)}${eslintConfig}`]
25
+ : undefined,
23
26
  // Include project files to be linted since the global one excludes all files.
24
27
  ignorePatterns: ['!**/*'],
25
28
  overrides: [
@@ -1 +1 @@
1
- {"version":3,"file":"lint-project.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/lint-project/lint-project.ts"],"names":[],"mappings":";;;;AACA,yCAMsB;AAEtB,4CAAyC;AACzC,sDAAsD;AACtD,+BAA4B;AAC5B,uCAAiD;AAajD,SAAS,yBAAyB,CAChC,IAAU,EACV,aAAmC;IAEnC,IAAA,kBAAS,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,EAAE;QACvD,OAAO,EAAE,GAAG,IAAA,uBAAc,EAAC,aAAa,CAAC,IAAI,CAAC,aAAa;QAC3D,8EAA8E;QAC9E,aAAa,EAAE;YACb,OAAO,EAAE,CAAC,OAAO,CAAC;SACnB;QACD,KAAK,EAAE,EAAE;KACV,CAAC,CAAC;AACL,CAAC;AAED,SAAS,yBAAyB,CAChC,IAAU,EACV,aAAmC,EACnC,uBAAgC;IAEhC,IAAA,kBAAS,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,aAAa,CAAC,IAAI,EAAE,gBAAgB,CAAC,EAAE;QAC1D,OAAO,EAAE,CAAC,GAAG,IAAA,uBAAc,EA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vB,IAAI,EACJ,aAAa,EACb,OAAO,CAAC,uBAAuB,CAChC,CAAC;SACH;aAAM;YACL,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG;gBAC9B,QAAQ,EAAE,sCAAsC;gBAChD,OAAO,EAAE;oBACP,QAAQ,EAAE,OAAO,CAAC,aAAa;oBAC/B,OAAO,EAAE,CAAC,oBAAoB,EAAE,IAAI,aAAa,CAAC,IAAI,OAAO,CAAC;iBAC/D;aACF,CAAC;YACF,yBAAyB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;SAChD;QAED,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAEjE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;CAAA;AA1CD,oDA0CC"}
1
+ {"version":3,"file":"lint-project.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/lint-project/lint-project.ts"],"names":[],"mappings":";;;;AACA,yCAMsB;AAEtB,4CAAyC;AACzC,sDAAsD;AACtD,+BAA4B;AAC5B,uCAAiD;AAajD,SAAS,yBAAyB,CAChC,IAAU,EACV,aAAmC;IAEnC,IAAA,kBAAS,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,EAAE;QACvD,OAAO,EAAE,GAAG,IAAA,uBAAc,EAAC,aAAa,CAAC,IAAI,CAAC,aAAa;QAC3D,8EAA8E;QAC9E,aAAa,EAAE;YACb,OAAO,EAAE,CAAC,OAAO,CAAC;SACnB;QACD,KAAK,EAAE,EAAE;KACV,CAAC,CAAC;AACL,CAAC;AAED,SAAS,yBAAyB,CAChC,IAAU,EACV,aAAmC,EACnC,uBAAgC;IAEhC,MAAM,YAAY,GAAG,IAAA,4BAAc,EAAC,IAAI,CAAC,CAAC;IAC1C,I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C9B,QAAQ,EAAE,qBAAqB;gBAC/B,OAAO,EAAE,CAAC,sBAAsB,CAAC;gBACjC,OAAO,EAAE;oBACP,gBAAgB,EAAE,OAAO,CAAC,kBAAkB;iBAC7C;aACF,CAAC;YACF,yBAAyB,CACvB,IAAI,EACJ,aAAa,EACb,OAAO,CAAC,uBAAuB,CAChC,CAAC;SACH;aAAM;YACL,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG;gBAC9B,QAAQ,EAAE,sCAAsC;gBAChD,OAAO,EAAE;oBACP,QAAQ,EAAE,OAAO,CAAC,aAAa;oBAC/B,OAAO,EAAE,CAAC,oBAAoB,EAAE,IAAI,aAAa,CAAC,IAAI,OAAO,CAAC;iBAC/D;aACF,CAAC;YACF,yBAAyB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;SAChD;QAED,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAEjE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;CAAA;AA1CD,oDA0CC"}
@@ -1,3 +1,2 @@
1
1
  import type { Tree } from '@nrwl/devkit';
2
- export declare function containsEslint(tree: Tree): boolean;
3
- export declare function findEslintFile(tree: Tree): string;
2
+ export declare function findEslintFile(tree: Tree): string | null;
@@ -1,24 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findEslintFile = exports.containsEslint = void 0;
3
+ exports.findEslintFile = void 0;
4
4
  const eslintFileList = ['.eslintrc.json', '.eslintrc.js'];
5
- function containsEslint(tree) {
6
- for (const file of eslintFileList) {
7
- if (tree.exists(file)) {
8
- return true;
9
- }
10
- }
11
- return false;
12
- }
13
- exports.containsEslint = containsEslint;
14
5
  function findEslintFile(tree) {
15
6
  for (const file of eslintFileList) {
16
7
  if (tree.exists(file)) {
17
8
  return file;
18
9
  }
19
10
  }
20
- // Default file
21
- return '.eslintrc.json';
11
+ return null;
22
12
  }
23
13
  exports.findEslintFile = findEslintFile;
24
14
  //# sourceMappingURL=eslint-file.js.map
@@ -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,KAAK,CAAC;AACf,CAAC;AAPD,wCAOC;AAED,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,eAAe;IACf,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AARD,wCAQC"}
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"}
@@ -11,13 +11,14 @@ const versions_1 = require("nx/src/utils/versions");
11
11
  exports.WORKSPACE_RULES_PROJECT_NAME = 'eslint-rules';
12
12
  exports.WORKSPACE_PLUGIN_DIR = 'tools/eslint-rules';
13
13
  function lintWorkspaceRulesProjectGenerator(tree) {
14
+ var _a, _b;
14
15
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
16
  // Noop if the workspace rules project already exists
16
17
  try {
17
18
  (0, devkit_1.readProjectConfiguration)(tree, exports.WORKSPACE_RULES_PROJECT_NAME);
18
19
  return;
19
20
  }
20
- catch (_a) { }
21
+ catch (_c) { }
21
22
  // Create the project, the test target is added below by the jest generator
22
23
  (0, devkit_1.addProjectConfiguration)(tree, exports.WORKSPACE_RULES_PROJECT_NAME, {
23
24
  root: exports.WORKSPACE_PLUGIN_DIR,
@@ -35,7 +36,10 @@ function lintWorkspaceRulesProjectGenerator(tree) {
35
36
  * TODO: Explore writing a ProjectGraph plugin to make this more surgical.
36
37
  */
37
38
  const workspaceConfig = (0, devkit_1.readWorkspaceConfiguration)(tree);
38
- (0, devkit_1.updateWorkspaceConfiguration)(tree, Object.assign(Object.assign({}, workspaceConfig), { implicitDependencies: Object.assign(Object.assign({}, workspaceConfig.implicitDependencies), { [`${exports.WORKSPACE_PLUGIN_DIR}/**/*`]: '*' }) }));
39
+ if ((_b = (_a = workspaceConfig.targetDefaults) === null || _a === void 0 ? void 0 : _a.lint) === null || _b === void 0 ? void 0 : _b.inputs) {
40
+ workspaceConfig.targetDefaults.lint.inputs.push(`{workspaceRoot}/${exports.WORKSPACE_PLUGIN_DIR}/**/*`);
41
+ (0, devkit_1.updateWorkspaceConfiguration)(tree, workspaceConfig);
42
+ }
39
43
  // Add jest to the project and return installation task
40
44
  const installTask = yield (0, jest_1.jestProjectGenerator)(tree, {
41
45
  project: exports.WORKSPACE_RULES_PROJECT_NAME,
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-rules-project.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/workspace-rules-project/workspace-rules-project.ts"],"names":[],"mappings":";;;;AAAA,yCAYsB;AACtB,qCAA2E;AAC3E,yEAAyF;AACzF,+BAA4B;AAC5B,2EAA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yBAAc,EAAE,WAAW,EAAE,yBAAc,EAAE,CACtE,CAAC;QAEF,kGAAkG;QAClG,IAAA,8BAAuB,EACrB,IAAI,EACJ,IAAA,0BAAiB,EAAC,4BAAoB,EAAE,gBAAgB,CAAC,EACzD,kBAAkB,EAClB;YACE,kBAAkB,EAAE,8CAA8C;SACnE,CACF,CAAC;QAEF,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,WAAW,CAAC;IACrB,CAAC;CAAA;AA/DD,gFA+DC;AAEY,QAAA,kCAAkC,GAAG,IAAA,2BAAkB,EAClE,kCAAkC,CACnC,CAAC"}
1
+ {"version":3,"file":"workspace-rules-project.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/workspace-rules-project/workspace-rules-project.ts"],"names":[],"mappings":";;;;AAAA,yCAYsB;AACtB,qCAA2E;AAC3E,yEAAyF;AACzF,+BAA4B;AAC5B,2EAA0E;AAC1E,oDAAuE;AAE1D,QAAA,4BAA4B,GAAG,cAAc,CAAC;AAE9C,QAAA,oBAAoB,GAAG,oBAAoB,CAAC;AAEzD,SAAsB,kCAAkC,CAAC,IAAU;;;QACjE,qDAAqD;QACrD,IAAI;YACF,IAAA,iCAAwB,EAAC,IAAI,EAAE,oCAA4B,CAAC,CAAC;YAC7D,OAAO;SACR;QAAC,WAAM,GAAE;QAEV,2EAA2E;QAC3E,IAAA,gCAAuB,EAAC,IAAI,EAAE,oCAA4B,EAAE;YAC1D,IAAI,EAAE,4BAAoB;YAC1B,UAAU,EAAE,4BAAoB;YAChC,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QAEH,8BAA8B;QAC9B,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,6CAAsB,EAAE;YACpE,IAAI,EAAE,EAAE;YACR,cAAc,EAAE,IAAA,uBAAc,EAAC,4BAAoB,CAAC;YACpD,gBAAgB,EAAE,IAAA,0CAA6B,EAAC,I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