Use .prettierrc.json instead of VSCode settings config
See original GitHub issueI’m on Mac OS.
Currently if I utilize the following in the VSCode settings config I’m able to have formatting work on save.
"prettier.eslintIntegration": false,
"editor.formatOnSave": true,
"prettier.printWidth": 120,
"prettier.tabWidth": 2,
"prettier.singleQuote": true,
"prettier.trailingComma": "none",
"prettier.bracketSpacing": true,
"prettier.jsxBracketSameLine": false,
"prettier.parser": "flow",
"prettier.semi": true,
"prettier.useTabs": false,
I’ve recently added a couple developers to my team, so I’ve pulled all of the prettier. things out, except for prettier.eslintIntegration: false. I created a .prettierrc.json that looks like this. It is in the top directory of my project, but when I save, nothing happens.
{
"printWidth": 120,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"parser": "flow",
"semi": true,
"useTabs": false,
}
Is there a config to point to this file or an additional setting to use a configuration file?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to configure Prettier and VSCode - Gleb Bahmutov
I like using JSON configuration format so my code editor helps me. ... Launch VS Code Quick Open (Ctrl+P); Run the following command ......
Read more >visual studio code - prettier settings for vscode - Stack Overflow
Go to FILE -> PREFERENCES -> SETTINGS. (VS Code Menus); Settings window should open. Above (Top) there is a search. Type "Prettier"; You...
Read more >Configuration File - Prettier
This means you can configure Prettier via (in order of precedence):. A "prettier" key in your package.json file. A .prettierrc file written in...
Read more >How to set up Prettier and automatic formatting on VS Code
Once installation is successful, open the settings of your VS Code. You can do this on Windows by pressing both Ctrl and ,...
Read more >How to use Prettier in VS Code - Robin Wieruch
Prettier is an opinionated code formatter which ensures one unified code format. It can be used in VS Code by installing it from...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It is .prettierrc.json Autocorrect got the better of me. Sorry about that.
By nothing I mean, it does absolutely nothing. If i run the cli command the output will respect the .prettierrc.json file, but VSCode acts like the file doesn’t even exist and no formatting takes place when I save or when I choose ‘Format Document’ from the Command Palette.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.