@3fs/eslint-config 中文文档教程
eslint-config
An ESLint Shareable Config
Deployment
创建一个新的带注释的标签并将其推送到 github。
git tag -a v1.0.0 -m "Tag comment"
git push origin v1.0.0
Installation
npm install @3fs/eslint-config [eslint@7.17.0]
# OR
yarn add @3fs/eslint-config [eslint@7.17.0]
Usage
可共享配置旨在与 .eslintrc
文件的 extends
功能配合使用。 您可以了解更多关于 Shareable Configs 在 ESLint 官方网站。
要使用这个可共享的配置,首先运行这个:
npm install --save-dev eslint@7.17.0 @3fs/eslint-config
# OR
yarn add --dev eslint@7.17.0 @3fs/eslint-config
然后,将这个添加到你的 .eslintrc(.js|.json|.yml) 文件中:
{
"extends": "@3fs"
}
注意:我们省略了 /eslint-config
后缀因为 ESLint 会自动采用它。 仅适用于 esnext,因为它被指定为默认值
您可以通过将可共享配置直接添加到您的配置中来覆盖这些设置 .eslintrc
文件。
All available configs
@3fs
or@3fs/eslint-config/configs/esnext
- ES6+ config; Requires babel-eslint@10.1.0@3fs/eslint-config/configs/es5
- ES5 config@3fs/eslint-config/configs/node
- ES6+ NodeJS config; Requires babel-eslint@10.1.0@3fs/eslint-config/configs/node-es5
- ES5 NodeJS config@3fs/eslint-config/configs/ng
- AngularJS config; Requires eslint-plugin-angular@4.0.1@3fs/eslint-config/configs/react
- React config; Requires babel-eslint@10.1.0, eslint-plugin-react@7.22.0, eslint-plugin-jsx-a11y@6.4.1, eslint-plugin-react-hooks@4.2.0@3fs/eslint-config/configs/react-native
- React Native config; Requires babel-eslint@10.1.0, eslint-plugin-react@7.22.0, eslint-plugin-jsx-a11y@6.4.1 and eslint-plugin-react-native@3.10.0@3fs/eslint-config/configs/ts
- TypeScript config; Requires typescript@4.1.3, @typescript-eslint/eslint-plugin@4.12.0, @typescript-eslint/parser@4.12.0
eslint-config
An ESLint Shareable Config
Deployment
Create a new annotated tag and push it to github.
git tag -a v1.0.0 -m "Tag comment"
git push origin v1.0.0
Installation
npm install @3fs/eslint-config [eslint@7.17.0]
# OR
yarn add @3fs/eslint-config [eslint@7.17.0]
Usage
Shareable configs are designed to work with the extends
feature of .eslintrc
files. You can learn more about Shareable Configs on the official ESLint website.
To use this shareable config, first run this:
npm install --save-dev eslint@7.17.0 @3fs/eslint-config
# OR
yarn add --dev eslint@7.17.0 @3fs/eslint-config
Then, add this to your .eslintrc(.js|.json|.yml) file:
{
"extends": "@3fs"
}
Note: We omitted the /eslint-config
sufix since it is automatically assumed by ESLint. Only works for esnext since its specified as default
You can override settings from the shareable config by adding them directly into your .eslintrc
file.
All available configs
@3fs
or@3fs/eslint-config/configs/esnext
- ES6+ config; Requires babel-eslint@10.1.0@3fs/eslint-config/configs/es5
- ES5 config@3fs/eslint-config/configs/node
- ES6+ NodeJS config; Requires babel-eslint@10.1.0@3fs/eslint-config/configs/node-es5
- ES5 NodeJS config@3fs/eslint-config/configs/ng
- AngularJS config; Requires eslint-plugin-angular@4.0.1@3fs/eslint-config/configs/react
- React config; Requires babel-eslint@10.1.0, eslint-plugin-react@7.22.0, eslint-plugin-jsx-a11y@6.4.1, eslint-plugin-react-hooks@4.2.0@3fs/eslint-config/configs/react-native
- React Native config; Requires babel-eslint@10.1.0, eslint-plugin-react@7.22.0, eslint-plugin-jsx-a11y@6.4.1 and eslint-plugin-react-native@3.10.0@3fs/eslint-config/configs/ts
- TypeScript config; Requires typescript@4.1.3, @typescript-eslint/eslint-plugin@4.12.0, @typescript-eslint/parser@4.12.0