question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

quotes: avoidEscape option allow the usage of template string

See original GitHub issue

Tell us about your environment

  • ESLint Version: 5.1.0/master
  • Node Version: n/w
  • npm Version: n/w

**What parser (default, Babel-ESLint, etc.) are you using?**default

Please show your full configuration:

Configuration
module.exports = {
extends: ['eslint'],
  rules: {
    "quotes": ["error", "double", {"avoidEscape": true}]
  }
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

var s = `"hello world"`;

What did you expect to happen? no error reported. What actually happened? Please include the actual, raw output from ESLint.

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
not-an-aardvarkcommented, Jul 19, 2018

Also see: https://github.com/eslint/eslint/issues/7660

This is technically working as documented (the avoidEscape option says “allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to be escaped otherwise”, but I’d be fine with changing it as an enhancement.

1reaction
aladdin-addcommented, Mar 17, 2020

ops, thanks for the ping! I like the idea in https://github.com/eslint/eslint/issues/12156, will champion it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

quotes - ESLint - Pluggable JavaScript Linter
Options · "avoidEscape": true allows strings to use single-quotes or double-quotes so long as the string contains a quote that would have to...
Read more >
How to tell eslint that you prefer single quotes around your ...
This rule prefers single quotes, and allows template literals. ... option is to allow single or double quotes as long as the string...
Read more >
quotemark - Rule
Enforces quote character for string literals. ... "avoid-escape" allows you to use the “other” quotemark in cases where escaping would normally be required....
Read more >
Using quotation marks with strings in the AWS CLI
How to correctly use quotes with string values that contain spaces in the AWS CLI.
Read more >
vue/html-quotes
Object option: avoidEscape ... If true , allows strings to use single-quotes or double-quotes so long as the string contains a quote that ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found