Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upDisallow template literal placeholder syntax in regular strings (no-template-curly-in-string) #594
Comments
feross
added
feature request
enhancement
and removed
feature request
labels
Aug 19, 2016
feross
modified the milestone:
v8
Aug 19, 2016
feross
closed this
in
standard/eslint-config-standard@afc6a0a
Aug 19, 2016
This comment has been minimized.
This comment has been minimized.
tunnckoCore
commented
Aug 24, 2016
•
|
I don't see fit for this restriction. There may not be failing repos, but that's not the case. It's pretty logical to have some template engine working with that to emulate it intentionally. It's not my case, it's not a problem for me, just wanted to mention it. edit: This one for example https://github.com/tunnckoCore/es6-template (and it's not the only one, i'm sure) - I don't use it, but it would be a problem for someone. |
This comment has been minimized.
This comment has been minimized.
|
@tunnckoCore You can instruct users of polyfills like that one to just add this to the top of their file: /* eslint-disable no-template-curly-in-string */ |
This comment has been minimized.
This comment has been minimized.
tunnckoCore
commented
Aug 25, 2016
|
Huh, actually, yea. Thanks. |
Merged
lock
bot
locked as resolved and limited conversation to collaborators
May 10, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
feross commentedAug 19, 2016
•
edited
ECMAScript 6 allows programmers to create strings containing variable or expressions using template literals, instead of string concatenation, by writing expressions like
${variable}between two backtick quotes (). It can be easy to use the wrong quotes when wanting to use template literals, by writing"${variable}", and end up with the literal value"${variable}"` instead of a string containing the value of the injected expressions.This rule aims to warn when a regular string contains what looks like a template literal placeholder. It will warn when it finds a string containing the template literal place holder (
${something}) that uses either"or'for the quotes.http://eslint.org/docs/rules/no-template-curly-in-string
Likely to be uncontroversial and only one test repo fails so I will merge this into
standardv8 beta.