dumb-react icon indicating copy to clipboard operation
dumb-react copied to clipboard

Can I suggest Prettier?

Open montogeek opened this issue 7 years ago • 5 comments

Hi Brad!

Prettier is an amazing project that could help you to format your code automatically, it seems like a good fit for this project.

montogeek avatar May 16 '18 17:05 montogeek

Thanks @montogeek. I have Prettier set up in VSCode, but it formats JSX really wonky. I haven't had time to mess with any of the settings or configuration. Any resources or boilerplate configs that clean this up?

bradfrost avatar May 22 '18 03:05 bradfrost

Wonky how exactly? I am pretty sure @vjeux it is interested.

montogeek avatar May 22 '18 06:05 montogeek

@bradfrost I've had situations in the past where Beautify was fighting Prettier - perhaps you have that plugin installed as well? If you have another IDE-specific formatting plugins, you should consider disabling them on any React workspaces.

kylemh avatar May 23 '18 20:05 kylemh

@kylemh I do have Beautify also installed. Will give that a shot, thanks!

bradfrost avatar May 23 '18 21:05 bradfrost

Prettier is a bit opinionated and maybe has some settings which some dislike. But you can set-up vscode.settings to disable/enable/change some of the predefined rules.

For example I dont like that it always breaks object literal on many lines, even when it is very short, so I turn this rule off

janko-sokolovic avatar May 26 '18 15:05 janko-sokolovic