@nx/eslint 23.2.0-beta.4 → 23.2.0-beta.6
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/dist/src/executors/lint/lint.impl.js +1 -2
- package/dist/src/generators/convert-to-flat-config/angular-eslint.js +2 -2
- package/dist/src/generators/convert-to-inferred/convert-to-inferred.js +1 -2
- package/dist/src/generators/lint-project/lint-project.js +1 -2
- package/dist/src/plugins/plugin.js +4 -8
- package/package.json +5 -5
|
@@ -4,7 +4,6 @@ exports.default = run;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
|
-
const utils_1 = require("nx/src/tasks-runner/utils");
|
|
8
7
|
const path_1 = require("path");
|
|
9
8
|
const config_file_1 = require("../../utils/config-file");
|
|
10
9
|
const deprecation_1 = require("../../utils/deprecation");
|
|
@@ -64,7 +63,7 @@ async function run(options, context) {
|
|
|
64
63
|
}
|
|
65
64
|
let lintResults = [];
|
|
66
65
|
const normalizedLintFilePatterns = normalizedOptions.lintFilePatterns.map((pattern) => {
|
|
67
|
-
return (0,
|
|
66
|
+
return (0, internal_1.interpolate)(pattern, {
|
|
68
67
|
workspaceRoot: '',
|
|
69
68
|
projectRoot,
|
|
70
69
|
projectName: context.projectName,
|
|
@@ -83,8 +83,8 @@ function readAngularEslintVersion(tree) {
|
|
|
83
83
|
// Pin the umbrella to the major already installed, falling back to the latest
|
|
84
84
|
// major nx generates when none is present. @nx/eslint can't read the canonical
|
|
85
85
|
// pin from @nx/angular without inverting the package dependency (@nx/angular
|
|
86
|
-
// depends on @nx/eslint), so the fallback is hardcoded; keep
|
|
87
|
-
// `angularEslintVersion` in packages/angular/src/utils/versions.ts.
|
|
86
|
+
// depends on @nx/eslint), so the fallback is hardcoded; keep its major in sync
|
|
87
|
+
// with `angularEslintVersion` in packages/angular/src/utils/versions.ts.
|
|
88
88
|
function resolveAngularEslintVersion(tree) {
|
|
89
89
|
const version = readAngularEslintVersion(tree);
|
|
90
90
|
const major = version ? (0, semver_1.coerce)(version)?.major : undefined;
|
|
@@ -4,7 +4,6 @@ exports.convertToInferred = convertToInferred;
|
|
|
4
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const posix_1 = require("node:path/posix");
|
|
7
|
-
const utils_1 = require("nx/src/tasks-runner/utils");
|
|
8
7
|
const plugin_1 = require("../../plugins/plugin");
|
|
9
8
|
const assert_supported_eslint_version_1 = require("../../utils/assert-supported-eslint-version");
|
|
10
9
|
const config_file_1 = require("../../utils/config-file");
|
|
@@ -115,7 +114,7 @@ function handlePropertiesInOptions(options, projectDetails, target) {
|
|
|
115
114
|
}
|
|
116
115
|
if ('lintFilePatterns' in options) {
|
|
117
116
|
const normalizedLintFilePatterns = options.lintFilePatterns.map((pattern) => {
|
|
118
|
-
const interpolatedPattern = (0,
|
|
117
|
+
const interpolatedPattern = (0, internal_1.interpolate)(pattern, {
|
|
119
118
|
workspaceRoot: '',
|
|
120
119
|
projectRoot: projectDetails.root,
|
|
121
120
|
projectName: projectDetails.projectName,
|
|
@@ -8,7 +8,6 @@ const path_1 = require("path");
|
|
|
8
8
|
const init_1 = require("../init/init");
|
|
9
9
|
const deprecation_1 = require("../../utils/deprecation");
|
|
10
10
|
const init_migration_1 = require("../init/init-migration");
|
|
11
|
-
const project_configuration_1 = require("nx/src/generators/utils/project-configuration");
|
|
12
11
|
const flat_config_1 = require("../../utils/flat-config");
|
|
13
12
|
const ast_utils_1 = require("../utils/flat-config/ast-utils");
|
|
14
13
|
const config_file_1 = require("../../utils/config-file");
|
|
@@ -80,7 +79,7 @@ async function lintProjectGeneratorInternal(tree, options) {
|
|
|
80
79
|
// companion e2e app so we should check if migration to
|
|
81
80
|
// monorepo style is needed
|
|
82
81
|
if (!options.rootProject) {
|
|
83
|
-
const projectsFromTree = (0,
|
|
82
|
+
const projectsFromTree = (0, devkit_1.getProjects)(tree);
|
|
84
83
|
if (await isMigrationToMonorepoNeeded(tree, projectsFromTree)) {
|
|
85
84
|
// we only migrate project configurations that have been created
|
|
86
85
|
const filteredProjects = [];
|
|
@@ -8,10 +8,6 @@ const internal_2 = require("@nx/js/internal");
|
|
|
8
8
|
const node_fs_1 = require("node:fs");
|
|
9
9
|
const node_path_1 = require("node:path");
|
|
10
10
|
const posix_1 = require("node:path/posix");
|
|
11
|
-
const file_hasher_1 = require("nx/src/hasher/file-hasher");
|
|
12
|
-
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
13
|
-
const globs_1 = require("nx/src/utils/globs");
|
|
14
|
-
const workspace_context_1 = require("nx/src/utils/workspace-context");
|
|
15
11
|
const config_file_1 = require("../utils/config-file");
|
|
16
12
|
const resolve_eslint_class_1 = require("../utils/resolve-eslint-class");
|
|
17
13
|
const DEFAULT_EXTENSIONS = [
|
|
@@ -27,7 +23,7 @@ const DEFAULT_EXTENSIONS = [
|
|
|
27
23
|
'vue',
|
|
28
24
|
];
|
|
29
25
|
const PROJECT_CONFIG_FILENAMES = ['project.json', 'package.json'];
|
|
30
|
-
const ESLINT_CONFIG_GLOB_V2 = (0,
|
|
26
|
+
const ESLINT_CONFIG_GLOB_V2 = (0, internal_1.combineGlobPatterns)([
|
|
31
27
|
...config_file_1.ESLINT_CONFIG_FILENAMES.map((f) => `**/${f}`),
|
|
32
28
|
...PROJECT_CONFIG_FILENAMES.map((f) => `**/${f}`),
|
|
33
29
|
]);
|
|
@@ -99,8 +95,8 @@ exports.createNodes = [
|
|
|
99
95
|
async (configFiles, options, context) => {
|
|
100
96
|
options = normalizeOptions(options);
|
|
101
97
|
const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
|
|
102
|
-
const optionsHash = (0,
|
|
103
|
-
const cachePath = (0, posix_1.join)(
|
|
98
|
+
const optionsHash = (0, internal_1.hashObject)(options);
|
|
99
|
+
const cachePath = (0, posix_1.join)(internal_1.workspaceDataDirectory, `eslint-${optionsHash}.hash`);
|
|
104
100
|
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
105
101
|
const { eslintConfigFiles, projectRoots, projectRootsByEslintRoots } = splitConfigFiles(configFiles);
|
|
106
102
|
const lintableFilesPerProjectRoot = await collectLintableFilesByProjectRoot(projectRoots, options, context);
|
|
@@ -224,7 +220,7 @@ function collectTsconfigChainsByProjectRoot(projectRoots, workspaceRoot) {
|
|
|
224
220
|
}
|
|
225
221
|
async function collectLintableFilesByProjectRoot(projectRoots, options, context) {
|
|
226
222
|
const lintableFilesPerProjectRoot = new Map();
|
|
227
|
-
const lintableFiles = await (0,
|
|
223
|
+
const lintableFiles = await (0, internal_1.globWithWorkspaceContext)(context.workspaceRoot, [
|
|
228
224
|
`**/*.{${options.extensions.join(',')}}`,
|
|
229
225
|
]);
|
|
230
226
|
for (const projectRoot of projectRoots) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/eslint",
|
|
3
|
-
"version": "23.2.0-beta.
|
|
3
|
+
"version": "23.2.0-beta.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -73,17 +73,17 @@
|
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"@zkochan/js-yaml": "0.0.7",
|
|
75
75
|
"eslint": "^9.0.0 || ^10.0.0",
|
|
76
|
-
"@nx/jest": "23.2.0-beta.
|
|
76
|
+
"@nx/jest": "23.2.0-beta.6"
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"semver": "^7.6.3",
|
|
80
80
|
"tslib": "^2.3.0",
|
|
81
81
|
"typescript": "~6.0.3",
|
|
82
|
-
"@nx/devkit": "23.2.0-beta.
|
|
83
|
-
"@nx/js": "23.2.0-beta.
|
|
82
|
+
"@nx/devkit": "23.2.0-beta.6",
|
|
83
|
+
"@nx/js": "23.2.0-beta.6"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"nx": "23.2.0-beta.
|
|
86
|
+
"nx": "23.2.0-beta.6"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|
|
89
89
|
"@nx/jest": {
|