@nx/eslint 22.7.0-beta.15 → 22.7.0-beta.17
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/executors/lint/utility/eslint-utils.d.ts.map +1 -1
- package/src/executors/lint/utility/eslint-utils.js +6 -1
- package/src/generators/init/global-eslint-config.d.ts +1 -1
- package/src/generators/init/global-eslint-config.d.ts.map +1 -1
- package/src/generators/utils/flat-config/path-utils.d.ts.map +1 -1
- package/src/utils/resolve-eslint-class.d.ts.map +1 -1
- package/src/utils/resolve-eslint-class.js +6 -4
- package/src/utils/rules-requiring-type-checking.d.ts +2 -2
- package/src/utils/rules-requiring-type-checking.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/eslint",
|
|
3
|
-
"version": "22.7.0-beta.
|
|
3
|
+
"version": "22.7.0-beta.17",
|
|
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": {
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"eslint": "^8.0.0 || ^9.0.0 || ^10.0.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@nx/devkit": "22.7.0-beta.
|
|
40
|
-
"@nx/js": "22.7.0-beta.
|
|
39
|
+
"@nx/devkit": "22.7.0-beta.17",
|
|
40
|
+
"@nx/js": "22.7.0-beta.17",
|
|
41
41
|
"semver": "^7.6.3",
|
|
42
42
|
"tslib": "^2.3.0",
|
|
43
43
|
"typescript": "~5.9.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"nx": "22.7.0-beta.
|
|
46
|
+
"nx": "22.7.0-beta.17"
|
|
47
47
|
},
|
|
48
48
|
"peerDependenciesMeta": {
|
|
49
49
|
"@zkochan/js-yaml": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint-utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/eslint/src/executors/lint/utility/eslint-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,OAAO,EAAE,MAAM,EACf,aAAa,UAAQ;;;
|
|
1
|
+
{"version":3,"file":"eslint-utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/eslint/src/executors/lint/utility/eslint-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,OAAO,EAAE,MAAM,EACf,aAAa,UAAQ;;;GA6HtB"}
|
|
@@ -11,7 +11,9 @@ async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatCon
|
|
|
11
11
|
const ESLint = await (0, resolve_eslint_class_1.resolveESLintClass)({
|
|
12
12
|
useFlatConfigOverrideVal: useFlatConfig,
|
|
13
13
|
});
|
|
14
|
-
//
|
|
14
|
+
// Use the broader legacy options shape so the v8 (legacy-only) fields assigned
|
|
15
|
+
// below type-check. Flat-only fields (ruleFilter, suppress*) are intersected
|
|
16
|
+
// in; they're ignored at runtime by legacy ESLint and are version-gated below.
|
|
15
17
|
const eslintOptions = {
|
|
16
18
|
overrideConfigFile: eslintConfigPath,
|
|
17
19
|
fix: !!options.fix &&
|
|
@@ -91,6 +93,9 @@ async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatCon
|
|
|
91
93
|
console.warn('Bulk suppression options skipped due to version check failure');
|
|
92
94
|
}
|
|
93
95
|
}
|
|
96
|
+
// Runtime ESLint class may be the flat or legacy implementation; the built
|
|
97
|
+
// options object is compatible with either at runtime, but the two Options
|
|
98
|
+
// shapes diverge in v9 types so cast at the boundary.
|
|
94
99
|
const eslint = new ESLint(eslintOptions);
|
|
95
100
|
return {
|
|
96
101
|
ESLint,
|
|
@@ -25,6 +25,6 @@ export declare const javaScriptOverride: {
|
|
|
25
25
|
*/
|
|
26
26
|
rules: {};
|
|
27
27
|
};
|
|
28
|
-
export declare const getGlobalEsLintConfiguration: (unitTestRunner?: string, rootProject?: boolean) => Linter.
|
|
28
|
+
export declare const getGlobalEsLintConfiguration: (unitTestRunner?: string, rootProject?: boolean) => Linter.LegacyConfig;
|
|
29
29
|
export declare const getGlobalFlatEslintConfiguration: (format: "cjs" | "mjs", rootProject?: boolean) => string;
|
|
30
30
|
//# sourceMappingURL=global-eslint-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-eslint-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/eslint/src/generators/init/global-eslint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAUhC;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;IAG7B;;;OAGG;;CAEJ,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;IAG7B;;;OAGG;;CAEJ,CAAC;AAgCF,eAAO,MAAM,4BAA4B,GACvC,iBAAiB,MAAM,EACvB,cAAc,OAAO,KACpB,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"global-eslint-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/eslint/src/generators/init/global-eslint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAUhC;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;IAG7B;;;OAGG;;CAEJ,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;IAG7B;;;OAGG;;CAEJ,CAAC;AAgCF,eAAO,MAAM,4BAA4B,GACvC,iBAAiB,MAAM,EACvB,cAAc,OAAO,KACpB,MAAM,CAAC,YAoBT,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAC3C,QAAQ,KAAK,GAAG,KAAK,EACrB,cAAc,OAAO,KACpB,MA8EF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/eslint/src/generators/utils/flat-config/path-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"path-utils.d.ts","sourceRoot":"","sources":["../../../../../../../packages/eslint/src/generators/utils/flat-config/path-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,GAClD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAQ3C;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,UAY3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-eslint-class.d.ts","sourceRoot":"","sources":["../../../../../packages/eslint/src/utils/resolve-eslint-class.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,wBAAsB,kBAAkB,CAAC,IAAI,CAAC,EAAE;IAC9C,wBAAwB,EAAE,OAAO,CAAC;CACnC,GAAG,OAAO,CAAC,OAAO,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"resolve-eslint-class.d.ts","sourceRoot":"","sources":["../../../../../packages/eslint/src/utils/resolve-eslint-class.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,wBAAsB,kBAAkB,CAAC,IAAI,CAAC,EAAE;IAC9C,wBAAwB,EAAE,OAAO,CAAC;CACnC,GAAG,OAAO,CAAC,OAAO,MAAM,CAAC,CAsCzB"}
|
|
@@ -43,15 +43,17 @@ async function resolveESLintClass(opts) {
|
|
|
43
43
|
// In eslint 8.57.0 (the final v8 version), a dedicated API was added for resolving the correct ESLint class.
|
|
44
44
|
const eslintModule = (await Promise.resolve().then(() => __importStar(require('eslint'))));
|
|
45
45
|
if (typeof eslintModule.loadESLint === 'function') {
|
|
46
|
-
return await eslintModule.loadESLint({
|
|
46
|
+
return (await eslintModule.loadESLint({
|
|
47
47
|
useFlatConfig: shouldESLintUseFlatConfig,
|
|
48
|
-
});
|
|
48
|
+
}));
|
|
49
49
|
}
|
|
50
50
|
// Explicitly use the FlatESLint and LegacyESLint classes here because the ESLint class points at a different one based on ESLint v8 vs ESLint v9
|
|
51
51
|
// But the decision on which one to use is not just based on the major version of ESLint.
|
|
52
|
-
// @ts-expect-error The may be wrong based on our installed eslint version
|
|
53
52
|
const { LegacyESLint, FlatESLint } = await Promise.resolve().then(() => __importStar(require('eslint/use-at-your-own-risk')));
|
|
54
|
-
|
|
53
|
+
// LegacyESLint's type no longer structurally matches the flat ESLint class
|
|
54
|
+
// in v9 type defs (new static members like defaultConfig, fromOptionsModule),
|
|
55
|
+
// but at runtime either class is an appropriate return value here.
|
|
56
|
+
return (shouldESLintUseFlatConfig ? FlatESLint : LegacyESLint);
|
|
55
57
|
}
|
|
56
58
|
catch {
|
|
57
59
|
throw new Error('Unable to find `eslint`. Ensure a valid `eslint` version is installed.');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Linter } from 'eslint';
|
|
2
|
-
export declare function hasRulesRequiringTypeChecking(eslintConfig: Linter.
|
|
3
|
-
export declare function removeParserOptionsProjectIfNotRequired(json: Linter.
|
|
2
|
+
export declare function hasRulesRequiringTypeChecking(eslintConfig: Linter.LegacyConfig): boolean;
|
|
3
|
+
export declare function removeParserOptionsProjectIfNotRequired(json: Linter.LegacyConfig): Linter.LegacyConfig;
|
|
4
4
|
//# sourceMappingURL=rules-requiring-type-checking.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-requiring-type-checking.d.ts","sourceRoot":"","sources":["../../../../../packages/eslint/src/utils/rules-requiring-type-checking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA0BrC,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"rules-requiring-type-checking.d.ts","sourceRoot":"","sources":["../../../../../packages/eslint/src/utils/rules-requiring-type-checking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA0BrC,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,MAAM,CAAC,YAAY,GAChC,OAAO,CAcT;AAED,wBAAgB,uCAAuC,CACrD,IAAI,EAAE,MAAM,CAAC,YAAY,GACxB,MAAM,CAAC,YAAY,CAOrB"}
|