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.

Still can't format user settings.json in combination with editor.defaultFormatter

See original GitHub issue

Summary

Reopening #911 moved from microsoft/vscode#95468 which was reopening microsoft/vscode#79038.

Prettier appears to not recognize settings.json as a formattable file type. According to Code maintainers it’s because the extension isn’t registering for the appropriate URI scheme: https://github.com/microsoft/vscode/issues/95468#issuecomment-617061736. How can I help?

VS Code Version:

1.45.0-insider

Prettier Extension Version:

4.4.0

OS and version:

Mac OS X 10.15.4 19E287

Prettier Log Output

No log

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
macintacoscommented, May 13, 2020

For others that might come here; this works when you switch settings.json to be associated with the jsonc format (I still got an error when it was considering it a JSON file). You can do this by adding settings.json to the files.associations array in… settings.json 🙂

0reactions
github-actions[bot]commented, Aug 11, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't format user settings.json in vscode · Issue #911 - GitHub
When the option "editor.defaultFormatter": "esbenp.prettier-vscode" in user settings is set is set, one cannot format the settings.json file ...
Read more >
User and Workspace Settings - Visual Studio Code
Settings are written as JSON by specifying the setting ID and value. User settings.json open in the editor. The settings.json file has full...
Read more >
Why does Prettier not format code in VS Code? - Stack Overflow
1 - Select Default Formatter. Open Files -> Preferences -> Settings (or Ctrl + , in Windows). Search for Editor: ...
Read more >
VS Code - You don't need a formatting ... - Rob O'Leary
I don't use React, so I can't comment how well React code is formatted. Settings added to control the formatting of CSS, LESS,...
Read more >
How to configure Prettier and VSCode - Gleb Bahmutov
I like using JSON configuration format so my code editor helps me. ... To use the Prettier we have just installed from VSCode...
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