-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc.js
78 lines (73 loc) · 1.83 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
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'eslint:recommended',
'@vue/typescript/recommended',
'wikimedia/client-common',
'wikimedia/vue3-common',
'@wmde/wikimedia-typescript',
'plugin:jsonc/base',
// this plugin is installed already as a dependency of eslint-config-wikimedia.
// So it is not necessary to add it again as a dependency in package.json
'plugin:yml/base',
],
parser: 'vue-eslint-parser',
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
// diverging from Wikimedia rule set
'max-len': [ 'error', 120 ],
'comma-dangle': [ 'error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'always-multiline',
} ],
'vue/html-indent': [ 'error', 'tab' ],
'vue/multi-word-component-names': 'off',
'vue/no-reserved-component-names': 'off',
'vue/no-v-html': 'off',
// This is done by Typescript itself and only causes false positives
'no-undef': 'off',
// temporarily disabled for update
'no-shadow': 'off',
},
overrides: [
{
files: [ 'tests/util/*.ts', '**/tests/{unit,a11y,integration}/**/*.spec.{j,t}s?(x)' ],
env: {
jest: true,
},
},
{
files: [ '*.js' ],
extends: [
'wikimedia/node',
],
parserOptions: {
sourceType: 'module',
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: [ '*.json' ],
parser: 'jsonc-eslint-parser',
rules: {
'max-len': 'off',
'no-irregular-whitespace': 'off',
},
},
{
files: [ '*.yaml', '*.yml' ],
parser: 'yaml-eslint-parser',
},
],
};