Settings in VSCode's `settings.json` didn't work when there is a `.editorconfig` in the project
See original GitHub issueEnvironments:
- Prettier - Code formatter Version: 3.8.0
- VSCode Version: 1.40.1
- Operating System: win10
Steps to reproduce:
Settings should be read from
- Prettier configuration file
- .editorconfig
- Visual Studio Code Settings
But as long as there’s a .editorconfig
in the project without .prettierrc
, Settings which have been written in the VSCode’s settings.json
are no longer valid, even if they are not mentioned in the .editorconfig
Expected behavior:
Read the settings which are not mentioned in the .editorconfig
from VSCode’s settings.json
Actual behavior:
Read the settings which are not mentioned in the .editorconfig
from prettier’s default settings
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
EditorConfig for VS Code not working - Stack Overflow
It stll doesn't work for me. I installed node, editorconfig package and the vscode extension. Is there something missing? In vscode settings ......
Read more >EditorConfig settings - Visual Studio (Windows) - Microsoft Learn
When you add an EditorConfig file to your project or codebase, any new lines of code you write are formatted according to the...
Read more >EditorConfig for VS Code - Visual Studio Marketplace
This plugin attempts to override user/workspace settings with settings found in .editorconfig files. No additional or vscode-specific files are ...
Read more >How to easily synchronize your configuration with Visual ...
Project scoped configuration is located in the .vscode folder, this folder can contain settings.json file, extensions.json file and files ...
Read more >VS Code tips — The editorconfig extension - YouTube
Today's VS Code extension: editorconfigWith the editorconfig extension, VS Code will pick up basic formatting settings —such as spaces vs ...
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 FreeTop 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
Top GitHub Comments
I’m not a fan of this change because, for all of my Angular projects that had my linting + formatting working a few days ago, I now need to make changes for all of them to be usable.
This seems like a rather large update to prettier that suddenly had me not being able to write code as my formatting and linting were all messed up which muddies git commits with “changes” just due to format.
Instead of dealing with this, I just reverted back to 3.7.0 and everything worked as expected.
I know some people are passionate about this behavior, but there are 500k daily users of this extension and for the vast majority, this behavior is correct.
I might consider adding a setting to merge the editor config and VSCode settings, but that will require changes to prettier itself as right now there is no way to know where prettier resolved the setting from.
To be very honest though, I don’t really put much weight in the argument that you don’t want to add a prettier config file to your project because 1) it takes 15 seconds and 2) it is a best practice when using prettier.
As I explained before, merging by default has a lot of undesirable consequences that are far more important than a simple convenience of not adding a config file.