Last active
November 10, 2018 17:03
-
-
Save mmieluch/c36648a7e889152598867f9132d502b8 to your computer and use it in GitHub Desktop.
ESLint configuration for Nuxt.js projects
This file contains hidden or 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: { | |
browser: true, | |
node: true, | |
}, | |
extends: [ | |
'standard', | |
'plugin:vue/recommended', | |
], | |
parserOptions: { | |
parser: 'babel-eslint', | |
}, | |
plugins: [ | |
'vue', | |
], | |
// Custom rules. | |
rules: { | |
'comma-dangle': ['error', { | |
arrays: 'always-multiline', | |
objects: 'always-multiline', | |
imports: 'always-multiline', | |
exports: 'always-multiline', | |
functions: 'always-multiline', | |
}], | |
indent: ['error', 2, { | |
SwitchCase: 1, | |
}], | |
'vue/script-indent': ['error', 2, { | |
baseIndent: 1, | |
switchCase: 1, | |
}], | |
'vue/max-attributes-per-line': ['error', { | |
singleline: 5, | |
multiline: { | |
allowFirstLine: true, | |
max: 1, | |
}, | |
}], | |
'vue/no-v-html': 'off', | |
'vue/order-in-components': ['error', { | |
'order': [ | |
'el', | |
'name', | |
'parent', | |
'functional', | |
'inheritAttrs', | |
['template', 'render'], | |
'renderError', | |
['delimiters', 'comments'], | |
'extends', | |
'mixins', | |
['components', 'directives', 'filters'], | |
'model', | |
['props', 'propsData'], | |
'data', | |
'computed', | |
'methods', | |
'watch', | |
'LIFECYCLE_HOOKS', | |
], | |
}], | |
}, | |
overrides: [ | |
{ | |
files: ['*.js'], | |
rules: { | |
'vue/script-indent': 'off', | |
} | |
}, | |
{ | |
files: ['*.vue'], | |
rules: { | |
indent: 'off', | |
}, | |
} | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment