`quotes` not working with backticks and function string arguments
See original GitHub issueWhat version of ESLint are you using? eslint@2.5.3
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"rules": {
"quotes": [
"error",
"backtick",
"avoid-escape"
]
}
}
What did you do? Please include the actual source code causing the issue.
const foo = `Lorem`;
const bar = `Ipsum ${foo.replace("L", "l")}`;
What did you expect to happen?
For the double quotes in the replace
function to be valid because of the avoid-escape
option.
What actually happened? Please include the actual, raw output from ESLint.
/home/whitneyit/Code/test.js
2:7 error 'bar' is defined but never used no-unused-vars
2:34 error Strings must use backtick quotes
2:39 error Strings must use backtick quotes
Is this the intended behaviour? If not, would you welcome a PR?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Single Quote, Double Quote, and Backticks in MySQL Queries
Inserting two double quotes in the middle of the string will cancel out one of them. Single Quotes. Using single quotes here is...
Read more >Quotes are being treated differently in backtick output [duplicate]
The way it works, is that somecmd gets as argument the string contained in the variable a , regardless of what it contains....
Read more >Back-ticks within double quotes - Stack Overflow
I want to add an argument with back-ticks within the query string. However when I execute it in the terminal the back-ticks get...
Read more >Template literals (Template strings) - JavaScript | MDN
Template literals are enclosed by backtick ( ` ) characters instead of double or single quotes. Along with having normal strings, template ...
Read more >SQL – Single quotes and backticks for query - WordPress.org
In PHP, vars in double quoted strings are automatically replaced with their assigned values. So the single quotes within are just characters, they...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree this isn’t a bug, and I’m not really a fan of changing the error message. Going down that rabbit hole can get very complicated very quickly, for little (if any) gain. Even if there are some unexpected situations like this that cause some research or an issue to check whether it’s a bug, in the end it all worked out and now there’s a github issue that others can learn from as well. So, personally I’m 👎 on any changes here.
Closing this, but feel free to speak up if you think we should reopen.