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
Update: Add disallowTemplateShorthand option in no-implicit-coercion #13579
Update: Add disallowTemplateShorthand option in no-implicit-coercion #13579
Conversation
Since the linked issue wasn't accepted, we'll need to go through the acceptance process in this PR. I've added my support for the proposal. |
This also resolves a race condition in the fixers of Input '' + foo; Output when autofixed by `${foo}`; Output by no-implicit-coercion String(foo); This option will still trigger |
I’m not getting a lot of feedback. As far as I can tell this pull request can be merged. Does this require any actions from my side? |
@remcohaszing this enhancement hasn't been accepted yet, per our process it still needs a champion from the team. |
I can champion this. |
…nt#12866) This adds the `templateString` option to `no-implicit-coercion`. This makes the rule report the following code: ```js `${foo}` ``` For backwards compatibility, this was added as a separate option instead of as default behaviour.
6f9144d
to
bdfe13e
Compare
Note that the `templateString` option isn’t affected by the `string` option.
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.
@remcohaszing thanks for the quick responses! This looks good, I have only some small suggestions about the documentation.
Co-authored-by: Milos Djermanovic <milos.djermanovic@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!
Thanks for contributing! |
Thanks for your code reviews! |
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[x] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
This adds the
templateString
option tono-implicit-coercion
. This makes therule report the following code:
`${foo}`
For backwards compatibility, this was added as a separate option instead of as
default behaviour.
Is there anything you'd like reviewers to focus on?
Closes #12866