Commit 0dd9704
feat: Support custom severity when reporting unused disable directives (#17212)
* feat: Support custom severity when reporting unused disable directives
* fix test
* remove change to conf/default-cli-options.js
* improve schema
* wip
* remove reportUnusedDisableDirectives from processOptions() in favor of overrideConfig
* revert changes to lib/eslint/eslint.js and fix more tests
* remove old type
* more tests
* fix comment for ParsedCLIOptions
* remove unnecessary exception
* revert comment
* remove number severity
* fix translateOptions and tests
* revert comment
* Update lib/cli.js
Co-authored-by: Milos Djermanovic <[email protected]>
* Update lib/options.js
Co-authored-by: Milos Djermanovic <[email protected]>
* Update docs/src/use/command-line-interface.md
Co-authored-by: Milos Djermanovic <[email protected]>
* Update lib/cli-engine/cli-engine.js
Co-authored-by: Milos Djermanovic <[email protected]>
* Update lib/cli-engine/cli-engine.js
Co-authored-by: Milos Djermanovic <[email protected]>
* Update lib/shared/types.js
Co-authored-by: Milos Djermanovic <[email protected]>
* Update lib/shared/types.js
Co-authored-by: Milos Djermanovic <[email protected]>
* add arg type to doc
* mention enable
* warn with old option
* remove old comment
* revert change to tests/lib/eslint/eslint.js
* add test for removed option
* revert copy change
* switch several tests from boolean for reportUnusedDisableDirectives to string
* improve tests
* use reportUnusedDisableDirectives: error in eslint-config-eslint
* support severity numbers
* refactor
* revert newline change
* refactor and fix tests
* refactor
* cleanup
* cleanup
* use normalizeSeverityToString in another place
* tweak
* attempt to avoid test pollution
* tweak test name
* remove boolean handling from normalizeSeverityToString
* Update docs/src/use/command-line-interface.md
Co-authored-by: Milos Djermanovic <[email protected]>
* Update docs/src/use/command-line-interface.md
Co-authored-by: Milos Djermanovic <[email protected]>
* Update docs/src/use/command-line-interface.md
Co-authored-by: Milos Djermanovic <[email protected]>
* cleanup
* normalize flat config reportUnusedDisableDirectives to number
* Update lib/options.js
Co-authored-by: Milos Djermanovic <[email protected]>
* Update lib/cli.js
Co-authored-by: Milos Djermanovic <[email protected]>
* Update lib/cli.js
Co-authored-by: Milos Djermanovic <[email protected]>
* remove unused reportUnusedDisableDirectives property
* run CLI tests for both flat and eslintrc
* Update tests/lib/eslint/flat-eslint.js
Co-authored-by: Milos Djermanovic <[email protected]>
* Update tests/lib/eslint/flat-eslint.js
Co-authored-by: Milos Djermanovic <[email protected]>
* Update docs/src/use/configure/rules.md
Co-authored-by: Milos Djermanovic <[email protected]>
* address pr feedback
---------
Co-authored-by: Milos Djermanovic <[email protected]>1 parent 31a7e3f commit 0dd9704
18 files changed
Lines changed: 509 additions & 67 deletions
File tree
- docs/src/use
- configure
- lib
- cli-engine
- config
- eslint
- linter
- packages/eslint-config-eslint
- tests/lib
- config
- eslint
- linter
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
582 | 583 | | |
583 | 584 | | |
584 | 585 | | |
585 | | - | |
| 586 | + | |
586 | 587 | | |
587 | 588 | | |
588 | 589 | | |
| |||
591 | 592 | | |
592 | 593 | | |
593 | 594 | | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
594 | 612 | | |
595 | 613 | | |
596 | 614 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
261 | 263 | | |
262 | 264 | | |
263 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
| 578 | + | |
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
128 | 138 | | |
129 | 139 | | |
130 | 140 | | |
| |||
177 | 187 | | |
178 | 188 | | |
179 | 189 | | |
180 | | - | |
181 | | - | |
| 190 | + | |
182 | 191 | | |
183 | 192 | | |
184 | 193 | | |
| |||
190 | 199 | | |
191 | 200 | | |
192 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
193 | 207 | | |
194 | 208 | | |
195 | 209 | | |
| |||
386 | 400 | | |
387 | 401 | | |
388 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
389 | 408 | | |
390 | 409 | | |
391 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
265 | 286 | | |
266 | 287 | | |
267 | 288 | | |
| |||
534 | 555 | | |
535 | 556 | | |
536 | 557 | | |
537 | | - | |
| 558 | + | |
538 | 559 | | |
539 | 560 | | |
540 | 561 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
678 | | - | |
679 | 678 | | |
680 | 679 | | |
681 | 680 | | |
| |||
720 | 719 | | |
721 | 720 | | |
722 | 721 | | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
723 | 725 | | |
724 | 726 | | |
725 | 727 | | |
| |||
774 | 776 | | |
775 | 777 | | |
776 | 778 | | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | 779 | | |
786 | 780 | | |
787 | 781 | | |
| |||
806 | 800 | | |
807 | 801 | | |
808 | 802 | | |
809 | | - | |
810 | 803 | | |
811 | 804 | | |
812 | 805 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | 87 | | |
89 | 88 | | |
90 | 89 | | |
| |||
449 | 448 | | |
450 | 449 | | |
451 | 450 | | |
452 | | - | |
453 | 451 | | |
454 | 452 | | |
455 | 453 | | |
| |||
461 | 459 | | |
462 | 460 | | |
463 | 461 | | |
464 | | - | |
465 | 462 | | |
466 | 463 | | |
467 | 464 | | |
| |||
481 | 478 | | |
482 | 479 | | |
483 | 480 | | |
484 | | - | |
485 | 481 | | |
486 | 482 | | |
487 | 483 | | |
| |||
749 | 745 | | |
750 | 746 | | |
751 | 747 | | |
752 | | - | |
753 | 748 | | |
754 | 749 | | |
755 | 750 | | |
| |||
859 | 854 | | |
860 | 855 | | |
861 | 856 | | |
862 | | - | |
863 | 857 | | |
864 | 858 | | |
865 | 859 | | |
| |||
944 | 938 | | |
945 | 939 | | |
946 | 940 | | |
947 | | - | |
948 | 941 | | |
949 | 942 | | |
950 | 943 | | |
| |||
968 | 961 | | |
969 | 962 | | |
970 | 963 | | |
971 | | - | |
972 | 964 | | |
973 | 965 | | |
974 | 966 | | |
| |||
0 commit comments