@nx/eslint-plugin 23.2.0-beta.6 → 23.2.0-beta.7

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.
@@ -0,0 +1,3 @@
1
+ export declare const enforceModuleBoundaries: import("@typescript-eslint/utils/ts-eslint").RuleModule<import("./src/rules/enforce-module-boundaries").MessageIds, import("./src/rules/enforce-module-boundaries").Options, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
2
+ name: string;
3
+ };
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.enforceModuleBoundaries = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Semi-private surface for first-party Nx packages; may change without semver.
6
+ // Rules come from here rather than `./nx`, whose `workspaceRules` initializer
7
+ // compiles the consumer's `tools/eslint-rules` just to reach one rule.
8
+ //
9
+ // Keep the `const` assignment: `export { default as … } from` breaks the ESM
10
+ // named import on Node below 24.14. `internal.spec.ts` pins the shape and
11
+ // explains why.
12
+ const enforce_module_boundaries_1 = tslib_1.__importDefault(require("./src/rules/enforce-module-boundaries"));
13
+ exports.enforceModuleBoundaries = enforce_module_boundaries_1.default;
@@ -289,11 +289,24 @@ function hasBuildExecutor(projectGraph, buildTargets = ['build']) {
289
289
  const ESLINT_REGEX = /node_modules.*[\/\\]eslint(?:\.js)?$/;
290
290
  const JEST_REGEX = /node_modules\/.bin\/jest$/; // when we run unit tests in jest
291
291
  const NRWL_CLI_REGEX = /nx[\/\\]dist[\/\\]bin[\/\\]run-executor\.js$/;
292
+ // `@nx/oxlint` runs this rule through Oxlint's JS-plugin bridge, where argv[1]
293
+ // is `node_modules/oxlint/bin/oxlint`. Without this, `ensureGlobalProjectGraph`
294
+ // (project-graph-utils.ts) never memoizes and every linted file re-reads the
295
+ // whole project graph.
296
+ const OXLINT_REGEX = /node_modules.*[\/\\]oxlint(?:\.js)?$/;
297
+ // `oxlint --lsp` is the same binary, and it is how the oxc editor extension
298
+ // starts its server — so the language server matches the regex above and has to
299
+ // be excluded by flag instead. JS plugins do load in LSP mode, so without this
300
+ // the long-lived editor process would pin a graph from startup.
301
+ function isOxlintTerminalRun(argv) {
302
+ return !!argv[1].match(OXLINT_REGEX) && !argv.includes('--lsp');
303
+ }
292
304
  function isTerminalRun() {
293
305
  return (process.argv.length > 1 &&
294
306
  (!!process.argv[1].match(NRWL_CLI_REGEX) ||
295
307
  !!process.argv[1].match(JEST_REGEX) ||
296
308
  !!process.argv[1].match(ESLINT_REGEX) ||
309
+ isOxlintTerminalRun(process.argv) ||
297
310
  !!process.argv[1].endsWith('/bin/jest.js')));
298
311
  }
299
312
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint-plugin",
3
- "version": "23.2.0-beta.6",
3
+ "version": "23.2.0-beta.7",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -32,6 +32,9 @@
32
32
  "nx": [
33
33
  "dist/nx.d.ts"
34
34
  ],
35
+ "internal": [
36
+ "dist/internal.d.ts"
37
+ ],
35
38
  "react": [
36
39
  "dist/react.d.ts"
37
40
  ],
@@ -68,6 +71,11 @@
68
71
  "types": "./dist/nx.d.ts",
69
72
  "default": "./dist/nx.js"
70
73
  },
74
+ "./internal": {
75
+ "@nx/nx-source": "./internal.ts",
76
+ "types": "./dist/internal.d.ts",
77
+ "default": "./dist/internal.js"
78
+ },
71
79
  "./react": {
72
80
  "@nx/nx-source": "./react.ts",
73
81
  "types": "./dist/react.d.ts",
@@ -101,11 +109,11 @@
101
109
  "picocolors": "^1.1.0",
102
110
  "semver": "^7.6.3",
103
111
  "tslib": "^2.3.0",
104
- "@nx/devkit": "23.2.0-beta.6",
105
- "@nx/js": "23.2.0-beta.6"
112
+ "@nx/devkit": "23.2.0-beta.7",
113
+ "@nx/js": "23.2.0-beta.7"
106
114
  },
107
115
  "devDependencies": {
108
- "nx": "23.2.0-beta.6"
116
+ "nx": "23.2.0-beta.7"
109
117
  },
110
118
  "publishConfig": {
111
119
  "access": "public"