-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuerepo maintenancethings to do with maintenance of the repo, and not with code/docsthings to do with maintenance of the repo, and not with code/docs
Description
Suggestion
This is a fun little combination of merging two PRS into main
:
- docs(eslint-plugin): enforce a heading for each rule option #8015 enforces all rule options have a heading in their docs file
- feat(eslint-plugin): [switch-exhaustiveness-check] add an option to warn against a
default
case on an already exhaustiveswitch
#7539 added a rule option without a heading (it was authored before that requirement)
Example failure from https://github.com/typescript-eslint/typescript-eslint/actions/runs/7359437354/job/20034331434?pr=8011:
Summary of all failing tests
FAIL tests/docs.test.ts (182 MB heap size)
● Validating rule docs › switch-exhaustiveness-check.md › each rule option should be mentioned in a heading
At least one header should include `allowDefaultCaseForExhaustiveSwitch`.
172 | )) {
173 | if (!headingTextAfterOptions.includes(`\`${property}\``)) {
> 174 | throw new Error(
| ^
175 | `At least one header should include \`${property}\`.`,
176 | );
177 | }
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuerepo maintenancethings to do with maintenance of the repo, and not with code/docsthings to do with maintenance of the repo, and not with code/docs