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.

Use .prettierrc.json instead of VSCode settings config

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
wgoolsbycommented, Feb 22, 2018

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.

0reactions
github-actions[bot]commented, Apr 12, 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

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 >

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