You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following bug can be reproduced with VS Code Version 1.9.1 (1.9.1) and its ESLint plugin v1.2.6. Note that I have "eslint.autoFixOnSave": true in my VS Code config.
This is the relevant configuration in my .eslintrc.js:
It means that quotes should always be single quotes, unless there is one that needs to be escaped in the string. It also means that the properties of an object should never have quotes, unless it's needed. In this case, all the properties of the object should have quotes.
Here is some valid code:
varclusterCache={c_ucmc: {},c_cal: {},};
If I want to add the property c-mgmt, I need to use quotes (otherwise it's not valid JavaScript):
Why is VS Code fixing it differently than barebone ESLint v3.16.0? And why can't it fix the fact that there are double quotes after inserting them? Thanks :)
The text was updated successfully, but these errors were encountered:
ESLint when called with --fix runs the fixing strategy n times until no new fixes are computed. The ESLint plugin currently only runs the fixing strategy once.
Dups #154 which explains the problems around this more deeply.
The following bug can be reproduced with VS Code
Version 1.9.1 (1.9.1)
and its ESLint plugin v1.2.6. Note that I have"eslint.autoFixOnSave": true
in my VS Code config.This is the relevant configuration in my
.eslintrc.js
:It means that quotes should always be single quotes, unless there is one that needs to be escaped in the string. It also means that the properties of an object should never have quotes, unless it's needed. In this case, all the properties of the object should have quotes.
Here is some valid code:
If I want to add the property
c-mgmt
, I need to use quotes (otherwise it's not valid JavaScript):If I save the file, VS Code autofix it to:
Which then triggers 2 errors for the
quotes
rule, and it can't fix them!If I don't use VS Code to autofix and run
./node_modules/.bin/eslint file.js --fix
(ESLint v3.16.0) instead, the result is (as expected):Why is VS Code fixing it differently than barebone ESLint v3.16.0? And why can't it fix the fact that there are double quotes after inserting them? Thanks :)
The text was updated successfully, but these errors were encountered: