Last active
October 17, 2019 18:50
-
-
Save evild70/f4b0805b4768071466231cb3c802cba6 to your computer and use it in GitHub Desktop.
.eslintrc for Vue CLI + Prettier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
root: true, | |
env: { | |
node: true, | |
es6: true, | |
browser: true | |
}, | |
extends: ['plugin:vue/essential', 'eslint:recommended'], | |
rules: { | |
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', | |
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', | |
'no-unsafe-negation': 'error', | |
'no-unused-vars': [ | |
'error', | |
{ | |
args: 'none' | |
} | |
], | |
complexity: ['warn', 10], | |
'consistent-return': 'warn', | |
eqeqeq: ['error', 'smart'], | |
'no-else-return': 'error', | |
'no-empty-function': 'error', | |
'no-eq-null': 'error', | |
'no-eval': 'error', | |
'no-extend-native': [ | |
'error', | |
{ | |
exceptions: ['Function', 'Array'] | |
} | |
], | |
'no-magic-numbers': [ | |
'warn', | |
{ | |
ignore: [0, 1, -1], | |
ignoreArrayIndexes: true, | |
enforceConst: true, | |
detectObjects: true | |
} | |
], | |
'no-multi-spaces': 'error', | |
'no-multi-str': 'off', | |
'no-new-func': 'error', | |
'no-new-wrappers': 'warn', | |
'no-new': 'error', | |
'no-octal-escape': 'error', | |
'no-param-reassign': 'error', | |
'no-proto': 'error', | |
'no-redeclare': 'error', | |
'no-restricted-properties': 'off', | |
'no-return-assign': 'error', | |
'no-script-url': 'error', | |
'no-self-compare': 'error', | |
'no-sequences': 'error', | |
'no-throw-literal': 'error', | |
'no-unmodified-loop-condition': 'error', | |
'no-unused-expressions': 'error', | |
'no-useless-call': 'error', | |
'no-useless-concat': 'error', | |
'no-useless-escape': 'error', | |
'no-void': 'off', | |
'no-warning-comments': 'off', | |
'no-with': 'error', | |
radix: 'error', | |
yoda: 'error', | |
strict: 'off', | |
'no-use-before-define': [ | |
'error', | |
{ | |
functions: false | |
} | |
], | |
'array-bracket-spacing': ['error', 'never'], | |
'block-spacing': 'error', | |
'id-length': [ | |
'error', | |
{ | |
min: 2, | |
properties: 'never', | |
exceptions: ['a', 'b', 'h', 'i', 'j', 'z', 'x', 'y', '$'] | |
} | |
], | |
'id-match': 'off', | |
indent: [ | |
'error', | |
4, | |
{ | |
SwitchCase: 1 | |
} | |
], | |
'line-comment-position': ['warn', 'above'], | |
'linebreak-style': ['error', 'unix'], | |
'lines-around-comment': 'off', | |
'lines-around-directive': 'error', | |
'no-lonely-if': 'error', | |
'no-mixed-operators': 'error', | |
'no-multiple-empty-lines': [ | |
'warn', | |
{ | |
max: 2 | |
} | |
], | |
'no-negated-condition': 'warn', | |
'no-nested-ternary': 'error', | |
'no-ternary': 'off', | |
'no-trailing-spaces': 'error', | |
'no-underscore-dangle': 'error', | |
'no-unneeded-ternary': 'error', | |
'no-whitespace-before-property': 'error', | |
'quote-props': ['warn', 'consistent'], | |
quotes: ['error', 'single'], | |
semi: ['error', 'always'], | |
'sort-keys': 'off', | |
'sort-vars': 'off', | |
'space-before-blocks': ['warn', 'always'], | |
'space-before-function-paren': [ | |
'error', | |
{ | |
anonymous: 'always', | |
named: 'never' | |
} | |
], | |
'spaced-comment': ['warn', 'always'], | |
'unicode-bom': 'off', | |
'wrap-regex': 'off', | |
'arrow-body-style': 'error', | |
'arrow-parens': ['warn', 'as-needed'], | |
'arrow-spacing': [ | |
'error', | |
{ | |
before: true, | |
after: true | |
} | |
], | |
'no-confusing-arrow': [ | |
'error', | |
{ | |
allowParens: true | |
} | |
], | |
'no-duplicate-imports': 'error', | |
'no-restricted-imports': 'off', | |
'no-useless-computed-key': 'error', | |
'no-useless-constructor': 'error', | |
'no-useless-rename': 'error', | |
'no-var': 'warn', | |
'object-shorthand': 'error', | |
'prefer-arrow-callback': 'off', | |
'prefer-const': 'warn', | |
'prefer-numeric-literals': 'off', | |
'prefer-rest-params': 'warn', | |
'prefer-spread': 'warn', | |
'prefer-template': 'error', | |
'rest-spread-spacing': 'error', | |
'sort-imports': 'off', | |
'symbol-description': 'error', | |
'template-curly-spacing': 'error', | |
'yield-star-spacing': ['error', 'both'] | |
}, | |
parserOptions: { | |
parser: 'babel-eslint' | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment