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

Run Prettier standalone #10411

Open
jelhan opened this issue Dec 4, 2023 · 2 comments
Open

Run Prettier standalone #10411

jelhan opened this issue Dec 4, 2023 · 2 comments

Comments

@jelhan
Copy link
Contributor

jelhan commented Dec 4, 2023

Ember CLI blueprints run Prettier as part of the linters (ESLint, Stylelint). Prettier project explicitly recommends against doing so:

When searching for both Prettier and your linter on the Internet you’ll probably find more related projects. These are generally not recommended, but can be useful in certain circumstances.

First, we have plugins that let you run Prettier as if it was a linter rule:

These plugins were especially useful when Prettier was new. By running Prettier inside your linters, you didn’t have to set up any new infrastructure and you could re-use your editor integrations for the linters. But these days you can run prettier --check. and most editors have Prettier support.

The downsides of those plugins are:

  • You end up with a lot of red squiggly lines in your editor, which gets annoying. Prettier is supposed to make you forget about formatting – and not be in your face about it!
  • They are slower than running Prettier directly.
  • They’re yet one layer of indirection where things may break.

https://prettier.io/docs/en/integrating-with-linters.html#notes

All those arguments seem to be valid for our use case as well. Additionally the integration of Prettier into linters has complicated the upgrade of Prettier, ESLint, Stylelint, Ember Template Lint iand related libraries n the past. For Prettier v3 many of those needed to be upgraded in a single PR due to limited sets of compatible versions.

Do we need a RFC to change how we integrate Prettier? Or do we consider it an implementation detail not requiring an RFC?

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Dec 4, 2023

I'm a huge fan. Splitting out prettier speeds up eslint a ton, too

Do we need a RFC to change how we integrate Prettier? Or do we consider it an implementation detail not requiring an RFC?

Probably do need an RFC, but rfcs can start as low effort placeholders if that's all a person has energy for 💪

@bertdeblock
Copy link
Contributor

I made this RFC issue a while ago, but closed it due to lack of time => emberjs/rfcs#901. Sharing just in case.
I think this is a good idea as well!

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