-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Note added by @j-f1:
This is NOT the current plan for Prettier v2.0. We’ve significantly scaled back our plans for what Prettier 2.0 will do, allowing us to get a less-controversial release out sooner: #6888
I've been thinking a bit about what we would do if (don't create a milestone just yet 😉) we were to do a Prettier 2.0 release with some API/CLI breaking changes. No significant changes to code formatting other than perhaps changing some defaults.
Easy?
- Enforce Trailing Commas by Default #68/Can we enable the dangling comma on this project? #3469 - Change default value for
trailingCommato"es5".
The diff advantages alone are excellent, and this seems to be commonplace among the most popular JS projects.
CLI:
-
config file doesn't work at the way other libraries do #2691 - CLI defaults to
"**/*.{js,ts,...}".
People should just be able to doprettier --writewithout passing messy globs #0CJS -
Consider replacing the "parser" option with "language" #2846 - Replace the "parser" option with "language".
e.g.echo ".foo {}" | prettier --language css
Keep--parser flowor perhaps support something like--parser.js flowfor future extensibility. -
Remove
--flow-parseroption.
Has been deprecated for a long time.
For debate
-
Consistently add quotes to object keys #838 - Consistently add quotes to object keys.
e.g. put quotes aroundoriginin this example:const headers = { 'origin': 'foo.com', 'access-control-allow-origin': '*', };
-
Change the default value for
singleQuotetotrue- Airbnb, standard, xo, and probably the majority of JS devs prefer this. Maybe do a Twitter poll to gauge opinions on this.
To be clear, the Airbnb config requires single quotes for JS and double quotes for JSX.
Outdated
-
Consider removing default parser / Skip processing unsupported file types #2884 - Remove the default parser.Fixed by Don't default parser to babylon #4528 -
Space after function keyword - MOVED to #3847! #1139 - Put a space after theninfunction () {}