Skip to content

Instantly share code, notes, and snippets.

@vpiskunov
Last active May 11, 2019 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vpiskunov/bc1759aca846cf7523b8a2ccde38e63a to your computer and use it in GitHub Desktop.
Save vpiskunov/bc1759aca846cf7523b8a2ccde38e63a to your computer and use it in GitHub Desktop.
Vue CLI 3: fix for airbnb-base .eslint errors on project creation (UI)
module.exports = {
"extends": [
"plugin:vue/essential",
// this is default in Vue CLI 3 (UI), however it requires-in eslint-config-airbnb-base, which contains an error
// triggering "import/no-cycle" was not defined. Weirdly, it is listed in eslint-config-airbnb-base as added/fixed
// in current version (4.1.0). For now, use airbnb-base instead
// "@vue/airbnb",
"airbnb-base",
],
"rules": {
"no-console": "off",
"no-plusplus": "off",
"camelcase": "off",
"no-return-assign": ["warn", "except-parens"],
"no-prototype-builtins": "off",
"no-unused-expressions": "off",
"space-before-function-paren": ["error", "always"],
"import/no-extraneous-dependencies":
["error", {
"devDependencies": true,
"packageDir": "./"
}
],
"vue/max-attributes-per-line": [
"warn",
{
singleline: 10,
multiline: {
max: 10,
allowFirstLine: true
}
}
],
// don't require .vue extension when importing
"import/extensions": [
"error",
"always",
{
js: "never",
vue: "ignorePackages"
}
],
// disallow reassignment of function parameters
// disallow parameter object manipulation except for specific exclusions
"no-param-reassign": [
"error",
{
props: true,
ignorePropertyModificationsFor: [
"state", // for vuex state
"acc", // for reduce accumulators
"e" // for e.returnvalue
]
}
],
// allow debugger during development
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"linebreak-style": 0
},
"plugins": [
],
"settings": {
"import/resolver": {
"webpack": {
"config": require.resolve('@vue/cli-service/webpack.config.js')
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment