Last active
October 22, 2022 21:09
-
-
Save Sequoya42/6b943a704dff098a5240e52f81c31b7e 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: 2020, | |
// allowImportExportEverywhere: true, | |
// }, | |
rules: { | |
"max-nested-callbacks": ["error", 3], | |
"no-unused-vars": "off", | |
// "no-unused-vars": ["error", { "varsIgnorePattern": "^_" }, | |
// { "destructuredArrayIgnorePattern": "^_" }], | |
/*------------- Vue specific -----------*/ | |
"vue/multi-word-component-names": "off", | |
"vue/max-len": [ | |
"error", | |
{ | |
"code": 120, | |
"template": 9000, | |
"ignoreTemplateLiterals": true, | |
"ignoreUrls": true, | |
"ignoreStrings": true | |
} | |
], | |
"object-property-newline": [ | |
"error", | |
{ allowAllPropertiesOnSameLine: true }, | |
], | |
"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], | |
"max-depth": ["error", 4], | |
"linebreak-style": ["error", "unix"], | |
quotes: [ | |
"error", | |
"double", | |
{ | |
"avoidEscape": true, | |
allowTemplateLiterals: true, | |
}, | |
], | |
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/no--argument": 0, | |
"vue/html-indent": [ | |
"error", | |
2, | |
{ | |
attribute: 2, | |
baseIndent: 1, | |
closeBracket: 0, | |
alignAttributesVertically: true, | |
ignores: [], | |
}, | |
], | |
"vue/max-attributes-per-line": [ | |
"error", | |
{ | |
singleline: { | |
max: 4 | |
}, | |
multiline: { | |
max: 2, | |
}, | |
}, | |
], | |
/* ***** ORDER ****** */ | |
"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