prettier/prettier-eslint

How to use this lib?

Vadorequest opened this issue · 7 comments

I don't understand how this lib is meant to be used after reading the README and the "Usage" section.

How can it be integrated to a project? Does it need a custom .js script? I'm confused.

I already use eslint, and I wanted to add prettier, but I find it too opinionated and lacks customisation capabilities. So I'm looking for a way to customise prettier, and prettier-eslint looks like what I'm looking for, but I don't understand how I'm supposed to integrate it.

I'm currently working on this PR https://github.com/UnlyEd/next-right-now/pull/76/files

Any help would be appreciated.

zimme commented

Have a look at prettier-eslint-cli for normal usage within a project. This package is just the core that prettier-eslint-cli and editor integrations use

Is there a way to make it format "onsave" ?

The script is too slow for an on-save event IMHO, it's around 1mn on my computer.

It's even too slow for a pre-hook commit/push... (fault to prettier, which is damn slow when running through eslint)

Ah man this is so unlucky.. Prettier is so nice, but does not support lots of options and eslint does. Now there is a sollution for both but to slow .. feelsbadman

Thanks for the answer!

Yeah, I'm in the same situation, looking for a way to integrate prettier within https://github.com/UnlyEd/next-right-now but it's quite a challenge...

Prettier in itself is very bad, it basically make the code look worse and less maintainable.
Using eslint to override its behaviour seems like the way to go, but it is very hard to setup (seriously, I've got like 5 plugins and 4 extends to look at, it's nightmarish)

image

image

And on top of that, there are erratical inconsistent behaviour between eslint and prettier rules, despite using plugins supposedly meant to fix those things.

And... it doesn't work (prettier rules override my eslint config)

And... I still have to figure out how to make WebStorm work with all that.

Not really the 30sec setup your read on the web, not if you don't want your code to look like shit.

Fun thing is i only want to change one option. The brace-style because i have problems viewing code with the collapsed version. And there is even a 3+ years disguting on prettiers github issue. Oh well i would really like to help but i sadly dont have time to get into that and rely on those who are already in that.

@Blackxes @zimme FYI I've open prettier/prettier#8507 and you may want to give your feedback on it, about how Prettier could make code quality its main goal.