@nx/eslint 20.5.0-rc.3 → 20.5.0
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": "20.5.0
|
3
|
+
"version": "20.5.0",
|
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": {
|
@@ -35,8 +35,8 @@
|
|
35
35
|
"eslint": "^8.0.0 || ^9.0.0"
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
|
-
"@nx/devkit": "20.5.0
|
39
|
-
"@nx/js": "20.5.0
|
38
|
+
"@nx/devkit": "20.5.0",
|
39
|
+
"@nx/js": "20.5.0",
|
40
40
|
"semver": "^7.5.3",
|
41
41
|
"tslib": "^2.3.0",
|
42
42
|
"typescript": "~5.7.2"
|
@@ -12,6 +12,7 @@ const flat_config_1 = require("../../utils/flat-config");
|
|
12
12
|
const ast_utils_1 = require("../utils/flat-config/ast-utils");
|
13
13
|
const config_file_1 = require("../../utils/config-file");
|
14
14
|
const plugin_1 = require("../utils/plugin");
|
15
|
+
const versions_1 = require("../../utils/versions");
|
15
16
|
const setup_root_eslint_1 = require("./setup-root-eslint");
|
16
17
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
17
18
|
function lintProjectGenerator(tree, options) {
|
@@ -96,7 +97,12 @@ async function lintProjectGeneratorInternal(tree, options) {
|
|
96
97
|
// additionally, the companion e2e app would have `rootProject: true`
|
97
98
|
// so we need to check for the root path as well
|
98
99
|
if (!options.rootProject || projectConfig.root !== '.') {
|
99
|
-
|
100
|
+
const addDependencyChecks = options.addPackageJsonDependencyChecks ||
|
101
|
+
isBuildableLibraryProject(tree, projectConfig);
|
102
|
+
createEsLintConfiguration(tree, options, projectConfig, options.setParserOptionsProject, options.rootProject, addDependencyChecks);
|
103
|
+
if (addDependencyChecks) {
|
104
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, { 'jsonc-eslint-parser': versions_1.jsoncEslintParserVersion }, undefined, true));
|
105
|
+
}
|
100
106
|
}
|
101
107
|
// Buildable libs need source analysis enabled for linting `package.json`.
|
102
108
|
if (isBuildableLibraryProject(tree, projectConfig) &&
|
@@ -114,7 +120,7 @@ async function lintProjectGeneratorInternal(tree, options) {
|
|
114
120
|
}
|
115
121
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
116
122
|
}
|
117
|
-
function createEsLintConfiguration(tree, options, projectConfig, setParserOptionsProject, rootProject) {
|
123
|
+
function createEsLintConfiguration(tree, options, projectConfig, setParserOptionsProject, rootProject, addDependencyChecks) {
|
118
124
|
// we are only extending root for non-standalone projects or their complementary e2e apps
|
119
125
|
const extendedRootConfig = rootProject ? undefined : (0, eslint_file_1.findEslintFile)(tree);
|
120
126
|
const pathToRootConfig = extendedRootConfig
|
@@ -132,8 +138,6 @@ function createEsLintConfiguration(tree, options, projectConfig, setParserOption
|
|
132
138
|
options.eslintConfigFormat = (0, eslint_file_1.determineEslintConfigFormat)(tree.read(extendedRootConfig, 'utf-8'));
|
133
139
|
}
|
134
140
|
}
|
135
|
-
const addDependencyChecks = options.addPackageJsonDependencyChecks ||
|
136
|
-
isBuildableLibraryProject(tree, projectConfig);
|
137
141
|
const overrides = (0, flat_config_1.useFlatConfig)(tree)
|
138
142
|
? // For flat configs, we don't need to generate different overrides for each file. Users should add their own overrides as needed.
|
139
143
|
[]
|
package/src/utils/versions.d.ts
CHANGED
@@ -3,6 +3,7 @@ export declare const eslintVersion = "~8.57.0";
|
|
3
3
|
export declare const eslintrcVersion = "^2.1.1";
|
4
4
|
export declare const eslintConfigPrettierVersion = "^9.0.0";
|
5
5
|
export declare const typescriptESLintVersion = "^7.16.0";
|
6
|
+
export declare const jsoncEslintParserVersion = "^2.1.0";
|
6
7
|
export declare const eslint9__typescriptESLintVersion = "^8.19.0";
|
7
8
|
export declare const eslint9__eslintVersion = "^9.8.0";
|
8
9
|
export declare const eslintCompat = "^1.1.1";
|
package/src/utils/versions.js
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.eslintCompat = exports.eslint9__eslintVersion = exports.eslint9__typescriptESLintVersion = exports.typescriptESLintVersion = exports.eslintConfigPrettierVersion = exports.eslintrcVersion = exports.eslintVersion = exports.nxVersion = void 0;
|
3
|
+
exports.eslintCompat = exports.eslint9__eslintVersion = exports.eslint9__typescriptESLintVersion = exports.jsoncEslintParserVersion = exports.typescriptESLintVersion = exports.eslintConfigPrettierVersion = exports.eslintrcVersion = exports.eslintVersion = exports.nxVersion = void 0;
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
5
5
|
exports.eslintVersion = '~8.57.0';
|
6
6
|
exports.eslintrcVersion = '^2.1.1';
|
7
7
|
exports.eslintConfigPrettierVersion = '^9.0.0';
|
8
8
|
exports.typescriptESLintVersion = '^7.16.0';
|
9
|
+
exports.jsoncEslintParserVersion = '^2.1.0';
|
9
10
|
// Updated linting stack for ESLint v9, typescript-eslint v8
|
10
11
|
exports.eslint9__typescriptESLintVersion = '^8.19.0';
|
11
12
|
exports.eslint9__eslintVersion = '^9.8.0';
|