@angular-eslint/schematics 19.5.1-alpha.1 → 19.5.1-alpha.11
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/dist/devkit-imports.d.ts.map +1 -1
- package/dist/devkit-imports.js +0 -2
- package/dist/ng-add/index.d.ts.map +1 -1
- package/dist/ng-add/index.js +0 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +16 -6
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devkit-imports.d.ts","sourceRoot":"","sources":["../src/devkit-imports.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"devkit-imports.d.ts","sourceRoot":"","sources":["../src/devkit-imports.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAUH,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,SAAS,GACV,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/devkit-imports.js
CHANGED
|
@@ -10,7 +10,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.wrapAngularDevkitSchematic = exports.writeJson = exports.readJson = exports.offsetFromRoot = exports.convertNxGenerator = void 0;
|
|
11
11
|
const node_path_1 = require("node:path");
|
|
12
12
|
process.env.NX_PROJECT_GRAPH_CACHE_DIRECTORY = (0, node_path_1.join)(__dirname, '..', '.nx-cache');
|
|
13
|
-
/* eslint-disable no-restricted-imports */
|
|
14
13
|
var devkit_1 = require("@nx/devkit");
|
|
15
14
|
Object.defineProperty(exports, "convertNxGenerator", { enumerable: true, get: function () { return devkit_1.convertNxGenerator; } });
|
|
16
15
|
Object.defineProperty(exports, "offsetFromRoot", { enumerable: true, get: function () { return devkit_1.offsetFromRoot; } });
|
|
@@ -18,4 +17,3 @@ Object.defineProperty(exports, "readJson", { enumerable: true, get: function ()
|
|
|
18
17
|
Object.defineProperty(exports, "writeJson", { enumerable: true, get: function () { return devkit_1.writeJson; } });
|
|
19
18
|
var ngcli_adapter_1 = require("@nx/devkit/ngcli-adapter");
|
|
20
19
|
Object.defineProperty(exports, "wrapAngularDevkitSchematic", { enumerable: true, get: function () { return ngcli_adapter_1.wrapAngularDevkitSchematic; } });
|
|
21
|
-
/* eslint-enable no-restricted-imports */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAG/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAYvC,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAChD,eAAO,MAAM,kCAAkC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAG/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAYvC,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAChD,eAAO,MAAM,kCAAkC,WAAW,CAAC;AA+M3D;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAW,OAAO,EAAE,MAAM,GAAG,IAAI,CAa9C"}
|
package/dist/ng-add/index.js
CHANGED
|
@@ -7,7 +7,6 @@ const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
8
|
exports.FIXED_ESLINT_V8_VERSION = '8.57.0';
|
|
9
9
|
exports.FIXED_TYPESCRIPT_ESLINT_V7_VERSION = '7.11.0';
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
11
10
|
const packageJSON = require('../../package.json');
|
|
12
11
|
function addAngularESLintPackages(json, useFlatConfig, options) {
|
|
13
12
|
return (host, context) => {
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAS/E,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAS/E,eAAO,MAAM,wBAAwB,UAOpC,CAAC;AAEF;;;;;GAKG;AAEH,wBAAgB,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAcnE;AAED;;;;;GAKG;AAEH,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,EAC7C,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,gBAAgB,KAAK,CAAC,GAClD,IAAI,CAYN;AAED,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAE3E,wBAAgB,2BAA2B,CACzC,aAAa,EAAE;IAAE,SAAS,CAAC,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,OAAO,CAAC,EAAE,aAAa,CAAA;CA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E,IAAI,EACV,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CA8BT;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAuBrE;AAED,wBAAgB,kDAAkD,CAChE,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,GAClB;IACD,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAmCA"}
|
package/dist/utils.js
CHANGED
|
@@ -29,6 +29,9 @@ exports.supportedFlatConfigNames = [
|
|
|
29
29
|
'eslint.config.js',
|
|
30
30
|
'eslint.config.mjs',
|
|
31
31
|
'eslint.config.cjs',
|
|
32
|
+
'eslint.config.ts',
|
|
33
|
+
'eslint.config.mts',
|
|
34
|
+
'eslint.config.cts',
|
|
32
35
|
];
|
|
33
36
|
/**
|
|
34
37
|
* This method is specifically for reading JSON files in a Tree
|
|
@@ -122,8 +125,9 @@ function addESLintTargetToProject(projectName, targetName) {
|
|
|
122
125
|
if (existingProjectConfig.root !== '') {
|
|
123
126
|
if (shouldUseFlatConfig(tree)) {
|
|
124
127
|
const rootConfigPath = resolveRootESLintConfigPath(tree);
|
|
125
|
-
if (!rootConfigPath ||
|
|
126
|
-
|
|
128
|
+
if (!rootConfigPath ||
|
|
129
|
+
(!rootConfigPath.endsWith('js') && !rootConfigPath.endsWith('ts'))) {
|
|
130
|
+
throw new Error('Root ESLint config must be a JavaScript/TypeScript file (.js,.mjs,.cjs,.ts,.mts,.cts) when using Flat Config');
|
|
127
131
|
}
|
|
128
132
|
const { ext } = determineNewProjectESLintConfigContentAndExtension(tree, rootConfigPath, existingProjectConfig.root);
|
|
129
133
|
const flatConfigPath = (0, core_1.join)(existingProjectConfig.root, `eslint.config.${ext}`);
|
|
@@ -169,7 +173,6 @@ function visitNotIgnoredFiles(visitor, dir = (0, core_1.normalize)('')) {
|
|
|
169
173
|
visit(dir);
|
|
170
174
|
};
|
|
171
175
|
}
|
|
172
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
173
176
|
function setESLintProjectBasedOnProjectType(projectRoot, projectType, hasE2e) {
|
|
174
177
|
let project;
|
|
175
178
|
if (projectType === 'application') {
|
|
@@ -184,7 +187,6 @@ function setESLintProjectBasedOnProjectType(projectRoot, projectType, hasE2e) {
|
|
|
184
187
|
}
|
|
185
188
|
return project;
|
|
186
189
|
}
|
|
187
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
188
190
|
function createRootESLintConfig(prefix) {
|
|
189
191
|
let codeRules;
|
|
190
192
|
if (prefix) {
|
|
@@ -227,7 +229,6 @@ function createRootESLintConfig(prefix) {
|
|
|
227
229
|
],
|
|
228
230
|
};
|
|
229
231
|
}
|
|
230
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
231
232
|
function createStringifiedRootESLintConfig(prefix, isESM) {
|
|
232
233
|
return `// @ts-check
|
|
233
234
|
${isESM ? 'import eslint from "@eslint/js";' : 'const eslint = require("@eslint/js");'}
|
|
@@ -425,7 +426,7 @@ function determineTargetProjectName(tree, maybeProject) {
|
|
|
425
426
|
* Method will check if angular project architect has e2e configuration to determine if e2e setup
|
|
426
427
|
*/
|
|
427
428
|
function determineTargetProjectHasE2E(
|
|
428
|
-
// eslint-disable-next-line @typescript-eslint/
|
|
429
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
429
430
|
angularJSON, projectName) {
|
|
430
431
|
return !!getTargetsConfigFromProject(angularJSON.projects[projectName])?.e2e;
|
|
431
432
|
}
|
|
@@ -501,6 +502,15 @@ function resolveRootESLintConfigPath(tree) {
|
|
|
501
502
|
if (tree.exists('eslint.config.cjs')) {
|
|
502
503
|
return 'eslint.config.cjs';
|
|
503
504
|
}
|
|
505
|
+
if (tree.exists('eslint.config.ts')) {
|
|
506
|
+
return 'eslint.config.ts';
|
|
507
|
+
}
|
|
508
|
+
if (tree.exists('eslint.config.mts')) {
|
|
509
|
+
return 'eslint.config.mts';
|
|
510
|
+
}
|
|
511
|
+
if (tree.exists('eslint.config.cts')) {
|
|
512
|
+
return 'eslint.config.cts';
|
|
513
|
+
}
|
|
504
514
|
return null;
|
|
505
515
|
}
|
|
506
516
|
function determineNewProjectESLintConfigContentAndExtension(tree, rootConfigPath, projectRoot) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-eslint/schematics",
|
|
3
|
-
"version": "19.5.1-alpha.
|
|
3
|
+
"version": "19.5.1-alpha.11",
|
|
4
4
|
"description": "Angular Schematics for angular-eslint",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"ignore": "7.0.4",
|
|
42
42
|
"semver": "7.7.2",
|
|
43
43
|
"strip-json-comments": "3.1.1",
|
|
44
|
-
"@angular-eslint/eslint-plugin
|
|
45
|
-
"@angular-eslint/eslint-plugin": "19.5.1-alpha.
|
|
44
|
+
"@angular-eslint/eslint-plugin": "19.5.1-alpha.11",
|
|
45
|
+
"@angular-eslint/eslint-plugin-template": "19.5.1-alpha.11"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@typescript-eslint/utils": "8.32.1",
|