[英]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 . eslint-config- prettier 和eslint-plugin-prettier都是用于将ESLint与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 .
但是,如果我们使用eslint-plugin-prettier ,将会有一些问题如果我们使用eslint-config-prettier就不会发生。 Also, when using eslint-plugin-prettier recommended config, it would use eslint-config-prettier behind the scene.
另外,当使用eslint-plugin-prettier推荐配置时,它会在后台使用eslint-config-prettier 。
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 .我觉得eslint-config- prettier 比eslint-plugin-prettier有明显的优势,但是eslint-plugin-prettier仍然很受欢迎,而且它在npm上的每周下载量确实很多。 Did I miss something?
我错过了什么? What would be advantage of using eslint-plugin-prettier ?
使用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-plugin-prettier - 将 Prettier 作为 ESLint 规则运行,并将差异报告为单个 ESLint 问题。
eslint-config-prettier - turns off all rules that are unnecessary or might conflict with Prettier. eslint-config-prettier - 关闭所有不必要或可能与 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.
这意味着如果您使用一些 eslint-config(您自己或第三方)并且此配置与更漂亮的规则发生冲突 - 它应该通过关闭此规则来解决此冲突。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.