-
-
Save david-dacruz/467d974a82dc252432614c4468d3f2ee to your computer and use it in GitHub Desktop.
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
/* | |
Requires to have eslint and eslint-plugin vue installed locally. | |
(npm i -g eslint eslint-plugin-vue) | |
https://vuejs.github.io/eslint-plugin-vue/rules/ | |
Put this in a ".eslintrc.json" at the root of the repository. | |
You can also put in in your $HOME. | |
*/ | |
module.exports = { | |
root: true, | |
env: { | |
browser: true, | |
es6: true, | |
node: true | |
}, | |
extends: ["eslint:recommended", "plugin:vue/recommended"], | |
parserOptions: { | |
ecmaVersion: 2018, | |
sourceType: "module", | |
allowImportExportEverywhere: true | |
}, | |
rules: { | |
"no-console": process.env.NODE_ENV === "production" ? "error" : "off", //process.env.NODE_ENV === 'production' ? 'error' : 'off', | |
"no-debugger": "off", // process.env.NODE_ENV === 'production' ? 'error' : 'off' | |
indent: ["error", 2], | |
"linebreak-style": ["error", "unix"], | |
quotes: [ | |
"error", | |
"double", | |
{ | |
allowTemplateLiterals: true | |
} | |
], | |
"no-unused-vars": [ | |
"error", | |
{ | |
argsIgnorePattern: "^_" | |
} | |
], | |
semi: ["error", "always"], | |
/*________ Vue specific ________ */ | |
"vue/html-closing-bracket-spacing": [ | |
"error", | |
{ | |
startTag: "never", | |
endTag: "never", | |
selfClosingTag: "never" | |
} | |
], | |
"vue/html-closing-bracket-newline": [ | |
"error", | |
{ | |
singleline: "never", | |
multiline: "never" | |
} | |
], | |
"vue/html-indent": [ | |
"error", | |
2, | |
{ | |
attribute: 2, | |
baseIndent: 1, | |
closeBracket: 0, | |
alignAttributesVertically: true, | |
ignores: [] | |
} | |
], | |
"vue/max-attributes-per-line": [ | |
"error", | |
{ | |
singleline: 4, | |
multiline: { | |
max: 1, | |
allowFirstLine: true | |
} | |
} | |
], | |
"vue/order-in-components": [ | |
"error", | |
{ | |
order: [ | |
"el", | |
"name", | |
"parent", | |
"functional", | |
["delimiters", "comments"], | |
["components", "directives", "filters"], | |
"extends", | |
"mixins", | |
"inheritAttrs", | |
"model", | |
["props", "propsData"], | |
"LIFECYCLE_HOOKS", | |
"data", | |
"watch", | |
"computed", | |
"methods", | |
["template", "render"], | |
"renderError" | |
] | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment