JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q59379F
  • License MIT

AfuTeam ESLint Plugin

Package Exports

  • @afuteam/eslint-plugin-fe-alpha
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/base.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/js.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/react-js.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/react-ts.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/react-ts/index.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/react-ts/tsconfig.json
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/react.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/react16.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/ts.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/ts/index.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/ts/tsconfig.json
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/ts4.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/ts5.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/vue2-js.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/vue2-ts.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/vue2-ts/index.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/vue2-ts/tsconfig.json
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/vue2.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/vue3-js.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/vue3-ts.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/vue3-ts/index.js
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/vue3-ts/tsconfig.json
  • @afuteam/eslint-plugin-fe-alpha/lib/configs/vue3.js

Readme

@afuteam/eslint-plugin-fe-alpha

安装

安装 ESLint@afuteam/eslint-plugin-fe-alpha:

npm i eslint @afuteam/eslint-plugin-fe-alpha --save-dev

.eslintrc 文件使用

.eslintrc 配置文件中, 引入 @afuteam/eslint-plugin-fe-alpha 插件

{
  "plugins": ["@afuteam/fe-alpha"]
}

然后根据项目类型, 配置对应规则

// js + react
{
  "extends": [
    "plugin:@afuteam/fe-alpha/react-js"
  ],
  "plugins": ["@afuteam/fe-alpha"]
}
// js + vue2
{
  "extends": ["plugin:@afuteam/fe-alpha/vue2-js"],
  "plugins": ["@afuteam/fe-alpha"]
}
// js + vue3
{
  "extends": ["plugin:@afuteam/fe-alpha/vue3-js"],
  "plugins": ["@afuteam/fe-alpha"]
}
// ts + react 包含js规则
{
  "extends": [
    "plugin:@afuteam/fe-alpha/react-ts"
  ],
  "plugins": ["@afuteam-alpha/fe"]
}
// ts + vue2 包含js规则
{
  "plugins": ["@afuteam/fe-alpha"],
  "extends": ["plugin:@afuteam/fe-alpha/vue2-ts"]
}
// ts + vue3 包含js规则
{
  "plugins": ["@afuteam/fe-alpha"],
  "extends": ["plugin:@afuteam/fe-alpha/vue3-ts"]
}

npx方式使用

查看当前支持的类型,列出清单

npx @afuteam/eslint-plugin-fe-alpha@latest --help=type

使用

npx @afuteam/eslint-plugin-fe-alpha@latest --type=react-ts --path=src/

说明

这个调试依赖包,作为 @afuteam/eslint-plugin-fealpha 版本,实验性功能会在这里进行,比如 0.0.5 版本已经内置对一些文件夹过滤 (.umi/locales/mock/e2e等)。