扩展 ESLint
本指南适用于那些希望扩展 ESLint 功能的人。
🌐 This guide is intended for those who wish to extend the functionality of ESLint.
为了扩展 ESLint,建议:
🌐 In order to extend ESLint, it’s recommended that:
- 你知道 JavaScript,因为 ESLint 是用 JavaScript 编写的。
- 你对 Node.js 有一定的了解,因为 ESLint 在其上运行。
- 你熟悉命令行程序。
如果这听起来像你,那么继续阅读以开始。
🌐 If that sounds like you, then continue reading to get started.
扩展 ESLint 的方法
🌐 Ways to Extend ESLint
本页总结了你可以扩展 ESLint 的各种方式,以及这些扩展如何组合在一起。
🌐 This page summarizes the various ways that you can extend ESLint and how these extensions all fit together.
创建插件
🌐 Create Plugins
你已经为 ESLint 开发了自定义规则,并且想要与社区分享它们。你可以在 npm 上发布一个 ESLint 插件。
🌐 You’ve developed custom rules for ESLint and you want to share them with the community. You can publish an ESLint plugin on npm.
自定义规则教程
🌐 Custom Rule Tutorial
指导你为 ESLint 创建自定义规则的教程。
🌐 A tutorial that walks you through creating a custom rule for ESLint.
自定义规则
🌐 Custom Rules
本节介绍如何创建自定义规则以与 ESLint 一起使用。
🌐 This section explains how to create custom rules to use with ESLint.
自定义格式化器
🌐 Custom Formatters
本节介绍如何创建自定义格式化程序来控制 ESLint 输出的内容。
🌐 This section explains how you can create a custom formatter to control what ESLint outputs.
自定义解析器
🌐 Custom Parsers
如果你不想使用 ESLint 的默认解析器,本节将介绍如何创建自定义解析器。
🌐 If you don’t want to use the default parser of ESLint, this section explains how to create custom parsers.
自定义处理器
🌐 Custom Processors
本节介绍如何使用自定义处理器让 ESLint 处理 JavaScript 以外的文件。
🌐 This section explains how you can use a custom processor to have ESLint process files other than JavaScript.
共享配置
🌐 Share Configurations
本节介绍如何在 JavaScript 包中打包和共享 ESLint 配置。
🌐 This section explains how you can bundle and share ESLint configuration in a JavaScript package.