@angular-eslint/builder 19.4.1-alpha.9 → 19.5.0
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 +10 -0
- package/dist/schema.json +5 -0
- package/dist/utils/eslint-utils.d.ts.map +1 -1
- package/dist/utils/eslint-utils.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,3 +5,13 @@ Please see https://github.com/angular-eslint/angular-eslint for full usage instr
|
|
|
5
5
|
The `@angular-eslint/builder` package is a custom Angular CLI builder that allows you to run ESLint on your Angular CLI projects.
|
|
6
6
|
|
|
7
7
|
It wraps the ESLint programmatic node API (https://eslint.org/docs/latest/integrate/nodejs-api) to provide a seamless experience via `ng lint` that is closely equivalent to using the `eslint` CLI directly.
|
|
8
|
+
|
|
9
|
+
## Performance statistics
|
|
10
|
+
|
|
11
|
+
You can profile rule execution times by enabling ESLint's stats output:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
ng lint --stats
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This option requires a flat ESLint configuration (`eslint.config.js/ts/mjs`). Using `--stats` with legacy `.eslintrc.*` files will cause an error.
|
package/dist/schema.json
CHANGED
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"type": "string",
|
|
27
27
|
"description": "File to write report to instead of the console."
|
|
28
28
|
},
|
|
29
|
+
"stats": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"description": "Output performance statistics for ESLint rules",
|
|
32
|
+
"default": false
|
|
33
|
+
},
|
|
29
34
|
"cacheStrategy": {
|
|
30
35
|
"type": "string",
|
|
31
36
|
"description": "Strategy to use for detecting changed files in the cache.",
|
|
@@ -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;AAExC,eAAO,MAAM,wBAAwB,UAIpC,CAAC;AAuBF,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":["../../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;AAExC,eAAO,MAAM,wBAAwB,UAIpC,CAAC;AAuBF,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,OAAO,EAAE,MAAM,EACf,aAAa,UAAQ;;;GA6FtB"}
|
|
@@ -27,6 +27,9 @@ async function resolveESLintClass(useFlatConfig = false) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatConfig = false) {
|
|
30
|
+
if (options.stats && !useFlatConfig) {
|
|
31
|
+
throw new Error('The --stats option requires ESLint Flat Config');
|
|
32
|
+
}
|
|
30
33
|
if (useFlatConfig &&
|
|
31
34
|
eslintConfigPath &&
|
|
32
35
|
!exports.supportedFlatConfigNames.some((name) => eslintConfigPath.endsWith(name))) {
|
|
@@ -51,6 +54,7 @@ async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatCon
|
|
|
51
54
|
errorOnUnmatchedPattern: false,
|
|
52
55
|
};
|
|
53
56
|
if (useFlatConfig) {
|
|
57
|
+
eslintOptions.stats = !!options.stats;
|
|
54
58
|
if (typeof options.useEslintrc !== 'undefined') {
|
|
55
59
|
throw new Error('For Flat Config, the `useEslintrc` option is not applicable. See https://eslint.org/docs/latest/use/configure/configuration-files-new');
|
|
56
60
|
}
|
|
@@ -61,7 +65,7 @@ async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatCon
|
|
|
61
65
|
throw new Error('For Flat Config, ESLint removed `ignorePath` and so it is not supported as an option. See https://eslint.org/docs/latest/use/configure/configuration-files-new');
|
|
62
66
|
}
|
|
63
67
|
if (options.reportUnusedDisableDirectives) {
|
|
64
|
-
throw new Error('For Flat Config, ESLint removed `
|
|
68
|
+
throw new Error('For Flat Config, ESLint removed `reportUnusedDisableDirectives` and so it is not supported as an option. See https://eslint.org/docs/latest/use/configure/configuration-files-new');
|
|
65
69
|
}
|
|
66
70
|
/**
|
|
67
71
|
* Adapted from https://github.com/eslint/eslint/blob/50f03a119e6827c03b1d6c86d3aa1f4820b609e8/lib/cli.js#L144
|