Skip to content

Instantly share code, notes, and snippets.

@lloydjatkinson
Created January 19, 2018 21:41
Show Gist options
  • Save lloydjatkinson/ed4abdf12955f78d529bb0d5ec46eab4 to your computer and use it in GitHub Desktop.
Save lloydjatkinson/ed4abdf12955f78d529bb0d5ec46eab4 to your computer and use it in GitHub Desktop.
My .eslintrc.js file for Vue based projects. Uses default Vue recommended settings but enforces use of 4 space indentation and semicolons.
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/recommended',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
// 4 space indentation
'indent': ['error', 4],
//semicolons
'semi': [2, 'always'],
// remove blank line at end of file
'eol-last': 0,
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'vue/html-indent': ['error', 4]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment