Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo: Failures on main from switch-exhaustiveness-check.md missing an option heading #8187

Closed
JoshuaKGoldberg opened this issue Jan 4, 2024 · 3 comments · Fixed by #8160
Closed
Labels
accepting prs Go ahead, send a pull request that resolves this issue repo maintenance things to do with maintenance of the repo, and not with code/docs

Comments

@JoshuaKGoldberg
Copy link
Member

Suggestion

This is a fun little combination of merging two PRS into main:

  1. docs(eslint-plugin): enforce a heading for each rule option #8015 enforces all rule options have a heading in their docs file
  2. feat(eslint-plugin): [switch-exhaustiveness-check] add an option to warn against a default case on an already exhaustive switch #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 |                 }
@JoshuaKGoldberg JoshuaKGoldberg added repo maintenance things to do with maintenance of the repo, and not with code/docs accepting prs Go ahead, send a pull request that resolves this issue labels Jan 4, 2024
@auvred
Copy link
Member

auvred commented Jan 4, 2024

Should be fixed in #8160 :)

@JoshuaKGoldberg
Copy link
Member Author

Oof! I almost just did a bad thing: send a PR without checking if a prior one existed. Sorry and thanks for the catch!

@JoshuaKGoldberg
Copy link
Member Author

LOL and I'd approved it too. Whoops.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
2 participants