-
Notifications
You must be signed in to change notification settings - Fork 30
/
.eslintrc.js
81 lines (75 loc) · 3.02 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
80
81
// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies
const airbnb = require('eslint-config-airbnb-base/rules/style');
// Do not restrict usage of for...of
const noRestrictedSyntax = airbnb.rules['no-restricted-syntax'].slice(1).filter((r) => r.selector !== 'ForOfStatement');
const memberDelimiterStyleOverrides = {
overrides: { typeLiteral: { multiline: { delimiter: 'comma' }, singleline: { delimiter: 'comma' } } },
};
module.exports = {
env: {
browser: true,
es6: true,
},
extends: [
'plugin:vue/essential',
'@vue/airbnb',
'@vue/typescript/recommended',
],
parserOptions: {
ecmaVersion: 2020,
parser: '@typescript-eslint/parser',
},
root: true,
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'function-paren-newline': 'off',
indent: ['error', 4, { SwitchCase: 1 }],
'max-len': ['error', 120],
'no-underscore-dangle': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-continue': 'off',
'no-confusing-arrow': 'off',
'no-floating-decimal': 'off',
'no-return-assign': 'off',
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'import/prefer-default-export': 'off',
'import/no-cycle': 'off',
'implicit-arrow-linebreak': 'off',
'object-curly-newline': ['error', { ObjectPattern: { multiline: true } }],
'prefer-const': ['error', { destructuring: 'all' }],
'no-nested-ternary': 'off',
'no-restricted-syntax': ['error', ...noRestrictedSyntax],
'vuejs-accessibility/click-events-have-key-events': 'off',
'vuejs-accessibility/form-control-has-label': 'off',
'vuejs-accessibility/label-has-for': 'off',
'vue/multi-word-component-names': 'off',
'@typescript-eslint/member-delimiter-style': ['error', memberDelimiterStyleOverrides],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
// Do not require explicit function return value typings
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off',
// False positives that are checked by TS
'no-redeclare': 'off',
// 'no-param-reassign': 'off',
// 'import/no-unresolved': 'off',
},
overrides: [{
files: ['src/components/icons/**/*', 'src/components/Avatar.vue'],
rules: {
'max-len': 'off',
},
}, {
files: ['src/lib/NetworkMap.ts'],
rules: {
'max-classes-per-file': 'off',
},
}],
};