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

Enforce switch-exhaustiveness-check #67

Open
kbayliss opened this issue Jul 20, 2022 · 1 comment
Open

Enforce switch-exhaustiveness-check #67

kbayliss opened this issue Jul 20, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@kbayliss
Copy link

I think https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md would be a valuable addition that would make our code less prone to errors.

@thibaudcolas
Copy link
Member

thibaudcolas commented Jul 20, 2022

Seems sensible to me too! Note right now we purposefully avoid any of those rules that rely on type checking (see design decisions) for two reasons:

  • Avoiding them means we can use the exact same configuration for all projects. Using those rules would mean departing from this approach and having separate "vanilla JS" and "TypeScript" configurations.
  • There’s a clear performance cost. We could probably reduce it a fair bit by running ESLint with caching, right now it’s only briefly mentioned in the README but not something we tend to actually have set up.

If we were to compromise on the above two so we can add new rules, I imagine we’d want to add multiple rules that require type checking at the same time to justify the higher cost.

@thibaudcolas thibaudcolas added enhancement New feature or request help wanted Extra attention is needed labels Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants