This repository has been archived by the owner on Sep 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
79 lines (79 loc) · 2.04 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
module.exports = {
root: true,
globals: {
t: true,
n: true,
OC: true,
OCA: true,
Vue: true,
VueRouter: true,
SCOPE_VERSION: true
},
parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 8
},
extends: [
'eslint:recommended',
'plugin:node/recommended',
'plugin:vue/essential',
'plugin:vue/recommended',
'standard'
],
plugins: [
'nextcloud',
'node',
'vue',
],
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
'no-console': ['error', { allow: ['error', 'warn', 'debug'] }],
// classes blocks
'padded-blocks': ['error', { classes: 'always' }],
// always have the operator in front
'operator-linebreak': ['error', 'before'],
// ternary on multiline
'multiline-ternary': ['error', 'always-multiline'],
// Nextcloud deprecations
'nextcloud/no-deprecations': 'warn',
// don't allow removed APIs
'nextcloud/no-removed-apis': 'error',
// es6 import/export and require
'node/no-missing-import': ['error', {
'tryExtensions': ['.js', '.json', '.vue']
}],
'node/no-unpublished-require': ['off'],
'node/no-unsupported-features/es-syntax': ['off'],
// kebab case components for vuejs
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
// force name
'vue/match-component-file-name': ['error', {
'extensions': ['jsx', 'vue', 'js'],
'shouldMatchCase': true
}],
// space before self-closing elements
'vue/html-closing-bracket-spacing': 'error',
// no ending html tag on a new line
'vue/html-closing-bracket-newline': ['error', { multiline: 'never' }],
// code spacing with attributes
'vue/max-attributes-per-line': [
'error',
{
singleline: 3,
multiline: 3
}
]
}
}