@nx/eslint 22.6.0-beta.7 → 22.6.0-beta.8
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 +4 -4
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +11 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/eslint",
|
|
3
|
-
"version": "22.6.0-beta.
|
|
3
|
+
"version": "22.6.0-beta.8",
|
|
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,14 +35,14 @@
|
|
|
35
35
|
"eslint": "^8.0.0 || ^9.0.0 || ^10.0.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@nx/devkit": "22.6.0-beta.
|
|
39
|
-
"@nx/js": "22.6.0-beta.
|
|
38
|
+
"@nx/devkit": "22.6.0-beta.8",
|
|
39
|
+
"@nx/js": "22.6.0-beta.8",
|
|
40
40
|
"semver": "^7.6.3",
|
|
41
41
|
"tslib": "^2.3.0",
|
|
42
42
|
"typescript": "~5.9.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"nx": "22.6.0-beta.
|
|
45
|
+
"nx": "22.6.0-beta.8"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"@zkochan/js-yaml": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/eslint/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EAMd,MAAM,YAAY,CAAC;AAqBpB,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/eslint/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EAMd,MAAM,YAAY,CAAC;AAqBpB,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAmHD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,mBAAmB,CA8D1D,CAAC;AAEF,eAAO,MAAM,aAAa,oCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -42,6 +42,16 @@ function writeTargetsToCache(cachePath, results) {
|
|
|
42
42
|
const internalCreateNodesV2 = async (ESLint, configFilePath, options, context, projectRootsByEslintRoots, lintableFilesPerProjectRoot, projectsCache, hashByRoot) => {
|
|
43
43
|
const configDir = (0, posix_1.dirname)(configFilePath);
|
|
44
44
|
const eslintVersion = ESLint.version;
|
|
45
|
+
let sharedEslint;
|
|
46
|
+
const getEslint = (projectRoot) => {
|
|
47
|
+
if ((0, node_fs_1.existsSync)((0, posix_1.join)(context.workspaceRoot, projectRoot, '.eslintignore'))) {
|
|
48
|
+
return new ESLint({ cwd: (0, posix_1.join)(context.workspaceRoot, projectRoot) });
|
|
49
|
+
}
|
|
50
|
+
sharedEslint ??= new ESLint({
|
|
51
|
+
cwd: (0, posix_1.join)(context.workspaceRoot, configDir),
|
|
52
|
+
});
|
|
53
|
+
return sharedEslint;
|
|
54
|
+
};
|
|
45
55
|
const projects = {};
|
|
46
56
|
await Promise.all(projectRootsByEslintRoots.get(configDir).map(async (projectRoot) => {
|
|
47
57
|
const hash = hashByRoot.get(projectRoot);
|
|
@@ -52,9 +62,7 @@ const internalCreateNodesV2 = async (ESLint, configFilePath, options, context, p
|
|
|
52
62
|
}
|
|
53
63
|
let hasNonIgnoredLintableFiles = false;
|
|
54
64
|
if (configDir !== projectRoot || projectRoot === '.') {
|
|
55
|
-
const eslint =
|
|
56
|
-
cwd: (0, posix_1.join)(context.workspaceRoot, projectRoot),
|
|
57
|
-
});
|
|
65
|
+
const eslint = getEslint(projectRoot);
|
|
58
66
|
for (const file of lintableFilesPerProjectRoot.get(projectRoot) ?? []) {
|
|
59
67
|
if (!(await eslint.isPathIgnored((0, posix_1.join)(context.workspaceRoot, file)))) {
|
|
60
68
|
hasNonIgnoredLintableFiles = true;
|