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 upv14 --fix rewrites `a 'b' c` to 'a \'b\' c' instead of "a 'b' c" #1380
Comments
This comment has been minimized.
This comment has been minimized.
|
I agree with you that this fix is not ideal. Double quotes would be better. The fix for this would need to go into ESLint in this file: https://github.com/eslint/eslint/blob/master/lib/rules/quotes.js It looks like we'd need to take into account the value of the @wmhilton As a next step, would you like to open this as an issue on ESLint to see what they think of the idea? |
feross
added
blocked
bug
labels
Aug 19, 2019
This comment has been minimized.
This comment has been minimized.
done |
This comment has been minimized.
This comment has been minimized.
|
Cool, let's wait to see how that issue discussion goes: eslint/eslint#12129 |
This comment has been minimized.
This comment has been minimized.
|
@wmhilton FYI, there's a new issue opened with a proposed solution to this and other problems with the |
wmhilton commentedAug 19, 2019
What version of this package are you using?
v14.0.0
What operating system, Node.js, and npm version?
node v10.15.3
What happened?
standard --fixrewrote my template strings (containing single quotes) into single quote strings (containing escaped single quotes):e.g.
What did you expect to happen?
I didn't expect that. Like... I'm a little sad that it rewrote my template strings at all, but short of reverting #838, at worst --fix should rewrite them using double quotes like,
+ expect(await fs.exists(`${dir}/a.txt`)).toBe(true, "'a.txt' exists")Are you willing to submit a pull request to fix this bug?
Maybe? If someone can point me at what file does the
--fixbehavior shouldn't be too hard for me to figure out.