The fix feature of eslint is pretty great and can auto-format/fix much of your code according to your ESLint config. prettier is a more powerful automatic formatter. One of the nice things about prettier is how opinionated it is. Unfortunately, it's not opinionated enough and/or some opinions differ from my own. So after prettier formats the code, I start getting linting errors. This formats your code via prettier, and then passes the result of that to eslint --fix. This way you can get the benefits of prettier's superior formatting capabilities, but also benefit from the configuration capabilities of eslint. The path of the file being formatted can be used to override eslintConfig (eslint will be used to find the relevant config for the file).

Features

  • The config to use for formatting with ESLint. Can be overridden with filePath
  • The path of the file being formatted can be used to override eslintConfig (eslint will be used to find the relevant config for the file)
  • prettier-eslint does quite a bit of logging if you want it to
  • By default, prettier-eslint will run prettier first, then eslint --fix
  • prettier-eslint will only propagate parsing errors when either prettier or eslint fails
  • The eslintConfig and prettierOptions can each be provided as an argument

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow prettier-eslint

prettier-eslint Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of prettier-eslint!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Source Code Analysis Tool

Registered

2022-10-20