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.

Default formatting changed in v4

See original GitHub issue

With v4, after formatting JS file, trailing commas are added, and parentheses are added around single arguments.

When I downgrade to v3.20 and reformat, the commas and parentheses are removed.

Additional information

VS Code Version: 1.43.2

Prettier Extension Version: 4.*

OS and version: Mac 10.15.4

Prettier Log Output

["INFO" - 12:50:38 AM] Formatting /Users/me/gh/guide-api/src/resolvers/User.js
["INFO" - 12:50:38 AM] Using ignore file (if present) at /Users/me/gh/guide-api/.prettierignore
["INFO" - 12:50:38 AM] Using bundled version of prettier.
["INFO" - 12:50:38 AM] File Info:
{
  "ignored": false,
  "inferredParser": "babel"
}
["INFO" - 12:50:38 AM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 12:50:38 AM] Prettier Options:
{
  "filepath": "/Users/me/gh/guide-api/src/resolvers/User.js",
  "parser": "babel",
  "singleQuote": true,
  "semi": false
}
["INFO" - 12:50:38 AM] Formatting completed in 30.940685ms.

This bug also experienced by @sbreakey

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
lorensrcommented, Apr 12, 2020

Ah, thanks!

For others: I had to add these lines to my project’s .prettierrc:

trailingComma: none
arrowParens: avoid

Note that a local config file overrides config in VS Code settings.

1reaction
ntottencommented, Apr 12, 2020

This is the expected behavior in the new version of Prettier.

See announcement blog post for changes: https://prettier.io/blog/2020/03/21/2.0.0.html

See VS Code extension docs for how configuration works: https://github.com/prettier/prettier-vscode#configuration

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customize Font & Line Spacing Formatting in Word - YouTube
Microsoft Word Tips, Training, and Software Productivity Lessons from https://TheSoftwarePro.com/Word.How do you change the default ...
Read more >
Change the default font in Word - Microsoft Support
Change the default font in Word · Go to Home, and then select the Font Dialog Box Launcher Button image . · Select...
Read more >
Modifying default format settings - BO 4.0 SP4 - SAP Community
Modifying default format setting. This is for BO 4.0 SP4. I recall in previous versions of BO XI – we used to have...
Read more >
Resetting Default Heading and Body Fonts in Word
Video. Here's how to change MicroSoft Word fonts default heading and body styles — and start every new document with the fonts you...
Read more >
How to Change the Default Format Settings in Eclipse - wikiHow
1. Open the Eclipse program. Click the Window option in the top tool bar and then click Preferences. 2. Using the left side...
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