@nx/eslint 17.3.0-canary.20240120-06717de → 17.3.0-canary.20240123-3333ef4
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/eslint",
|
3
|
-
"version": "17.3.0-canary.
|
3
|
+
"version": "17.3.0-canary.20240123-3333ef4",
|
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": {
|
@@ -34,11 +34,11 @@
|
|
34
34
|
"js-yaml": "4.1.0"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@nx/devkit": "17.3.0-canary.
|
38
|
-
"@nx/js": "17.3.0-canary.
|
37
|
+
"@nx/devkit": "17.3.0-canary.20240123-3333ef4",
|
38
|
+
"@nx/js": "17.3.0-canary.20240123-3333ef4",
|
39
39
|
"tslib": "^2.3.0",
|
40
40
|
"typescript": "~5.2.2",
|
41
|
-
"@nx/linter": "17.3.0-canary.
|
41
|
+
"@nx/linter": "17.3.0-canary.20240123-3333ef4"
|
42
42
|
},
|
43
43
|
"peerDependenciesMeta": {
|
44
44
|
"eslint": {
|
@@ -2,5 +2,6 @@ import type { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
2
|
export interface LinterInitOptions {
|
3
3
|
skipPackageJson?: boolean;
|
4
4
|
keepExistingVersions?: boolean;
|
5
|
+
updatePackageScripts?: boolean;
|
5
6
|
}
|
6
|
-
export declare function lintInitGenerator(tree: Tree, options: LinterInitOptions): GeneratorCallback
|
7
|
+
export declare function lintInitGenerator(tree: Tree, options: LinterInitOptions): Promise<GeneratorCallback>;
|
@@ -2,9 +2,11 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.lintInitGenerator = void 0;
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
|
+
const update_package_scripts_1 = require("@nx/devkit/src/utils/update-package-scripts");
|
5
6
|
const versions_1 = require("../../utils/versions");
|
6
7
|
const eslint_file_1 = require("../utils/eslint-file");
|
7
|
-
const plugin_1 = require("
|
8
|
+
const plugin_1 = require("../../plugins/plugin");
|
9
|
+
const plugin_2 = require("../utils/plugin");
|
8
10
|
function updateProductionFileset(tree) {
|
9
11
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
10
12
|
const productionFileSet = nxJson.namedInputs?.production;
|
@@ -47,12 +49,15 @@ function addPlugin(tree) {
|
|
47
49
|
});
|
48
50
|
(0, devkit_1.updateNxJson)(tree, nxJson);
|
49
51
|
}
|
50
|
-
function initEsLint(tree, options) {
|
52
|
+
async function initEsLint(tree, options) {
|
51
53
|
const addPlugins = process.env.NX_PCV3 === 'true';
|
52
|
-
const hasPlugin = (0,
|
54
|
+
const hasPlugin = (0, plugin_2.hasEslintPlugin)(tree);
|
53
55
|
const rootEslintFile = (0, eslint_file_1.findEslintFile)(tree);
|
54
56
|
if (rootEslintFile && addPlugins && !hasPlugin) {
|
55
57
|
addPlugin(tree);
|
58
|
+
if (options.updatePackageScripts) {
|
59
|
+
await (0, update_package_scripts_1.updatePackageScripts)(tree, plugin_1.createNodes);
|
60
|
+
}
|
56
61
|
return () => { };
|
57
62
|
}
|
58
63
|
if (rootEslintFile) {
|
@@ -73,9 +78,12 @@ function initEsLint(tree, options) {
|
|
73
78
|
eslint: versions_1.eslintVersion,
|
74
79
|
}, undefined, options.keepExistingVersions));
|
75
80
|
}
|
81
|
+
if (options.updatePackageScripts) {
|
82
|
+
(0, update_package_scripts_1.updatePackageScripts)(tree, plugin_1.createNodes);
|
83
|
+
}
|
76
84
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
77
85
|
}
|
78
|
-
function lintInitGenerator(tree, options) {
|
79
|
-
return initEsLint(tree, options);
|
86
|
+
async function lintInitGenerator(tree, options) {
|
87
|
+
return await initEsLint(tree, options);
|
80
88
|
}
|
81
89
|
exports.lintInitGenerator = lintInitGenerator;
|
@@ -16,6 +16,12 @@
|
|
16
16
|
"x-priority": "internal",
|
17
17
|
"description": "Keep existing dependencies versions",
|
18
18
|
"default": false
|
19
|
+
},
|
20
|
+
"updatePackageScripts": {
|
21
|
+
"type": "boolean",
|
22
|
+
"x-priority": "internal",
|
23
|
+
"description": "Update `package.json` scripts with inferred targets",
|
24
|
+
"default": false
|
19
25
|
}
|
20
26
|
},
|
21
27
|
"required": []
|
@@ -14,7 +14,7 @@ const plugin_1 = require("../utils/plugin");
|
|
14
14
|
const setup_root_eslint_1 = require("./setup-root-eslint");
|
15
15
|
async function lintProjectGenerator(tree, options) {
|
16
16
|
const tasks = [];
|
17
|
-
const initTask = (0, init_1.lintInitGenerator)(tree, {
|
17
|
+
const initTask = await (0, init_1.lintInitGenerator)(tree, {
|
18
18
|
skipPackageJson: options.skipPackageJson,
|
19
19
|
});
|
20
20
|
tasks.push(initTask);
|