Open gunhaxxor opened 4 years ago
Have you add prettier config file for singleQuote? https://prettier.io/docs/en/configuration.html
I don't see why I would need a prettier config?
Shouldn't prettier first run with defaults if no config is found?
Then eslint applies --fix
afterwards which should apply the rules set in .eslintrc.js
?
As described here:
https://github.com/prettier/prettier-eslint#this-solution
Maybe I've misunderstood the procedure?
@Dealerpriest This worked for me:
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
Info
Problem
I have disabled all my extensions. I have uncommented all my user settings. I have made a fresh install of Vetur extension, and Eslint extension.
These are my only settings as per Vetur documentation:
As you can see in the settings, I want to make use of prettier-eslint, which according to Vetur documentation should run
prettier
followed byeslint --fix
when format is performed.I have added the following rule to the file
.eslintrc.js
:Thus I expect Vetur to format my .vue files with single quotes. This is not the case. What am I doing wrong? This is my complete
.eslintrc.js
(the other parts where added by vue-cli when creating the project):Note: I do get linting errors on double quotes reported in the editor as shown by the following screenshot:
But curiously enough, I also get linting error on the single quote (even though the rule is set to use single quotes in .eslintrc.js):
The fact that the editor gives lint error on both single quotes and double quotes is very peculiar.
If I run the
format document
command on the file in the screenshot it will change line 13 from 'Home' to "Home". The rest is left unchanged.Reproducible Case
vue create your-name