@angular-eslint/builder 21.4.1-alpha.4 → 21.4.1-alpha.5

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 CHANGED
@@ -15,3 +15,33 @@ ng lint --stats
15
15
  ```
16
16
 
17
17
  This option requires a flat ESLint configuration (`eslint.config.js/ts/mjs`). Using `--stats` with legacy `.eslintrc.*` files will cause an error.
18
+
19
+ ## Bulk suppressions
20
+
21
+ ESLint introduced bulk suppressions in v9.24. This allows you to enable new lint rules without having to fix every existing violation first. For details, see https://eslint.org/docs/latest/use/suppressions. In ESLint v10.1 a subset of the suppressions functionality was added to the Node.js API (https://eslint.org/blog/2026/03/eslint-v10.1.0-released/#api-support-for-bulk-suppressions).
22
+
23
+ You can now apply suppressions that were previously generated with the ESLint CLI. You can also set the location of the suppressions file that should be used. Currently it is not possible to create new suppressions or prune suppressions via the Node.js API (https://eslint.org/docs/latest/use/suppressions#usage-with-the-nodejs-api). This has to be done by using the ESLint CLI.
24
+
25
+ To apply suppressions you have to either use the CLI flag
26
+
27
+ ```bash
28
+ ng lint --apply-suppressions --suppressions-location="/path/to/eslint-suppressions.json"
29
+ ```
30
+
31
+ or add the option in `angular.json`:
32
+
33
+ ```json
34
+ ...
35
+ "lint": {
36
+ "builder": "@angular-eslint/builder:lint",
37
+ "options": {
38
+ "applySuppressions": true,
39
+ "suppressionsLocation": "/path/to/eslint-suppressions.json"
40
+ }
41
+ }
42
+ ...
43
+ ```
44
+
45
+ The `suppressionsLocation` defaults to `{workspaceRoot}/eslint-suppressions.json`.
46
+
47
+ While setting `suppressionsLocation` without `applySuppressions` is allowed (because it could be used with `--suppress-all` in the future), it currently does nothing.
@@ -1 +1 @@
1
- {"version":3,"file":"lint.impl.d.ts","sourceRoot":"","sources":["../src/lint.impl.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;;AAMvC,wBAwOE"}
1
+ {"version":3,"file":"lint.impl.d.ts","sourceRoot":"","sources":["../src/lint.impl.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;;AAMvC,wBA6OE"}
package/dist/lint.impl.js CHANGED
@@ -35,6 +35,9 @@ exports.default = (0, architect_1.createBuilder)(async (options, context) => {
35
35
  ? (0, path_1.join)(options.cacheLocation, projectName)
36
36
  : null;
37
37
  options.applySuppressions = options.applySuppressions ?? false;
38
+ options.suppressionsLocation = options.suppressionsLocation
39
+ ? (0, path_1.resolve)(systemRoot, options.suppressionsLocation)
40
+ : null;
38
41
  /**
39
42
  * Until ESLint v9 is released and the new so called flat config is the default
40
43
  * we only want to support it if the user has explicitly opted into it by converting
package/dist/schema.json CHANGED
@@ -131,6 +131,10 @@
131
131
  "applySuppressions": {
132
132
  "type": "boolean",
133
133
  "description": "The equivalent of the `--apply-suppressions` flag on the ESLint CLI."
134
+ },
135
+ "suppressionsLocation": {
136
+ "type": "string",
137
+ "description": "The equivalent of the `--suppressions-location` flag on the ESLint CLI."
134
138
  }
135
139
  },
136
140
  "additionalProperties": false,
@@ -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,UAOpC,CAAC;AAiDF,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,OAAO,EAAE,MAAM,EACf,aAAa,UAAQ;;;GA8GtB"}
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,UAOpC,CAAC;AAiDF,wBAAsB,2BAA2B,CAC/C,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,OAAO,EAAE,MAAM,EACf,aAAa,UAAQ;;;GAuHtB"}
@@ -46,6 +46,9 @@ async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatCon
46
46
  if (options.applySuppressions && !useFlatConfig) {
47
47
  throw new Error('The --apply-suppressions option requires ESLint Flat Config');
48
48
  }
49
+ if (options.suppressionsLocation && !useFlatConfig) {
50
+ throw new Error('The --suppressions-location option requires ESLint Flat Config');
51
+ }
49
52
  if (useFlatConfig &&
50
53
  eslintConfigPath &&
51
54
  !exports.supportedFlatConfigNames.some((name) => eslintConfigPath.endsWith(name))) {
@@ -79,6 +82,9 @@ async function resolveAndInstantiateESLint(eslintConfigPath, options, useFlatCon
79
82
  if (options.applySuppressions) {
80
83
  eslintOptions.applySuppressions = true;
81
84
  }
85
+ if (options.suppressionsLocation) {
86
+ eslintOptions.suppressionsLocation = options.suppressionsLocation;
87
+ }
82
88
  if (typeof options.useEslintrc !== 'undefined') {
83
89
  throw new Error('For Flat Config, the `useEslintrc` option is not applicable. See https://eslint.org/docs/latest/use/configure/configuration-files-new');
84
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/builder",
3
- "version": "21.4.1-alpha.4",
3
+ "version": "21.4.1-alpha.5",
4
4
  "description": "Angular CLI builder for ESLint",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",