Skip to content

Instantly share code, notes, and snippets.

@Lunrtick
Created May 31, 2018 16:29
Show Gist options
  • Save Lunrtick/101c848b171ed1763a07cd99cd3c49ae to your computer and use it in GitHub Desktop.
Save Lunrtick/101c848b171ed1763a07cd99cd3c49ae to your computer and use it in GitHub Desktop.
My ESLintrc file
// http://eslint.org/docs/user-guide/configuring
module.exports = {
extends: ['eslint:recommended', 'plugin:vue/recommended'],
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
env: {
browser: true
},
globals: {
window: true,
Promise: true,
process: true,
global: true,
router: true,
require: true,
module: true
},
// required to lint *.vue files
plugins: ['vue'],
// add your custom rules here
rules: {
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'space-before-function-paren': ['error', 'never'],
indent: [
'error',
4,
{
SwitchCase: 1
}
],
'linebreak-style': ['error', 'unix'],
'no-console': 'warn',
'no-unused-vars': 'warn',
'vue/max-attributes-per-line': [
2,
{
singleline: 3,
multiline: {
max: 3,
allowFirstLine: true
}
}
],
'vue/html-indent': [
'error',
4,
{
attribute: 0,
closeBracket: 0,
alignAttributesVertically: true,
ignores: []
}
],
'vue/order-in-components': [
'error',
{
order: [
'el',
'name',
'parent',
'functional',
['delimiters', 'comments'],
['components', 'directives'],
'extends',
'mixins',
['props', 'propsData'],
'inheritAttrs',
'model',
'filters',
'watch',
'computed',
'LIFECYCLE_HOOKS',
'data',
'methods',
['template', 'render'],
'renderError'
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment