Eslint

来自百合仙子's Wiki
跳转到导航 跳转到搜索

配置

全局配置文件位于 ~/.eslintrc.yml。也可在项目根目录创建局部的配置文件。

env:
  es6: true
  node: true
extends: 'eslint:recommended'
parser: babel-eslint
parserOptions:
  sourceType: module
rules:
  indent:
    - off
  linebreak-style:
    - error
    - unix
  quotes:
    - error
    - single
  semi:
    - error
    - never
  no-console:
    - off
  no-unused-vars:
    - warn
    - varsIgnorePattern: ^_
      argsIgnorePattern: ^_
  no-constant-condition:
    # we need while(true)
    - off