2018-08-30 20:22:27 +00:00
|
|
|
module.exports = {
|
|
|
|
root: true,
|
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
es6: true,
|
|
|
|
node: true,
|
|
|
|
jest: true
|
|
|
|
},
|
|
|
|
globals: {
|
|
|
|
t: false,
|
|
|
|
n: false,
|
|
|
|
OC: false,
|
2018-09-03 20:21:28 +00:00
|
|
|
OCA: false,
|
2018-09-09 10:24:25 +00:00
|
|
|
moment: true,
|
2019-09-05 21:08:45 +00:00
|
|
|
$appVersion: true,
|
2018-08-30 20:22:27 +00:00
|
|
|
},
|
|
|
|
parserOptions: {
|
|
|
|
parser: 'babel-eslint'
|
|
|
|
},
|
|
|
|
extends: [
|
|
|
|
'eslint:recommended',
|
|
|
|
'plugin:node/recommended',
|
|
|
|
'plugin:vue/recommended',
|
|
|
|
'standard'
|
|
|
|
],
|
|
|
|
plugins: ['vue', 'node'],
|
|
|
|
rules: {
|
|
|
|
// space before function ()
|
|
|
|
'space-before-function-paren': ['error', 'never'],
|
|
|
|
// curly braces always space
|
|
|
|
'object-curly-spacing': ['error', 'always'],
|
|
|
|
// stay consistent with array brackets
|
|
|
|
'array-bracket-newline': ['error', 'consistent'],
|
|
|
|
// 1tbs brace style
|
|
|
|
'brace-style': 'error',
|
|
|
|
// tabs only
|
|
|
|
indent: ['error', 'tab'],
|
|
|
|
'no-tabs': 0,
|
|
|
|
'vue/html-indent': ['error', 'tab'],
|
|
|
|
// only debug console
|
2018-11-03 06:17:33 +00:00
|
|
|
'no-console': ['error', { allow: ['error', 'warn', 'debug'] }],
|
2018-08-30 20:22:27 +00:00
|
|
|
// classes blocks
|
2018-11-03 06:17:33 +00:00
|
|
|
'padded-blocks': ['error', { classes: 'always' }],
|
|
|
|
// always add a trailing comma, for diff readability
|
|
|
|
'comma-dangle': ["error", "only-multiline"],
|
|
|
|
// always have the operator in front
|
|
|
|
'operator-linebreak': ['error', 'before'],
|
|
|
|
// ternary on multiline
|
|
|
|
'multiline-ternary': ['error', 'always-multiline'],
|
|
|
|
// force proper JSDocs
|
|
|
|
'valid-jsdoc': [2, {
|
|
|
|
'prefer': {
|
|
|
|
'return': 'returns'
|
|
|
|
},
|
|
|
|
'requireReturn': false,
|
|
|
|
'requireReturnDescription': false
|
|
|
|
}],
|
2019-09-07 19:59:23 +00:00
|
|
|
"node/no-missing-import": ["error", {
|
|
|
|
"tryExtensions": [".js", ".json", ".node", ".vue"]
|
|
|
|
}],
|
2018-08-30 20:22:27 +00:00
|
|
|
// es6 import/export and require
|
|
|
|
'node/no-unpublished-require': ['off'],
|
2018-11-17 10:58:40 +00:00
|
|
|
'node/no-unsupported-features/es-syntax': ['off'],
|
2018-08-30 20:22:27 +00:00
|
|
|
// space before self-closing elements
|
|
|
|
'vue/html-closing-bracket-spacing': 'error',
|
|
|
|
// code spacing with attributes
|
|
|
|
'vue/max-attributes-per-line': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
singleline: 3,
|
|
|
|
multiline: {
|
|
|
|
max: 3,
|
|
|
|
allowFirstLine: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|