0.1.9 • Published 8 years ago

eslint-config-huawei v0.1.9

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

eslint-config-huawei

npm npm Build Status

Huawei Eslint rules

规则列表

  • 基本规则: "eslint-config-huawei"
  • vue规则: "eslint-config-huawei/vue"

规则说明

规则设置文档可参阅(待完善)wiki 暂时可参阅配置文件:

使用说明

基本规则

安装

npm install --save-dev eslint eslint-config-huawei babel-eslint

配置方法

在项目根目录下创建.eslintrc.js,并复制以下内容:

module.exports = {
  extends: [
    'eslint-config-huawei',
  ],
  globals: {
    // 项目需要的全局变量,false指定变量为只读:
    //
    // _: false,
    // $: false
  },
  rules: {
    // 项目自定义规则配置
  }
};

Vue规则

安装

npm install --save-dev eslint eslint-config-huawei babel-eslint eslint-plugin-vue@next vue-eslint-parser@2.0.1-beta.2

配置方法

module.exports = {
  extends: [
    'eslint-config-huawei/vue',
  ],
  globals: {
    // 项目需要的全局变量,false指定变量为只读:
    //
    // _: false,
    // $: false
  },
  rules: {
    // 项目自定义规则配置
  }
};

VSCode配置

安装eslint插件

Ctr+Shift+X打开Extensions,搜索ESlint并安装,重启VSCode

配置

File-->Preferences-->SettingsCtrl + Comma打开设置文件settings.json,添加如下配置

// 检查文件类型
"eslint.validate": {
  "javascript",
  "vue"
}
0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.0

8 years ago