gamebrary/.eslintrc.js

86 lines
2.1 KiB
JavaScript
Raw Normal View History

2018-10-19 05:15:28 +00:00
// https://eslint.org/docs/user-guide/configuring
module.exports = {
2019-11-08 20:34:06 +00:00
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: 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: [
2019-11-14 21:10:10 +00:00
'plugin:vue/essential',
2019-11-08 20:34:06 +00:00
'airbnb-base',
],
// required to lint *.vue files
plugins: [
2019-11-14 21:10:10 +00:00
'vue',
2019-11-08 20:34:06 +00:00
],
// check if imports actually resolve
settings: {
'import/resolver': {
webpack: {
config: 'build/webpack.base.conf.js'
}
}
},
// add your custom rules here
rules: {
2019-11-14 21:10:10 +00:00
"vue/html-closing-bracket-newline": ["error", {
"singleline": "never",
"multiline": "always"
}],
2019-11-08 20:34:06 +00:00
"vue/order-in-components": [
"error", {
"order": [
"el",
"name",
"parent",
"functional",
["delimiters", "comments"],
["components", "directives", "filters"],
"extends",
"mixins",
"inheritAttrs",
"model",
["props", "propsData"],
"data",
"computed",
"watch",
"LIFECYCLE_HOOKS",
"methods",
["template", "render"],
"renderError",
2018-10-19 05:15:28 +00:00
],
2019-11-08 20:34:06 +00:00
},
],
2018-10-19 05:15:28 +00:00
2019-11-08 20:34:06 +00:00
// don't require .vue extension when importing
'import/extensions': ['error', 'always', {
js: 'never',
vue: 'never'
}],
"indent": ["error", 2],
// 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 optionalDependencies
'import/no-extraneous-dependencies': ['error', {
optionalDependencies: ['test/unit/index.js']
}],
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
2018-10-19 05:15:28 +00:00
}
2019-11-08 20:34:06 +00:00
2019-11-14 21:10:10 +00:00