Created
February 12, 2019 14:35
-
-
Save HariantoAtWork/865d45231c3dc5963bbb15696fdd3c8c to your computer and use it in GitHub Desktop.
My Vue Eslint Config
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
const INLINE_ELEMENTS = [ | |
'a', | |
'abbr', | |
'acronym', | |
'audio', | |
'b', | |
'bdi', | |
'bdo', | |
'big', | |
'br', | |
'button', | |
'canvas', | |
'cite', | |
'code', | |
'data', | |
'datalist', | |
'del', | |
'dfn', | |
'em', | |
'embed', | |
'i', | |
'iframe', | |
'img', | |
'input', | |
'ins', | |
'kbd', | |
'label', | |
'map', | |
'mark', | |
'meter', | |
'noscript', | |
'object', | |
'output', | |
'picture', | |
'progress', | |
'q', | |
'ruby', | |
's', | |
'samp', | |
'script', | |
'select', | |
'slot', | |
'small', | |
'span', | |
'strong', | |
'sub', | |
'sup', | |
'svg', | |
'template', | |
'textarea', | |
'time', | |
'u', | |
'tt', | |
'var', | |
'video', | |
'wbr' | |
] | |
module.exports = { | |
root: true, | |
env: { | |
node: true | |
}, | |
extends: [ | |
'plugin:vue/strongly-recommended', | |
// '@vue/unibeautify' | |
], | |
rules: { | |
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', | |
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', | |
'quotes': ['error', 'single'], | |
'indent': ['error', 2], | |
'linebreak-style': [ | |
'error', 'unix' | |
], | |
'quotes': ['error', 'single'], | |
'semi': ['error', 'never'], | |
'vue/html-closing-bracket-newline': ['error', { | |
'singleline': 'never', | |
'multiline': 'never' | |
}], | |
'vue/html-closing-bracket-spacing': ['error', { | |
'selfClosingTag': 'always' | |
}], | |
'vue/html-no-self-closing': 0, | |
'vue/html-self-closing': ['error', { | |
'html': { | |
'void': 'always', | |
'normal': 'always', | |
'component': 'always' | |
}, | |
'svg': 'always', | |
'math': 'always' | |
}], | |
'vue/singleline-html-element-content-newline': ['error', { | |
'ignoreWhenNoAttributes': true, | |
'ignoreWhenEmpty': true, | |
'ignores': ['pre', 'textarea', ...INLINE_ELEMENTS] | |
}], | |
'vue/max-attributes-per-line': 0 | |
// 'prettier/prettier': 'error' | |
}, | |
parserOptions: { | |
parser: 'babel-eslint' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment