@nx/eslint 21.1.1 → 21.2.0-beta.1

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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <p style="text-align: center;">
2
2
  <picture>
3
3
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
4
- <img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
4
+ <img alt="Nx - Smart Repos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
5
5
  </picture>
6
6
  </p>
7
7
 
@@ -20,7 +20,7 @@
20
20
 
21
21
  <hr>
22
22
 
23
- # Nx: Smart Monorepos · Fast CI
23
+ # Nx: Smart Repos · Fast Builds
24
24
 
25
25
  Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
26
26
 
@@ -62,5 +62,5 @@ npx nx@latest init
62
62
  - [Blog Posts About Nx](https://nx.dev/blog)
63
63
 
64
64
  <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
65
- width="100%" alt="Nx - Smart Monorepos · Fast CI"></a></p>
65
+ width="100%" alt="Nx - Smart Repos · Fast Builds"></a></p>
66
66
 
package/migrations.json CHANGED
@@ -109,6 +109,70 @@
109
109
  "version": "^10.0.0"
110
110
  }
111
111
  }
112
+ },
113
+ "21.2.0-typescript-eslint": {
114
+ "version": "21.2.0-beta.0",
115
+ "requires": {
116
+ "typescript-eslint": ">8.0.0 <8.29.0"
117
+ },
118
+ "packages": {
119
+ "typescript-eslint": {
120
+ "version": "^8.29.0"
121
+ },
122
+ "@typescript-eslint/eslint-plugin": {
123
+ "version": "^8.29.0"
124
+ },
125
+ "@typescript-eslint/parser": {
126
+ "version": "^8.29.0"
127
+ },
128
+ "@typescript-eslint/utils": {
129
+ "version": "^8.29.0"
130
+ },
131
+ "@typescript-eslint/rule-tester": {
132
+ "version": "^8.29.0",
133
+ "alwaysAddToPackageJson": false
134
+ },
135
+ "@typescript-eslint/scope-manager": {
136
+ "version": "^8.29.0",
137
+ "alwaysAddToPackageJson": false
138
+ },
139
+ "@typescript-eslint/typescript-estree": {
140
+ "version": "^8.29.0",
141
+ "alwaysAddToPackageJson": false
142
+ }
143
+ }
144
+ },
145
+ "21.2.0-@typescript-eslint": {
146
+ "version": "21.2.0-beta.0",
147
+ "requires": {
148
+ "@typescript-eslint/eslint-plugin": ">8.0.0 <8.29.0"
149
+ },
150
+ "packages": {
151
+ "typescript-eslint": {
152
+ "version": "^8.29.0"
153
+ },
154
+ "@typescript-eslint/eslint-plugin": {
155
+ "version": "^8.29.0"
156
+ },
157
+ "@typescript-eslint/parser": {
158
+ "version": "^8.29.0"
159
+ },
160
+ "@typescript-eslint/utils": {
161
+ "version": "^8.29.0"
162
+ },
163
+ "@typescript-eslint/rule-tester": {
164
+ "version": "^8.29.0",
165
+ "alwaysAddToPackageJson": false
166
+ },
167
+ "@typescript-eslint/scope-manager": {
168
+ "version": "^8.29.0",
169
+ "alwaysAddToPackageJson": false
170
+ },
171
+ "@typescript-eslint/typescript-estree": {
172
+ "version": "^8.29.0",
173
+ "alwaysAddToPackageJson": false
174
+ }
175
+ }
112
176
  }
113
177
  }
114
178
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint",
3
- "version": "21.1.1",
3
+ "version": "21.2.0-beta.1",
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,11 +35,11 @@
35
35
  "eslint": "^8.0.0 || ^9.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "21.1.1",
39
- "@nx/js": "21.1.1",
38
+ "@nx/devkit": "21.2.0-beta.1",
39
+ "@nx/js": "21.2.0-beta.1",
40
40
  "semver": "^7.5.3",
41
41
  "tslib": "^2.3.0",
42
- "typescript": "~5.7.2"
42
+ "typescript": "~5.8.2"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "@zkochan/js-yaml": {
@@ -107,11 +107,8 @@ const internalCreateNodes = async (configFilePath, options, context, projectsCac
107
107
  projects,
108
108
  };
109
109
  };
110
- const internalCreateNodesV2 = async (configFilePath, options, context, projectRootsByEslintRoots, lintableFilesPerProjectRoot, projectsCache, hashByRoot) => {
110
+ const internalCreateNodesV2 = async (ESLint, configFilePath, options, context, projectRootsByEslintRoots, lintableFilesPerProjectRoot, projectsCache, hashByRoot) => {
111
111
  const configDir = (0, posix_1.dirname)(configFilePath);
112
- const ESLint = await (0, resolve_eslint_class_1.resolveESLintClass)({
113
- useFlatConfigOverrideVal: (0, config_file_1.isFlatConfig)(configFilePath),
114
- });
115
112
  const eslintVersion = ESLint.version;
116
113
  const projects = {};
117
114
  await Promise.all(projectRootsByEslintRoots.get(configDir).map(async (projectRoot) => {
@@ -121,16 +118,21 @@ const internalCreateNodesV2 = async (configFilePath, options, context, projectRo
121
118
  Object.assign(projects, projectsCache[hash]);
122
119
  return;
123
120
  }
124
- const eslint = new ESLint({
125
- cwd: (0, posix_1.join)(context.workspaceRoot, projectRoot),
126
- });
127
121
  let hasNonIgnoredLintableFiles = false;
128
- for (const file of lintableFilesPerProjectRoot.get(projectRoot) ?? []) {
129
- if (!(await eslint.isPathIgnored((0, posix_1.join)(context.workspaceRoot, file)))) {
130
- hasNonIgnoredLintableFiles = true;
131
- break;
122
+ if (configDir !== projectRoot || projectRoot === '.') {
123
+ const eslint = new ESLint({
124
+ cwd: (0, posix_1.join)(context.workspaceRoot, projectRoot),
125
+ });
126
+ for (const file of lintableFilesPerProjectRoot.get(projectRoot) ?? []) {
127
+ if (!(await eslint.isPathIgnored((0, posix_1.join)(context.workspaceRoot, file)))) {
128
+ hasNonIgnoredLintableFiles = true;
129
+ break;
130
+ }
132
131
  }
133
132
  }
133
+ else {
134
+ hasNonIgnoredLintableFiles = true;
135
+ }
134
136
  if (!hasNonIgnoredLintableFiles) {
135
137
  // No lintable files in the project, store in the cache and skip further processing
136
138
  projectsCache[hash] = {};
@@ -166,7 +168,13 @@ exports.createNodesV2 = [
166
168
  }));
167
169
  const hashByRoot = new Map(projectRoots.map((r, i) => [r, hashes[i]]));
168
170
  try {
169
- return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => internalCreateNodesV2(configFile, options, context, projectRootsByEslintRoots, lintableFilesPerProjectRoot, targetsCache, hashByRoot), eslintConfigFiles, options, context);
171
+ if (eslintConfigFiles.length === 0) {
172
+ return [];
173
+ }
174
+ const ESLint = await (0, resolve_eslint_class_1.resolveESLintClass)({
175
+ useFlatConfigOverrideVal: (0, config_file_1.isFlatConfig)(eslintConfigFiles[0]),
176
+ });
177
+ return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => internalCreateNodesV2(ESLint, configFile, options, context, projectRootsByEslintRoots, lintableFilesPerProjectRoot, targetsCache, hashByRoot), eslintConfigFiles, options, context);
170
178
  }
171
179
  finally {
172
180
  writeTargetsToCache(cachePath, targetsCache);
@@ -4,6 +4,6 @@ export declare const eslintrcVersion = "^2.1.1";
4
4
  export declare const eslintConfigPrettierVersion = "^10.0.0";
5
5
  export declare const typescriptESLintVersion = "^7.16.0";
6
6
  export declare const jsoncEslintParserVersion = "^2.1.0";
7
- export declare const eslint9__typescriptESLintVersion = "^8.19.0";
7
+ export declare const eslint9__typescriptESLintVersion = "^8.29.0";
8
8
  export declare const eslint9__eslintVersion = "^9.8.0";
9
9
  export declare const eslintCompat = "^1.1.1";
@@ -8,6 +8,6 @@ exports.eslintConfigPrettierVersion = '^10.0.0';
8
8
  exports.typescriptESLintVersion = '^7.16.0';
9
9
  exports.jsoncEslintParserVersion = '^2.1.0';
10
10
  // Updated linting stack for ESLint v9, typescript-eslint v8
11
- exports.eslint9__typescriptESLintVersion = '^8.19.0';
11
+ exports.eslint9__typescriptESLintVersion = '^8.29.0';
12
12
  exports.eslint9__eslintVersion = '^9.8.0';
13
13
  exports.eslintCompat = '^1.1.1';