Skip to content

Instantly share code, notes, and snippets.

@victorwpbastos
Last active July 26, 2019 19:38
Show Gist options
  • Save victorwpbastos/3d837188ab78a26eb12b666c67866716 to your computer and use it in GitHub Desktop.
Save victorwpbastos/3d837188ab78a26eb12b666c67866716 to your computer and use it in GitHub Desktop.
eslint config for vue projects
module.exports = {
root: true,
env: {
node: true
},
parserOptions: {
parser: 'babel-eslint'
},
extends: [
'plugin:vue/recommended',
'eslint:recommended'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'indent': ['error', 'tab', { "SwitchCase": 1 }],
'semi': ['error', 'always'],
'quotes': ['error', 'single'],
'arrow-parens': ['error', 'as-needed'],
'comma-dangle': ['error', 'never'],
'array-bracket-spacing': ['error', 'never', { 'objectsInArrays': true, 'arraysInArrays': true }],
'block-spacing': ['error', 'always'],
'curly': ['error', 'all'],
'array-bracket-newline': ['error', { 'multiline': true, 'minItems': 5 }],
'array-element-newline': ['error', { 'multiline': true, 'minItems': 5 }],
'function-paren-newline': ['error', { 'minItems': 5 }],
'object-curly-spacing': ['error', 'always'],
'comma-spacing': ['error', { 'before': false, 'after': true }],
'semi-spacing': ['error', {'before': false, 'after': true}],
'key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
'space-infix-ops': 'error',
'semi-style': ['error', 'last'],
'linebreak-style': ['error', 'unix'],
'no-multiple-empty-lines': ['error', { 'max': 1, 'maxBOF': 0, 'maxEOF': 0 }],
'no-trailing-spaces': 'error',
'eol-last': ['error', 'never'],
'vue/script-indent': ['error', 'tab', { baseIndent: 1 }],
'vue/html-indent': ['error', 'tab', { baseIndent: 1 }]
},
overrides: [{
files: ['*.vue'],
rules: {
indent: 0
}
}]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment