Skip to content

meta: replace stylistic eslint rules with prettier - #17101

Merged
WikiRik merged 8 commits into
mainfrom
ephys/prettier
Feb 18, 2024
Merged

WikiRik merged 8 commits into
mainfrom
ephys/prettier

Conversation

@ephys

@ephys ephys commented Feb 18, 2024 •

Copy link
Copy Markdown
Member

This PR adds prettier, which is run on every single file.

It also updates the ESLint preset we use, which does not include rules that can be handled by prettier anymore.

This PR only implements the rules that can be fixed automatically. Our .eslintrc.js file includes a few rules that will need to be manually fixed in future PRs.

This change provides multiple advantages:

  • eslint is deprecating stylistic rules
  • eslint is much slower than prettier. We can run prettier on the entire repository in seconds.
  • prettier autofixes many more things.
  • the import plugin automatically removes any unused import

Prettier is not run using eslint-plugin-prettier, as that would only work for JavaScript/TypeScript files. Instead, it is run as it's own step, and should be configured separately in the IDE.

@ephys ephys mentioned this pull request Feb 18, 2024
@ephys
ephys marked this pull request as ready for review February 18, 2024 14:18
@WikiRik

WikiRik commented Feb 18, 2024

Copy link
Copy Markdown
Member

Can you update the CONTRIBUTING.md file as well to reflect that we're using prettier? Rest of the changes look good and tests are passing

@WikiRik WikiRik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually let's merge this now to not block the other PRs. We can update CONTRIBUTING.md in a next PR

@WikiRik
WikiRik merged commit 87bec35 into main Feb 18, 2024
@WikiRik
WikiRik deleted the ephys/prettier branch February 18, 2024 18:08
@WikiRik WikiRik mentioned this pull request Feb 18, 2024
4 of 5 tasks
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

Successfully merging this pull request may close these issues.

3 participants