@nx/eslint-plugin 23.3.0-beta.1 → 23.3.0-beta.2
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.
|
@@ -295,6 +295,15 @@ function hasBuildExecutor(projectGraph, buildTargets = ['build']) {
|
|
|
295
295
|
const ESLINT_REGEX = /node_modules.*[\/\\]eslint(?:\.js)?$/;
|
|
296
296
|
const JEST_REGEX = /node_modules\/.bin\/jest$/; // when we run unit tests in jest
|
|
297
297
|
const NRWL_CLI_REGEX = /nx[\/\\]dist[\/\\]bin[\/\\]run-executor\.js$/;
|
|
298
|
+
// ESLint's multithreaded mode (`--concurrency`, or the `concurrency` option on
|
|
299
|
+
// the `ESLint` class) lints in worker threads, where Node sets argv[1] to the
|
|
300
|
+
// worker script instead of the eslint binary. Without this, ESLINT_REGEX does
|
|
301
|
+
// not match and `ensureGlobalProjectGraph` (project-graph-utils.ts) re-reads the
|
|
302
|
+
// whole project graph for every linted file. Unlike the language-server cases
|
|
303
|
+
// below, this stays safe when the parent is long-lived: ESLint starts workers
|
|
304
|
+
// per `lintFiles()` call and that call ends when they terminate, so the memo
|
|
305
|
+
// cannot outlive a single lint run.
|
|
306
|
+
const ESLINT_WORKER_REGEX = /node_modules.*[\/\\]eslint[\/\\]lib[\/\\]eslint[\/\\]worker\.js$/;
|
|
298
307
|
// `@nx/oxlint` runs this rule through Oxlint's JS-plugin bridge, where argv[1]
|
|
299
308
|
// is `node_modules/oxlint/bin/oxlint`. Without this, `ensureGlobalProjectGraph`
|
|
300
309
|
// (project-graph-utils.ts) never memoizes and every linted file re-reads the
|
|
@@ -312,6 +321,7 @@ function isTerminalRun() {
|
|
|
312
321
|
(!!process.argv[1].match(NRWL_CLI_REGEX) ||
|
|
313
322
|
!!process.argv[1].match(JEST_REGEX) ||
|
|
314
323
|
!!process.argv[1].match(ESLINT_REGEX) ||
|
|
324
|
+
!!process.argv[1].match(ESLINT_WORKER_REGEX) ||
|
|
315
325
|
isOxlintTerminalRun(process.argv) ||
|
|
316
326
|
!!process.argv[1].endsWith('/bin/jest.js')));
|
|
317
327
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/eslint-plugin",
|
|
3
|
-
"version": "23.3.0-beta.
|
|
3
|
+
"version": "23.3.0-beta.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -109,11 +109,11 @@
|
|
|
109
109
|
"picocolors": "^1.1.0",
|
|
110
110
|
"semver": "^7.6.3",
|
|
111
111
|
"tslib": "^2.3.0",
|
|
112
|
-
"@nx/
|
|
113
|
-
"@nx/
|
|
112
|
+
"@nx/js": "23.3.0-beta.2",
|
|
113
|
+
"@nx/devkit": "23.3.0-beta.2"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
|
-
"nx": "23.3.0-beta.
|
|
116
|
+
"nx": "23.3.0-beta.2"
|
|
117
117
|
},
|
|
118
118
|
"publishConfig": {
|
|
119
119
|
"access": "public"
|