Skip to content

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

Closed
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

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 |                 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuerepo maintenancethings to do with maintenance of the repo, and not with code/docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions