Skip to content

feat(typescript): add ts/switch-exhaustiveness-check rule#508

Merged
antfu merged 1 commit intoantfu:mainfrom
ryoppippi:feature/add-switch-exaustive
Jun 19, 2024
Merged

feat(typescript): add ts/switch-exhaustiveness-check rule#508
antfu merged 1 commit intoantfu:mainfrom
ryoppippi:feature/add-switch-exaustive

Conversation

@ryoppippi
Copy link
Copy Markdown
Contributor

@ryoppippi ryoppippi commented Jun 18, 2024

This commit adds the 'ts/switch-exhaustiveness-check' rule to the TypeScript configuration. This rule helps ensure that all possible cases in a switch statement are handled.
https://typescript-eslint.io/rules/switch-exhaustiveness-check
Without this PR, it causes an error like below:

Error: Error while loading rule 'ts/switch-exhaustiveness-check': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
Parser: undefined
Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.```

This commit adds the 'ts/switch-exhaustiveness-check' rule to the
TypeScript configuration. This rule helps ensure that all possible
cases in a switch statement are handled.
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 18, 2024

Deploy Preview for melodious-froyo-4871f8 ready!

Name Link
🔨 Latest commit 5838e89
🔍 Latest deploy log https://app.netlify.com/sites/melodious-froyo-4871f8/deploys/667217498b59f000080f6bea
😎 Deploy Preview https://deploy-preview-508--melodious-froyo-4871f8.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@antfu antfu changed the title feat(typescript): add switch-exhaustiveness-check rule feat(typescript): add ts/switch-exhaustiveness-check rule Jun 19, 2024
@antfu antfu merged commit 33c6327 into antfu:main Jun 19, 2024
@ryoppippi ryoppippi deleted the feature/add-switch-exaustive branch June 19, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants