Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kirkwaiblinger
Copy link
Member

PR Checklist

Overview

The problem was not about which type was the switch argument and which was the case, and more so about the fact that the rule didn't consider unions of number literals to be numbers (and ditto for strings).

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @kirkwaiblinger!

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.

@netlify
Copy link

netlify bot commented Sep 12, 2025

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit e74b701
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/68c4953da3f97000088006af
😎 Deploy Preview https://deploy-preview-11599--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: 90 (🟢 up 4 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (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 project configuration.

@kirkwaiblinger kirkwaiblinger added bug Something isn't working 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge and removed 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labels Sep 12, 2025
@nx-cloud
Copy link

nx-cloud bot commented Sep 12, 2025

View your CI Pipeline Execution ↗ for commit e74b701

Command Status Duration Result
nx test eslint-plugin --coverage=false ✅ Succeeded 5m 6s View ↗
nx run-many -t lint ✅ Succeeded 3m 12s View ↗
nx run-many -t typecheck ✅ Succeeded 2m 9s View ↗
nx test eslint-plugin-internal --coverage=false ✅ Succeeded 4s View ↗
nx test typescript-estree --coverage=false ✅ Succeeded 2s View ↗
nx run integration-tests:test ✅ Succeeded 4s View ↗
nx run types:build ✅ Succeeded 5s View ↗
nx run generate-configs ✅ Succeeded 7s View ↗
Additional runs (27) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-09-12 22:00:17 UTC

@codecov
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.90%. Comparing base (95c7287) to head (f502178).

⚠️ Current head f502178 differs from pull request most recent head e74b701

Please upload reports for the commit e74b701 to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11599   +/-   ##
=======================================
  Coverage   90.90%   90.90%           
=======================================
  Files         505      505           
  Lines       51208    51218   +10     
  Branches     8441     8444    +3     
=======================================
+ Hits        46551    46561   +10     
  Misses       4644     4644           
  Partials       13       13           
Flag Coverage Δ
unittest 90.90% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
...lint-plugin/src/rules/no-unsafe-enum-comparison.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

👌 nice.

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Sep 15, 2025
@JoshuaKGoldberg JoshuaKGoldberg merged commit 20c3d97 into typescript-eslint:main Sep 22, 2025
61 checks passed
@kirkwaiblinger kirkwaiblinger deleted the support-unions-in-nuec branch September 22, 2025 14:16
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Sep 23, 2025
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.44.0 | 8.44.1 |
| npm        | @typescript-eslint/parser        | 8.44.0 | 8.44.1 |


## [v8.44.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8441-2025-09-22)

##### 🩹 Fixes

- **eslint-plugin:** \[await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal ([#11611](typescript-eslint/typescript-eslint#11611))
- **eslint-plugin:** \[no-unsafe-enum-comparison] support unions of literals ([#11599](typescript-eslint/typescript-eslint#11599))
- **eslint-plugin:** \[no-base-to-string] make ignoredTypeNames match type names without generics ([#11597](typescript-eslint/typescript-eslint#11597))

##### ❤️ Thank You

- Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)
- mdm317
- Ronen Amiel

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Sep 25, 2025
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.44.0 | 8.44.1 |
| npm        | @typescript-eslint/parser        | 8.44.0 | 8.44.1 |


## [v8.44.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8441-2025-09-22)

##### 🩹 Fixes

- **eslint-plugin:** \[await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal ([#11611](typescript-eslint/typescript-eslint#11611))
- **eslint-plugin:** \[no-unsafe-enum-comparison] support unions of literals ([#11599](typescript-eslint/typescript-eslint#11599))
- **eslint-plugin:** \[no-base-to-string] make ignoredTypeNames match type names without generics ([#11597](typescript-eslint/typescript-eslint#11597))

##### ❤️ Thank You

- Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)
- mdm317
- Ronen Amiel

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Sep 26, 2025
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.44.0 | 8.44.1 |
| npm        | @typescript-eslint/parser        | 8.44.0 | 8.44.1 |


## [v8.44.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8441-2025-09-22)

##### 🩹 Fixes

- **eslint-plugin:** \[await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal ([#11611](typescript-eslint/typescript-eslint#11611))
- **eslint-plugin:** \[no-unsafe-enum-comparison] support unions of literals ([#11599](typescript-eslint/typescript-eslint#11599))
- **eslint-plugin:** \[no-base-to-string] make ignoredTypeNames match type names without generics ([#11597](typescript-eslint/typescript-eslint#11597))

##### ❤️ Thank You

- Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)
- mdm317
- Ronen Amiel

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Sep 27, 2025
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.44.0 | 8.44.1 |
| npm        | @typescript-eslint/parser        | 8.44.0 | 8.44.1 |


## [v8.44.1](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8441-2025-09-22)

##### 🩹 Fixes

- **eslint-plugin:** \[await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal ([#11611](typescript-eslint/typescript-eslint#11611))
- **eslint-plugin:** \[no-unsafe-enum-comparison] support unions of literals ([#11599](typescript-eslint/typescript-eslint#11599))
- **eslint-plugin:** \[no-base-to-string] make ignoredTypeNames match type names without generics ([#11597](typescript-eslint/typescript-eslint#11597))

##### ❤️ Thank You

- Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)
- mdm317
- Ronen Amiel

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: [no-unsafe-enum-comparison] should report when union is in switch and cases have union type

2 participants