question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Settings in VSCode's `settings.json` didn't work when there is a `.editorconfig` in the project

See original GitHub issue

Environments:

  • Prettier - Code formatter Version: 3.8.0
  • VSCode Version: 1.40.1
  • Operating System: win10

Steps to reproduce:

Settings should be read from

  1. Prettier configuration file
  2. .editorconfig
  3. 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
znorman-harriscommented, Nov 22, 2019

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.

0reactions
ntottencommented, Nov 28, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found