>[success] # eslint 常见的插件 ### 扩展的配置 1. [eslint-config-airbnb](https://link.zhihu.com/?target=https%3A//github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb): 该包提供了所有的Airbnb的ESLint配置,作为一种扩展的共享配置,你是可以修改覆盖掉某些不需要的配置的,**该工具包包含了react的相关Eslint规则(eslint-plugin-react与eslint-plugin-jsx-a11y),所以安装此依赖包的时候还需要安装刚才提及的两个插件** 2. [eslint-config-airbnb-base](https://link.zhihu.com/?target=https%3A//github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base): 与上一个包的区别是,此依赖包不包含react的规则,一般用于服务端检查。 3. [eslint-config-jest-enzyme](https://link.zhihu.com/?target=https%3A//github.com/FormidableLabs/enzyme-matchers/tree/master/packages/eslint-config-jest-enzyme): jest和enzyme专用的校验规则,保证一些断言语法可以让Eslint识别而不会发出警告。 4. [eslint-config-prettier](https://link.zhihu.com/?target=https%3A//github.com/prettier/eslint-config-prettier): 将会禁用掉所有那些非必须或者和[prettier](https://link.zhihu.com/?target=https%3A//github.com/prettier/prettier)冲突的规则。这让您可以使用您最喜欢的shareable配置,而不让它的风格选择在使用Prettier时碍事。请注意该配置**只是**将规则**off**掉,所以它只有在和别的配置一起使用的时候才有意义。 ### 插件 1. [eslint-plugin-babel](https://link.zhihu.com/?target=https%3A//github.com/babel/eslint-plugin-babel): 和babel-eslint一起用的一款插件.babel-eslint在将eslint应用于Babel方面做得很好,但是它不能更改内置规则来支持实验性特性。eslint-plugin-babel重新实现了有问题的规则,因此就不会误报一些错误信息 2. [eslint-plugin-import](https://link.zhihu.com/?target=https%3A//github.com/benmosher/eslint-plugin-import): 该插件想要支持对ES2015+ (ES6+) import/export语法的校验, 并防止一些文件路径拼错或者是导入名称错误的情况 3. [eslint-plugin-jsx-a11y](https://link.zhihu.com/?target=https%3A//github.com/evcohen/eslint-plugin-jsx-a11y): 该依赖包专注于检查JSX元素的可访问性。 4. [eslint-import-resolver-webpack](https://link.zhihu.com/?target=https%3A//github.com/benmosher/eslint-plugin-import%23resolvers): 可以借助webpack的配置来辅助eslint解析,最有用的就是alias,从而避免unresolved的错误 5. [eslint-import-resolver-typescript](https://link.zhihu.com/?target=https%3A//github.com/alexgorbatchev/eslint-import-resolver-typescript):和eslint-import-resolver-webpack类似,主要是为了解决alias的问题 6. [eslint-plugin-react](https://link.zhihu.com/?target=https%3A//github.com/yannickcr/eslint-plugin-react): React专用的校验规则插件. 7. [eslint-plugin-jest](https://link.zhihu.com/?target=https%3A//github.com/jest-community/eslint-plugin-jest): Jest专用的Eslint规则校验插件. 8. [eslint-plugin-prettier](https://link.zhihu.com/?target=https%3A//github.com/prettier/eslint-plugin-prettier): 该插件辅助Eslint可以平滑地与Prettier一起协作,并将Prettier的解析作为Eslint的一部分,在最后的输出可以给出修改意见。这样当Prettier格式化代码的时候,依然能够遵循我们的Eslint规则。如果你禁用掉了所有和代码格式化相关的Eslint规则的话,该插件可以更好得工作。所以你可以使用eslint-config-prettier禁用掉所有的格式化相关的规则(如果其他有效的Eslint规则与prettier在代码如何格式化的问题上不一致的时候,报错是在所难免的了) 9. [@typescript-eslint/eslint-plugin](https://link.zhihu.com/?target=https%3A//github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin):Typescript辅助Eslint的插件。 10. [eslint-plugin-promise](https://link.zhihu.com/?target=https%3A//blog.5udou.cn/douMi/editor/5cf5dfa5ce2785b40ef80bd6):promise规范写法检查插件,附带了一些校验规则。 辅助优化流程 11. [husky](https://link.zhihu.com/?target=https%3A//github.com/typicode/husky): git命令hook专用配置. 12. [lint-staged](https://link.zhihu.com/?target=https%3A//github.com/okonet/lint-staged): 可以定制在特定的git阶段执行特定的命令。 >[info] ## 文章来源 [最全的Eslint配置模板,从此统一团队的编程习惯 ](https://zhuanlan.zhihu.com/p/87667635)