Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use this lib? #350

Closed
Vadorequest opened this issue May 31, 2020 · 7 comments
Closed

How to use this lib? #350

Vadorequest opened this issue May 31, 2020 · 7 comments

Comments

@Vadorequest
Copy link

Vadorequest commented May 31, 2020

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
Copy link
Member

zimme commented May 31, 2020

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

@Blackxes
Copy link

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

@Vadorequest
Copy link
Author

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)

@Blackxes
Copy link

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!

@Vadorequest
Copy link
Author

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.

@Blackxes
Copy link

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.

@Vadorequest
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants