.prettierrc file not affect on rules
See original GitHub issueHi,I write project using create-react-app and want to integrate prettier with eslint .
My package.json contain :
"eslint-config-prettier": "^2.9.0", "eslint-plugin-prettier": "^2.6.2", "prettier": "^1.13.7", "pretty-quick": "^1.6.0"
.eslintrc file contain:
{ "extends": ["react-app", "plugin:prettier/recommended"], }
Now i have error that annoyed me and i want to cancel him:
[eslint] Replace '../Admin.module.css'
with "../Admin.module.css"
(prettier/prettier)
So , I try to add .prettierrc file to my project and to add him this json:
{ "avoidEscape": true }
and also try to set this:
{ singleQuote: true }
But nothing happened! I try to add also another rules but also nothing happened …it’s looks like this file not affect anything and it’s stay the same What I am doing wrong?
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (2 by maintainers)
I also meet the issue. After a period of trial, I think the eslint plugin of vscode casue the issue. When changing rules in .prettier.js , the eslint server plugged in vsocde doesn’t reload the updated rules. But if you run eslint through terminal, you will find the new rules are applied.
One solution is to reopen the vscode, then eslint server will restart and load the new rules in .prettier.js.
Using the following setup
instead of the shorthand
{ extends: ["react-app", "plugin:prettier/recommended"] }
did the trick for me. Read more about this here. Hope it helps 😃.