Automattic / wp-prettier

Prettier is an opinionated JavaScript formatter.
https://prettier.github.io/prettier/
MIT License
51 stars 1 forks source link

Options: Trailing Commas Compatibility #5

Closed samouri closed 7 years ago

samouri commented 7 years ago

We should use es5 instead of all for our trailing comma option. We still have many scripts that get run via node without compiling and it would be nice to be able to use this project to format them.

Inspired from here.

The argument against this would be: trailing commas are great and make our diffs easier to read. Lets just not use prettier on things that need to be es5 compat. I don't think this argument holds any weight against the argument for it.

dmsnell commented 7 years ago

On the other hand, I believe that Node v8+ natively handles trailing commas…how long until we update?

samouri commented 7 years ago

October. Not worth it.

Especially considering we can trivially run prettier on all /** format */ files once we upgrade.