@nx/eslint 19.0.0-canary.20240430-458f2cc → 19.0.0-canary.20240503-dbad02a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/migrations.json CHANGED
@@ -1,17 +1,5 @@
1
1
  {
2
2
  "generators": {
3
- "add-eslint-inputs": {
4
- "cli": "nx",
5
- "version": "15.0.0-beta.0",
6
- "description": "Stop hashing eslint config files for build targets and dependent tasks",
7
- "factory": "./src/migrations/update-15-0-0/add-eslint-inputs"
8
- },
9
- "add-eslint-ignore": {
10
- "cli": "nx",
11
- "version": "15.7.1-beta.0",
12
- "description": "Add node_modules to root eslint ignore",
13
- "factory": "./src/migrations/update-15-7-1/add-eslint-ignore"
14
- },
15
3
  "update-16-0-0-add-nx-packages": {
16
4
  "cli": "nx",
17
5
  "version": "16.0.0-beta.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint",
3
- "version": "19.0.0-canary.20240430-458f2cc",
3
+ "version": "19.0.0-canary.20240503-dbad02a",
4
4
  "private": false,
5
5
  "description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.",
6
6
  "repository": {
@@ -33,12 +33,12 @@
33
33
  "js-yaml": "4.1.0"
34
34
  },
35
35
  "dependencies": {
36
- "@nx/devkit": "19.0.0-canary.20240430-458f2cc",
37
- "@nx/js": "19.0.0-canary.20240430-458f2cc",
36
+ "@nx/devkit": "19.0.0-canary.20240503-dbad02a",
37
+ "@nx/js": "19.0.0-canary.20240503-dbad02a",
38
38
  "eslint": "^8.0.0",
39
39
  "tslib": "^2.3.0",
40
40
  "typescript": "~5.4.2",
41
- "@nx/linter": "19.0.0-canary.20240430-458f2cc"
41
+ "@nx/linter": "19.0.0-canary.20240503-dbad02a"
42
42
  },
43
43
  "peerDependenciesMeta": {
44
44
  "js-yaml": {
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function addEslintInputs(tree: Tree): Promise<void>;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const eslint_targets_1 = require("../../generators/utils/eslint-targets");
5
- const config_file_1 = require("../../utils/config-file");
6
- async function addEslintInputs(tree) {
7
- const nxJson = (0, devkit_1.readNxJson)(tree);
8
- const globalEslintFile = config_file_1.ESLINT_CONFIG_FILENAMES.find((file) => tree.exists(file));
9
- if (globalEslintFile && nxJson.namedInputs?.production) {
10
- const productionFileset = new Set(nxJson.namedInputs.production);
11
- productionFileset.add(`!{projectRoot}/${globalEslintFile}`);
12
- nxJson.namedInputs.production = Array.from(productionFileset);
13
- }
14
- for (const targetName of (0, eslint_targets_1.getEslintTargets)(tree)) {
15
- nxJson.targetDefaults ??= {};
16
- const lintTargetDefaults = (nxJson.targetDefaults[targetName] ??= {});
17
- lintTargetDefaults.inputs ??= [
18
- 'default',
19
- ...(globalEslintFile
20
- ? [(0, devkit_1.joinPathFragments)('{workspaceRoot}', globalEslintFile)]
21
- : []),
22
- ];
23
- }
24
- (0, devkit_1.updateNxJson)(tree, nxJson);
25
- await (0, devkit_1.formatFiles)(tree);
26
- }
27
- exports.default = addEslintInputs;
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function addEslintIgnore(tree: Tree): Promise<void>;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const eslint_targets_1 = require("../../generators/utils/eslint-targets");
5
- const config_file_1 = require("../../utils/config-file");
6
- async function addEslintIgnore(tree) {
7
- const nxJson = (0, devkit_1.readJson)(tree, 'nx.json');
8
- const globalEslintFile = config_file_1.ESLINT_CONFIG_FILENAMES.find((file) => tree.exists(file));
9
- if (globalEslintFile) {
10
- if (tree.exists('.eslintignore')) {
11
- const content = tree.read('.eslintignore', 'utf-8');
12
- if (!content.includes('node_modules')) {
13
- tree.write('.eslintignore', `node_modules\n${content}`);
14
- }
15
- }
16
- else {
17
- tree.write('.eslintignore', 'node_modules\n');
18
- }
19
- for (const targetName of (0, eslint_targets_1.getEslintTargets)(tree)) {
20
- nxJson.targetDefaults ??= {};
21
- const lintTargetDefaults = (nxJson.targetDefaults[targetName] ??= {});
22
- const lintIgnorePath = (0, devkit_1.joinPathFragments)('{workspaceRoot}', globalEslintFile);
23
- if (lintTargetDefaults.inputs) {
24
- if (!lintTargetDefaults.inputs.includes(lintIgnorePath)) {
25
- lintTargetDefaults.inputs.push(lintIgnorePath);
26
- }
27
- }
28
- else {
29
- lintTargetDefaults.inputs = ['default', lintIgnorePath];
30
- }
31
- }
32
- (0, devkit_1.updateNxJson)(tree, nxJson);
33
- await (0, devkit_1.formatFiles)(tree);
34
- }
35
- }
36
- exports.default = addEslintIgnore;