You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@afuteam/eslint-plugin-fe

Package Overview
Dependencies
Maintainers
0
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@afuteam/eslint-plugin-fe

AfuTeam ESLint Plugin

2.0.10
latest
Source
npmnpm
Version published
Weekly downloads
3
-85%
Maintainers
0
Weekly downloads
 
Created
Source

@afuteam/eslint-plugin-fe

安装

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

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

.eslintrc 文件使用

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

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

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

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

npx方式使用

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

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

使用

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

Tips

2.0.7

  • 关闭默认的 complexity;
  • 基于 complexity 新增规则 complexity-without-switchcase,需要配合 @afuteam/feplugin使用

2.0.1

  • 默认禁止lint 的行内disable注释;但支持npx方式来打开 --allowInlineConfig=true
  • 忽略 min.js iconfont.js 结尾的js文件

Keywords

AfuTeam

FAQs

Package last updated on 26 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts