Skip to content

[RFC]: remove use of eslint-plugin-prettier #50

@antoine-cottineau

Description

@antoine-cottineau

Why?

I find that having integrated eslint-plugin-prettier into the package deteriorates the dev experience and adds useless complexity to the esLint config.

By activating this plugin, formatting errors that are found by Prettier are now handled by esLint. This means that whenever you have a missing space or a line that needs to be split up you get those red squiggly lines in the editor, which creates some unnecessary pollution in the mind of the developper.

Moreover, the official Prettier documentation advises against using linter to format the code:

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.

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.

In my opinion, a better solution would be to have:

  • formatOnSave enabled in the editor so that the dev doesn't have to care about formatting and it is done automatically,
  • a script in package.json that can prettify the whole codebase (prettier -w .),
  • a script in package.json that errors if some files are not formatted correctly, which can be useful in a pre-push hook or in a CI (prettier -c .).

Rule Documentation 📜

https://github.com/prettier/eslint-plugin-prettier

Config Selection 🛠

recommended

(Optional) Additional Details 📝

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions