You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--init Run config initialization wizard - default: false
@@ -904,6 +905,19 @@ Prune unused suppressions from the suppressions file. This option is useful when
904
905
args: ["\"src/**/*.js\"", "--prune-suppressions"]
905
906
}) }}
906
907
908
+
#### `--pass-on-unpruned-suppressions`
909
+
910
+
Ignore unused suppressions. By default, ESLint exits with exit code `2` and displays an error message if there are unused suppressions in the suppressions file. When you use this flag, unused suppressions do not affect the exit code and ESLint doesn't output an error about unused suppressions.
Copy file name to clipboardExpand all lines: docs/src/use/suppressions.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,4 +60,10 @@ To remove the suppressions that are no longer needed, you can use the `--prune-s
60
60
eslint --prune-suppressions
61
61
```
62
62
63
+
To ignore unused suppressions when calculating the exit code and not report an error about unused suppressions, you can use the `--pass-on-unpruned-suppressions` flag.
64
+
65
+
```bash
66
+
eslint --pass-on-unpruned-suppressions
67
+
```
68
+
63
69
For more information on the available CLI options, refer to [Command Line Interface](./command-line-interface).
it("exits with code 1 if there are unsuppressed lint errors, when there are unused suppressions and the --pass-on-unpruned-suppressions flag is used (1)",()=>{
it("exits with code 1 if there are unsuppressed lint errors, when there are unused suppressions and the --pass-on-unpruned-suppressions flag is used (2)",()=>{
0 commit comments