eslint-plugin-turbo
eslint-plugin-turbo
软件包 帮助你查找代码中使用的、不属于 Turborepo 哈希计算的环境变量。源代码中使用的、在 turbo.json
中未考虑的环境变量将在编辑器中高亮显示,错误将显示为 ESLint 输出。
¥The eslint-plugin-turbo
package helps you find environment variables that are used in your code that are not a part of Turborepo's hashing. Environment variables used in your source code that are not accounted for in turbo.json
will be highlighted in your editor and errors will show as ESLint output.
安装
¥Installation
将 eslint-config-turbo
安装到保存 ESLint 配置的位置:
¥Install eslint-config-turbo
into the location where your ESLint configuration is held:
用法(扁平配置 eslint.config.js
)
¥Usage (Flat Config eslint.config.js
)
ESLint v9 使用如下所示的 Flat Config 格式:
¥ESLint v9 uses the Flat Config format seen below:
否则,你可以在规则部分配置要使用的规则。
¥Otherwise, you may configure the rules you want to use under the rules section.
示例(扁平配置 eslint.config.js
)
¥Example (Flat Config eslint.config.js
)
用法(旧版 eslintrc*
)
¥Usage (Legacy eslintrc*
)
将 turbo
添加到 .eslintrc
配置文件的插件部分。你可以省略 eslint-plugin-
前缀:
¥Add turbo
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
然后在规则部分下配置要使用的规则。
¥Then configure the rules you want to use under the rules section.
示例(旧版 eslintrc*
)
¥Example (Legacy eslintrc*
)