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

infra(typescript-eslint): switch-exhaustiveness-check #2519

Merged
merged 8 commits into from
Nov 7, 2023

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Oct 31, 2023

Ref: #2508


Enables the @typescript-eslint/switch-exhaustiveness-check lint rule.

This removes default cases that are already covered by the explicit case statements on union types. Delayed to v9.

There are some non-union type switch cases that aren't exhaustive, and won't be detected by typescript-eslint.
I will create a separate issue for that on typescript-eslint's side.


Related Issues and PRs:

@ST-DDT ST-DDT added p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug c: infra Changes to our infrastructure or project setup labels Oct 31, 2023
@ST-DDT ST-DDT added this to the vAnytime milestone Oct 31, 2023
@ST-DDT ST-DDT requested review from a team October 31, 2023 19:14
@ST-DDT ST-DDT self-assigned this Oct 31, 2023
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Merging #2519 (4e600b8) into next (6f977f6) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2519      +/-   ##
==========================================
- Coverage   99.57%   99.57%   -0.01%     
==========================================
  Files        2787     2787              
  Lines      249373   249376       +3     
  Branches     1079     1080       +1     
==========================================
+ Hits       248316   248318       +2     
- Misses       1029     1030       +1     
  Partials       28       28              
Files Coverage Δ
src/modules/color/index.ts 99.79% <100.00%> (+<0.01%) ⬆️

... and 2 files with indirect coverage changes

Copy link
Contributor

@matthewmayer matthewmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this change the behavior when called from JavaScript?

@ST-DDT
Copy link
Member Author

ST-DDT commented Nov 1, 2023

Yes, it does. Should we delay the default removal to v9? (Although I consider those bad arguments unsupported usage anyway)

@matthewmayer
Copy link
Contributor

matthewmayer commented Nov 1, 2023

i support including this in v9.

@matthewmayer matthewmayer added the breaking change Cannot be merged when next version is not a major release label Nov 1, 2023
@matthewmayer matthewmayer modified the milestones: vAnytime, v9.0 Nov 1, 2023
@ST-DDT ST-DDT removed the breaking change Cannot be merged when next version is not a major release label Nov 1, 2023
@ST-DDT ST-DDT modified the milestones: v9.0, vAnytime Nov 1, 2023
Copy link
Contributor

@matthewmayer matthewmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good without the breaking changes

@ST-DDT
Copy link
Member Author

ST-DDT commented Nov 1, 2023

@matthewmayer I reverted the breaking changes for now, so we can enable this rule.
I will create a new PR once the additional options have been added to the rule by typescript-eslint.

@ST-DDT ST-DDT requested review from a team November 1, 2023 10:07
@ST-DDT ST-DDT enabled auto-merge (squash) November 7, 2023 22:37
@ST-DDT ST-DDT merged commit fa26a44 into next Nov 7, 2023
20 checks passed
@ST-DDT ST-DDT deleted the infra/typescript-eslint/switch-exhaustiveness-check branch November 7, 2023 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: infra Changes to our infrastructure or project setup p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants