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

feat(typescript-estree): disallow switch statements with multiple default cases #8411

Conversation

DMartens
Copy link
Contributor

@DMartens DMartens commented Feb 8, 2024

PR Checklist

Overview

Throw an error if a switch statement has multiple default cases with the same message as the TypeScript diagnostics.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @DMartens!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented Feb 8, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 7dabbce
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/65f4f795904ddf00089e7a08
😎 Deploy Preview https://deploy-preview-8411--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 89 (🔴 down 4 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

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

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 87.72%. Comparing base (c0da420) to head (185b04e).
Report is 111 commits behind head on main.

❗ Current head 185b04e differs from pull request most recent head 7dabbce. Consider uploading reports for the commit 7dabbce to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8411      +/-   ##
==========================================
+ Coverage   86.94%   87.72%   +0.78%     
==========================================
  Files         252      398     +146     
  Lines       12251    13830    +1579     
  Branches     3861     4068     +207     
==========================================
+ Hits        10652    12133    +1481     
- Misses       1332     1400      +68     
- Partials      267      297      +30     
Flag Coverage Δ
unittest 87.72% <0.00%> (+0.78%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
packages/typescript-estree/src/convert.ts 28.80% <0.00%> (-0.11%) ⬇️

... and 146 files with indirect coverage changes

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

LGTM!

Will add 1 approval and leave open for a bit in case @bradzacher wants to review too, since Brad also commented on the issue.

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval PR that a maintainer has LGTM'd - any maintainer can merge this when ready label Feb 23, 2024
@bradzacher bradzacher changed the title feat: disallow switch statements with multiple default cases feat(typescript-estree): disallow switch statements with multiple default cases Mar 16, 2024
bradzacher
bradzacher previously approved these changes Mar 16, 2024
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

@bradzacher bradzacher merged commit 994812b into typescript-eslint:main Mar 16, 2024
56 of 57 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval PR that a maintainer has LGTM'd - any maintainer can merge this when ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Check for switches with multiple default cases
3 participants