eslint-config-cl
v1.0.6
Published
cl 项目默认eslint
Downloads
16
Maintainers
Readme
eslint-cl
eslint代码检查基础规则
用法
1、npm下载
npm i eslint-config-cl --save-dev
或者 下载固定版本
npm i [email protected] --save-dev
或者 下载最新版本
npm i eslint-config-cl@latest --save-dev
2、在项目根目录运行 .eslintrc.js 文件中添加代码
{
"extends": "cl",
// 你的规则(覆盖)
"rules": {}
}
3、项目根目录运行 eslint,检测指定文件,支持 glob 模式
eslint index.js
4、有错误可以通过 --fix 命令修复
eslint index.js --fix
5、.eslintignore 忽略文件
在项目根目录创建一个 .eslintignore 文件告诉 ESLint 去忽略特定的文件和目录。
.eslintignore 文件是一个纯文本文件,其中的每一行都是一个 glob 模式表明哪些路径应该忽略检测。如:
/dist/
/*.js