其他分享
首页 > 其他分享> > eslint quick start

eslint quick start

作者:互联网

configuring eslint

configuration file format & priority

  1. .eslintrc.js
  2. .eslintrc.yaml
  3. .eslintrc.yml
  4. .eslintrc.json
  5. .eslintrc deprecated
  6. package.json

ignoring files and directory

# omit all .js file
**/*.js 
# Ignore built files except build/index.js
build/*
!build/index.js

eslintrc

    'env': {
        'browser': true,
        // new ES6 global variables,
        'es6': true,
        'node': true
    },
'extends': 'eslint:recommended', // 'airbnb-base' 'standard'
    
    'parserOptions': {
        // supporting ES6 syntax 
        'ecmaVersion': 6,
        'sourceType': 'module'
    },
"html"
"indent": [
    "error",
    "tab"
],
"linebreak-style": [
    "error",
    "unix"
],
"quotes": [
    "error",
    "single"
],
"semi": [
    "error",
    "always"
]

标签:eslintrc,js,start,json,eslint,error,quick,build
来源: https://www.cnblogs.com/rosendolu/p/11108187.html