@nx/eslint 22.5.1 → 22.5.3

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2025 Narwhal Technologies Inc.
3
+ Copyright (c) 2017-2026 Narwhal Technologies Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/eslint",
3
- "version": "22.5.1",
3
+ "version": "22.5.3",
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": {
@@ -32,17 +32,17 @@
32
32
  "executors": "./executors.json",
33
33
  "peerDependencies": {
34
34
  "@zkochan/js-yaml": "0.0.7",
35
- "eslint": "^8.0.0 || ^9.0.0"
35
+ "eslint": "^8.0.0 || ^9.0.0 || ^10.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "22.5.1",
39
- "@nx/js": "22.5.1",
38
+ "@nx/devkit": "22.5.3",
39
+ "@nx/js": "22.5.3",
40
40
  "semver": "^7.6.3",
41
41
  "tslib": "^2.3.0",
42
42
  "typescript": "~5.9.2"
43
43
  },
44
44
  "devDependencies": {
45
- "nx": "22.5.1"
45
+ "nx": "22.5.3"
46
46
  },
47
47
  "peerDependenciesMeta": {
48
48
  "@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;;;GAyHtB"}
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;;;GAwHtB"}
@@ -6,9 +6,7 @@ const config_file_1 = require("../../../utils/config-file");
6
6
  const resolve_eslint_class_1 = require("../../../utils/resolve-eslint-class");
7
7
  async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatConfig = false) {
8
8
  if (useFlatConfig && eslintConfigPath && !(0, config_file_1.isFlatConfig)(eslintConfigPath)) {
9
- throw new Error(
10
- // todo: add support for eslint.config.mjs,
11
- 'When using the new Flat Config with ESLint, all configs must be named eslint.config.js or eslint.config.cjs and .eslintrc files may not be used. See https://eslint.org/docs/latest/use/configure/configuration-files');
9
+ throw new Error('When using the new Flat Config with ESLint, all configs must be named eslint.config.js or eslint.config.cjs and .eslintrc files may not be used. See https://eslint.org/docs/latest/use/configure/configuration-files');
12
10
  }
13
11
  const ESLint = await (0, resolve_eslint_class_1.resolveESLintClass)({
14
12
  useFlatConfigOverrideVal: useFlatConfig,
@@ -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,CAoBzB"}
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,CA+BzB"}
@@ -4,13 +4,20 @@ exports.resolveESLintClass = resolveESLintClass;
4
4
  const flat_config_1 = require("../utils/flat-config");
5
5
  async function resolveESLintClass(opts) {
6
6
  try {
7
+ const shouldESLintUseFlatConfig = typeof opts?.useFlatConfigOverrideVal === 'boolean'
8
+ ? opts.useFlatConfigOverrideVal
9
+ : (0, flat_config_1.useFlatConfig)();
10
+ // In eslint 8.57.0 (the final v8 version), a dedicated API was added for resolving the correct ESLint class.
11
+ const eslintModule = (await Promise.resolve().then(() => require('eslint')));
12
+ if (typeof eslintModule.loadESLint === 'function') {
13
+ return await eslintModule.loadESLint({
14
+ useFlatConfig: shouldESLintUseFlatConfig,
15
+ });
16
+ }
7
17
  // Explicitly use the FlatESLint and LegacyESLint classes here because the ESLint class points at a different one based on ESLint v8 vs ESLint v9
8
18
  // But the decision on which one to use is not just based on the major version of ESLint.
9
19
  // @ts-expect-error The may be wrong based on our installed eslint version
10
20
  const { LegacyESLint, FlatESLint } = await Promise.resolve().then(() => require('eslint/use-at-your-own-risk'));
11
- const shouldESLintUseFlatConfig = typeof opts?.useFlatConfigOverrideVal === 'boolean'
12
- ? opts.useFlatConfigOverrideVal
13
- : (0, flat_config_1.useFlatConfig)();
14
21
  return shouldESLintUseFlatConfig ? FlatESLint : LegacyESLint;
15
22
  }
16
23
  catch {