Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat(eslint-plugin): [restrict-template-expressions] addallowArray
option#8389
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
feat(eslint-plugin): [restrict-template-expressions] addallowArray
option#8389
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…estrict-template-expressions
Thanks for the PR,@abrahamguo! 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 onhttps://opencollective.com/typescript-eslint. |
netlifybot commentedFeb 6, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site configuration. |
allowArray
option forrestrict-template-expressions
allowArray
option forrestrict-template-expressions
nx-cloudbot commentedFeb 6, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
…estrict-template-expressions
allowArray
option forrestrict-template-expressions
allowArray
option forrestrict-template-expressions
…estrict-template-expressions
…estrict-template-expressions
…estrict-template-expressions
codecovbot commentedFeb 19, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## main #8389 +/- ##==========================================- Coverage 87.21% 87.20% -0.01%========================================== Files 251 251 Lines 12315 12308 -7 Branches 3883 3875 -8 ==========================================- Hits 10740 10733 -7 Misses 1305 1305 Partials 270 270
Flags with carried forward coverage won't be shown.Click here to find out 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.
packages/eslint-plugin/src/rules/restrict-template-expressions.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
packages/eslint-plugin/src/rules/restrict-template-expressions.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
packages/eslint-plugin/src/rules/restrict-template-expressions.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
packages/eslint-plugin/src/rules/restrict-template-expressions.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…estrict-template-expressions
…estrict-template-expressions
…estrict-template-expressions
…estrict-template-expressions
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.
Super, looks good to me! Thanks for all the code tinkering. 😄
Leaving open with1 approval
as I know at least@bradzacher has had well-informed thoughts on this family of rules in the past.
…estrict-template-expressions
…estrict-template-expressions
…estrict-template-expressions
allowArray
option forrestrict-template-expressions
allowArray
optionThere 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.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
recursivelyCheckType(type.getNumberIndexType()!), | ||
], | ||
// eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum |
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.
@JoshuaKGoldberg - Originally this rule's purpose was to prevent code likenode.type === 'string'
.
Given we now have theno-unsafe-enum-comparison
rule - do you think this internal rule still has value? WDYT about deleting it? (we already have nuec turned on via the recommended config)
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.
Yeah I'd be in favor of that. It wouldn't be the first example of an internal lint rule ending up as a subset of a general good one.
Uh oh!
There was an error while loading.Please reload this page.
PR Checklist
Overview
I've added a new
allowArray
option that applies the existing checks fromrestrict-template-expressions
recursively (i.e. noundefined
s, etc.).I haven't added unit tests yet but I'd like to begin receiving feedback on this change.