eslint-config-hua-cloud
华云中盛 eslint 统一配置
使用
标准规则
安装
npm install --save-dev eslint babel-eslint eslint-config-hua-cloud
在你的项目根目录下创建 .eslintrc.js
,并将以下内容复制到文件中:
moduleexports = extends: 'eslint-config-hua-cloud' rules: // 这里填入你的项目需要的个性化配置,比如: // // // @fixable 一个缩进必须用两个空格替代 // 'indent': [ // 'error', // 2, // { // SwitchCase: 1, // flatTernaryExpressions: true // } // ] ;
Vue
安装
npm install --save-dev eslint babel-eslint @vue/cli-plugin-babel eslint-config-hua-cloud
在你的项目根目录下创建 .eslintrc.js
,并将以下内容复制到文件中:
moduleexports = extends: 'eslint-config-hua-cloud/vue' rules: // 这里填入你的项目需要的个性化配置,比如: // // // @fixable 一个缩进必须用两个空格替代 // 'indent': [ // 'error', // 2, // { // SwitchCase: 1, // flatTernaryExpressions: true // } // ] ;