@nx/eslint-plugin 20.3.2 → 20.3.4

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-plugin",
3
- "version": "20.3.2",
3
+ "version": "20.3.4",
4
4
  "private": false,
5
5
  "description": "The eslint-plugin package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as an Nx-specific lint rule called enforce-module-boundaries.",
6
6
  "repository": {
@@ -34,8 +34,8 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "20.3.2",
38
- "@nx/js": "20.3.2",
37
+ "@nx/devkit": "20.3.4",
38
+ "@nx/js": "20.3.4",
39
39
  "@typescript-eslint/type-utils": "^8.0.0",
40
40
  "@typescript-eslint/utils": "^8.0.0",
41
41
  "chalk": "^4.1.0",
@@ -125,14 +125,24 @@ function normalizeOptions(sourceProject, options) {
125
125
  let outDir;
126
126
  const base = { ...DEFAULT_OPTIONS, ...options };
127
127
  let runtimeTsConfig;
128
- try {
129
- runtimeTsConfig = require.resolve(path.join(sourceProject.data.root, base.tsConfig));
130
- const tsConfig = (0, devkit_1.readJsonFile)(runtimeTsConfig);
131
- rootDir = tsConfig.compilerOptions?.rootDir;
132
- outDir = tsConfig.compilerOptions?.outDir;
128
+ if (sourceProject.data.targets?.build?.executor === '@nx/js:tsc') {
129
+ rootDir = sourceProject.data.targets.build.options.rootDir;
130
+ outDir = sourceProject.data.targets.build.options.outputPath;
133
131
  }
134
- catch {
135
- // nothing
132
+ if (!rootDir && !outDir) {
133
+ try {
134
+ runtimeTsConfig = require.resolve(path.join(devkit_1.workspaceRoot, sourceProject.data.root, base.tsConfig));
135
+ const tsConfig = (0, devkit_1.readJsonFile)(runtimeTsConfig);
136
+ rootDir ??= tsConfig.compilerOptions?.rootDir
137
+ ? path.join(sourceProject.data.root, tsConfig.compilerOptions.rootDir)
138
+ : undefined;
139
+ outDir ??= tsConfig.compilerOptions?.outDir
140
+ ? path.join(sourceProject.data.root, tsConfig.compilerOptions.outDir)
141
+ : undefined;
142
+ }
143
+ catch {
144
+ // nothing
145
+ }
136
146
  }
137
147
  const pathPrefix = sourceProject.data.root !== '.' ? `${sourceProject.data.root}/` : '';
138
148
  return {
@@ -149,8 +159,8 @@ function normalizeOptions(sourceProject, options) {
149
159
  packageJson: base.packageJson
150
160
  ? `${pathPrefix}${base.packageJson}`
151
161
  : undefined,
152
- rootDir: rootDir ? path.join(sourceProject.data.root, rootDir) : undefined,
153
- outDir: outDir ? path.join(sourceProject.data.root, outDir) : undefined,
162
+ rootDir,
163
+ outDir,
154
164
  };
155
165
  }
156
166
  function checkCollectionFileNode(baseNode, mode, context, options) {