0.0.8 • Published 2 years ago

eslint-plugin-mt-code-check v0.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

eslint-plugin-mt-code-check

ESLint 编码规范扩展

安装

请先安装 ESLint

npm i eslint --save-dev

接下来安装插件 eslint-plugin-mt-code-check

npm install eslint-plugin-mt-code-check --save-dev
# 或
yarn add eslint-plugin-mt-code-check --save-dev
# 或
pnpm install eslint-plugin-mt-code-check --save-dev

使用

mt-code-check 添加到您的 .eslintrc 文件的 plugins 区域。注意,请忽略前缀 eslint-plugin-

{
    "plugins": [
        "mt-code-check"
    ]
}

接下来在 rules 中配置你想启用的规则:

{
    "rules": {
        "mt-code-check/sort-variable": 2, // 规则:相邻的变量声明,let 必须放在 const 后面
    }
}

支持的规则

  • "mt-code-check/settimeout-no-number:setTimeout 的第二个参数禁止是数字
  • "mt-code-check/sort-variable":相邻(前后两行、同一行)的变量声明,let 必须放在 const 后面
  • "mt-code-check/no-iife":禁止使用立即执行函数
  • "mt-code-check/no-expression-assignment":禁止使用 arrarr.length = 1 这种方式追加数组元素,应该使用 arr.push()
0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago