-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(typescript-estree): forbid invalid keys in EnumMember
#11232
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR, @fisker! 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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
View your CI Pipeline Execution ↗ for commit 8908efb.
☁️ Nx Cloud last updated this comment at |
45c92cb
to
82e8533
Compare
// Unknown reason, can't get the correct type | ||
const id = node.id as TSESTree.Identifier | TSESTree.StringLiteral; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the build script is using the published package instead of local one. I tried to use workspace:^
, but still can't build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be due to nx not seeing the changes to ast-spec
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know how to fix? Or should I leave it?
Codecov ReportAttention: Patch coverage is
❌ Your patch check has failed because the patch coverage (69.04%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #11232 +/- ##
==========================================
- Coverage 90.85% 90.83% -0.03%
==========================================
Files 501 501
Lines 50901 50922 +21
Branches 8383 8381 -2
==========================================
+ Hits 46248 46253 +5
- Misses 4638 4654 +16
Partials 15 15
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Wait for microsoft/TypeScript#61772 |
microsoft/TypeScript#61772 has been fixed. |
f60ffa6
to
e45b631
Compare
EnumMember
EnumMember
const computed = node.name.kind === ts.SyntaxKind.ComputedPropertyName; | ||
if (computed) { | ||
this.#throwUnlessAllowInvalidAST( | ||
node.name, | ||
'Computed property names are not allowed in enums.', | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like computed members are still allowed in the nightly (which includes the fix for microsoft/TypeScript#61772)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
microsoft/TypeScript#61772 forbids bigint, may computed string literals not be forbidden? I'll ask.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test for it 8908efb
(#11232), TS already confirmed it's bug. Should be good to forbid.
// Unknown reason, can't get the correct type | ||
const id = node.id as TSESTree.Identifier | TSESTree.StringLiteral; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be due to nx not seeing the changes to ast-spec
?
2d56333
to
fcc7712
Compare
PR Checklist
Overview