Skip to content

istanbul ignore else #218

@ph-fritsche

Description

@ph-fritsche
  • kcd-scripts version: 11.2.0
  • node version: any
  • npm (or yarn) version: any

Relevant code or config

https://github.com/testing-library/user-event/pull/706/files#diff-79de2fcdb58def5d2000c20beddc4bb5a30488589e20c207181967dd0e75aa72R28

What you did:

Run CI with "kcd-scripts": "^11.1.0".

What happened:

After release of v11.2.0 CI fails due to uncovered lines.
Turns out istanbul expects the /* istanbul ignore else */ right in between else if now.

The pre-commit hook reverts the change and therefore commits fixing this have to be committed with --no-verify.

Reproduction repository:

testing-library/user-event#706

Problem description:

kcd-scripts lint does not flag /* istanbul ignore else */ else if.
kcd-scripts/husky adds a pre-commit hook that changes the (now) correct else /* istanbul ignore else */ if back to /* istanbul ignore else */ else if.

Suggested solution:

Report a lint error for /* istanbul ignore else */ else if.
Lint-fix to else /* istanbul ignore else */ if.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions