@nx/eslint 0.0.0-pr-29935-9b48db9 → 0.0.0-pr-3-0b96150
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": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-3-0b96150",
|
|
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": "0.0.0-pr-
|
|
39
|
-
"@nx/js": "0.0.0-pr-
|
|
38
|
+
"@nx/devkit": "0.0.0-pr-3-0b96150",
|
|
39
|
+
"@nx/js": "0.0.0-pr-3-0b96150",
|
|
40
40
|
"semver": "^7.5.3",
|
|
41
41
|
"tslib": "^2.3.0",
|
|
42
42
|
"typescript": "~5.7.2"
|
|
@@ -357,9 +357,9 @@ function addExtendsToLintConfig(tree, root, plugin, insertAtTheEnd = false) {
|
|
|
357
357
|
}
|
|
358
358
|
tree.write(fileName, content);
|
|
359
359
|
if (shouldImportEslintCompat) {
|
|
360
|
-
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@eslint/compat': versions_1.eslintCompat
|
|
360
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@eslint/compat': versions_1.eslintCompat }, undefined, true);
|
|
361
361
|
}
|
|
362
|
-
return (
|
|
362
|
+
return () => { };
|
|
363
363
|
}
|
|
364
364
|
else {
|
|
365
365
|
const plugins = (Array.isArray(plugin) ? plugin : [plugin]).map((p) => typeof p === 'string' ? p : p.name);
|
package/src/plugins/plugin.js
CHANGED
|
@@ -107,7 +107,7 @@ const internalCreateNodes = async (configFilePath, options, context, projectsCac
|
|
|
107
107
|
projects,
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
-
const internalCreateNodesV2 = async (configFilePath, options, context, projectRootsByEslintRoots, lintableFilesPerProjectRoot, projectsCache
|
|
110
|
+
const internalCreateNodesV2 = async (configFilePath, options, context, eslintConfigFiles, projectRootsByEslintRoots, lintableFilesPerProjectRoot, projectsCache) => {
|
|
111
111
|
const configDir = (0, posix_1.dirname)(configFilePath);
|
|
112
112
|
const ESLint = await (0, resolve_eslint_class_1.resolveESLintClass)({
|
|
113
113
|
useFlatConfigOverrideVal: (0, config_file_1.isFlatConfig)(configFilePath),
|
|
@@ -115,7 +115,12 @@ const internalCreateNodesV2 = async (configFilePath, options, context, projectRo
|
|
|
115
115
|
const eslintVersion = ESLint.version;
|
|
116
116
|
const projects = {};
|
|
117
117
|
await Promise.all(projectRootsByEslintRoots.get(configDir).map(async (projectRoot) => {
|
|
118
|
-
const
|
|
118
|
+
const parentConfigs = eslintConfigFiles.filter((eslintConfig) => isSubDir(projectRoot, (0, posix_1.dirname)(eslintConfig)));
|
|
119
|
+
const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, {
|
|
120
|
+
configFiles: eslintConfigFiles,
|
|
121
|
+
nxJsonConfiguration: context.nxJsonConfiguration,
|
|
122
|
+
workspaceRoot: context.workspaceRoot,
|
|
123
|
+
}, [...parentConfigs, (0, posix_1.join)(projectRoot, '.eslintignore')]);
|
|
119
124
|
if (projectsCache[hash]) {
|
|
120
125
|
// We can reuse the projects in the cache.
|
|
121
126
|
Object.assign(projects, projectsCache[hash]);
|
|
@@ -160,13 +165,8 @@ exports.createNodesV2 = [
|
|
|
160
165
|
const targetsCache = readTargetsCache(cachePath);
|
|
161
166
|
const { eslintConfigFiles, projectRoots, projectRootsByEslintRoots } = splitConfigFiles(configFiles);
|
|
162
167
|
const lintableFilesPerProjectRoot = await collectLintableFilesByProjectRoot(projectRoots, options, context);
|
|
163
|
-
const hashes = await (0, calculate_hash_for_create_nodes_1.calculateHashesForCreateNodes)(projectRoots, options, context, projectRoots.map((root) => {
|
|
164
|
-
const parentConfigs = eslintConfigFiles.filter((eslintConfig) => isSubDir(root, (0, posix_1.dirname)(eslintConfig)));
|
|
165
|
-
return [...parentConfigs, (0, posix_1.join)(root, '.eslintignore')];
|
|
166
|
-
}));
|
|
167
|
-
const hashByRoot = new Map(projectRoots.map((r, i) => [r, hashes[i]]));
|
|
168
168
|
try {
|
|
169
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => internalCreateNodesV2(configFile, options, context, projectRootsByEslintRoots, lintableFilesPerProjectRoot, targetsCache
|
|
169
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => internalCreateNodesV2(configFile, options, context, eslintConfigFiles, projectRootsByEslintRoots, lintableFilesPerProjectRoot, targetsCache), eslintConfigFiles, options, context);
|
|
170
170
|
}
|
|
171
171
|
finally {
|
|
172
172
|
writeTargetsToCache(cachePath, targetsCache);
|