-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): add rule restrict-template-expressions #850
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(eslint-plugin): add rule restrict-template-expressions #850
Conversation
Thanks for the PR, @phaux! 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 |
Would it be possible to allow |
Instead of options like |
@glen-84 Noted. @ckknight I was actually considering going into the other direction: allow "loose" option which enables all types which have obvious string representation, but later I split that into 3 separate options. Having 5 options is too much IMO. Also, I can't think of a case where you would want only one of |
packages/eslint-plugin/docs/rules/restrict-template-expressions.md
Outdated
Show resolved
Hide resolved
packages/eslint-plugin/docs/rules/restrict-template-expressions.md
Outdated
Show resolved
Hide resolved
@phaux I'm not sure how common it would be, but one advantage of using a more generic filter would be an ability to allow some application-specific types with expected |
…s.md Co-Authored-By: ark120202 <ark120202@gmail.com>
…s.md Co-Authored-By: ark120202 <ark120202@gmail.com>
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.
LGTM - thanks for this!
Codecov Report
@@ Coverage Diff @@
## master #850 +/- ##
==========================================
+ Coverage 94.17% 94.22% +0.05%
==========================================
Files 124 125 +1
Lines 5322 5371 +49
Branches 1492 1509 +17
==========================================
+ Hits 5012 5061 +49
Misses 177 177
Partials 133 133
|
Closes #818
(I'm submitting these PRs via VSCode extension and that's why I have to edit the title afterwards)