简体   繁体   中英

Why use "eslint-plugin-prettier" over "eslint-config-prettier"

Both eslint-config-prettier and eslint-plugin-prettier are popular packages for integrating ESLint with Prettier .

However, after reading Docs of both of them I understood that both would do the job. But, if we use eslint-plugin-prettier , there will be a few issues that would not happen if we would use eslint-config-prettier . Also, when using eslint-plugin-prettier recommended config, it would use eslint-config-prettier behind the scene.

It seams to me that eslint-config-prettier has obvious advantages over eslint-plugin-prettier , but eslint-plugin-prettier is still very popular and it has really a lot of weekly downloads on npm . Did I miss something? What would be advantage of using eslint-plugin-prettier ?

This packages have different purposes:

  • eslint-plugin-prettier - runs Prettier as an ESLint rule and reports differences as individual ESLint issues.

  • eslint-config-prettier - turns off all rules that are unnecessary or might conflict with Prettier. It's mean that if you use some eslint-config(your own or third party) and this config have conflicts with prettier rules - it should resolve this conflicts by turn off this rules.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM