@angular-eslint/builder 17.5.2-alpha.0 → 18.0.0-alpha.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.
@@ -1 +1 @@
1
- {"version":3,"file":"eslint-utils.d.ts","sourceRoot":"","sources":["../../src/utils/eslint-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAiBxC,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,OAAO,EAAE,MAAM,EACf,aAAa,UAAQ;;;GAoEtB"}
1
+ {"version":3,"file":"eslint-utils.d.ts","sourceRoot":"","sources":["../../src/utils/eslint-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAuBxC,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,OAAO,EAAE,MAAM,EACf,aAAa,UAAQ;;;GAoEtB"}
@@ -3,8 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveAndInstantiateESLint = void 0;
4
4
  async function resolveESLintClass(useFlatConfig = false) {
5
5
  try {
6
+ // In eslint 8.57.0 (the final v8 version), a dedicated API was added for resolving the correct ESLint class.
7
+ const eslint = await import('eslint');
8
+ if (typeof eslint.loadESLint === 'function') {
9
+ return await eslint.loadESLint({ useFlatConfig });
10
+ }
11
+ // If that API is not available (an older version of v8), we need to use the old way of resolving the ESLint class.
6
12
  if (!useFlatConfig) {
7
- return (await import('eslint')).ESLint;
13
+ return eslint.ESLint;
8
14
  }
9
15
  // eslint-disable-next-line @typescript-eslint/no-var-requires
10
16
  const { FlatESLint } = require('eslint/use-at-your-own-risk');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/builder",
3
- "version": "17.5.2-alpha.0",
3
+ "version": "18.0.0-alpha.1",
4
4
  "description": "Angular CLI builder for ESLint",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -19,12 +19,12 @@
19
19
  "builders.json"
20
20
  ],
21
21
  "dependencies": {
22
- "@nx/devkit": "^17.2.8 || ^18.0.0 || ^19.0.0",
23
- "nx": "^17.2.8 || ^18.0.0 || ^19.0.0"
22
+ "@nx/devkit": "^19.0.6",
23
+ "nx": "^19.0.6"
24
24
  },
25
25
  "builders": "./builders.json",
26
26
  "peerDependencies": {
27
- "eslint": "^7.20.0 || ^8.0.0",
27
+ "eslint": "^8.57.0 || ^9.0.0",
28
28
  "typescript": "*"
29
29
  },
30
30
  "gitHead": "e2006e5e9c99e5a943d1a999e0efa5247d29ec24"