Skip to content

Instantly share code, notes, and snippets.

@xfanwu
Last active August 30, 2018 10:05
Show Gist options
  • Save xfanwu/d5cf92d2b0cef12eeaa20ed2848346f4 to your computer and use it in GitHub Desktop.
Save xfanwu/d5cf92d2b0cef12eeaa20ed2848346f4 to your computer and use it in GitHub Desktop.
fgg eslintrc.js for Vue
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
mocha: true
},
// 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.
extends: ['standard', 'eslint:recommended', 'plugin:vue/essential', 'plugin:vue/strongly-recommended'],
// required to lint *.vue files
plugins: [
'vue'
],
// check if imports actually resolve
settings: {
'import/resolver': {
webpack: {
config: 'build/webpack.base.conf.js'
}
}
},
// add your custom rules here
"rules": {
"prefer-const": ["error", {
"destructuring": "any",
"ignoreReadBeforeAssign": true
}],
"no-console": ["error", { "allow": ["info", "warn", "error"] }],
"quotes": [2, "single", "avoid-escape"],
"semi": ["error", "never"],
"no-underscore-dangle": 0,
"no-var": 2,
"no-unused-vars": ["error", { "varsIgnorePattern": "[iI]gnored|next" }],
"camelcase": [1],
"indent": ["error", 4],
"comma-dangle": 1,
"max-len": 1,
"no-multi-str": 1,
"global-require": 1,
"no-mixed-operators": 1,
"import/no-duplicates": 1,
"vue/no-reserved-keys": 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment