-
Notifications
You must be signed in to change notification settings - Fork 22
/
.eslintrc.cjs
121 lines (120 loc) · 3.8 KB
/
.eslintrc.cjs
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:jsdoc/recommended',
'plugin:vue/vue3-recommended',
'@vue/eslint-config-typescript/recommended',
'@vue/eslint-config-prettier',
],
env: {
'browser': true,
'es2022': true,
'vue/setup-compiler-macros': true,
},
plugins: ['jsdoc', 'simple-import-sort'],
ignorePatterns: ['**/src/libs/connection/m2r/**'],
rules: {
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
'indent': 'off',
'import/extensions': 'off',
'import/order': 'off',
'jsdoc/require-jsdoc': [
'error',
{
require: {
ArrowFunctionExpression: false,
ClassDeclaration: true,
FunctionDeclaration: true,
FunctionExpression: false,
MethodDefinition: true,
},
contexts: ['TSEnumDeclaration', 'TSInterfaceDeclaration', 'TSMethodSignature', 'TSPropertySignature'],
},
],
'jsdoc/require-param-description': 0,
'jsdoc/require-returns-description': 0,
'jsdoc/newline-after-description': 'off',
'jsdoc/no-undefined-types': 'off',
'jsdoc/require-returns': ['error', { forceReturnsWithAsync: false }],
'max-len': ['error', { code: 180, ignoreUrls: true, ignoreComments: true }],
'no-alert': 'off',
'no-console': 'off',
'no-continue': 'off',
// modified https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/style.js#L339
// In our opinion, readability comes first and ForOF statements are more readable,
// so we remove the ForOfStatement block.
'no-restricted-syntax': [
'error',
{
selector: 'ForInStatement',
message:
'for..in loops iterate over the entire prototype chain, which is virtually never what you want.' +
'Use Object.{keys,values,entries}, and iterate over the resulting array.',
},
{
selector: 'LabeledStatement',
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
},
{
selector: 'WithStatement',
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
},
],
'no-param-reassign': 'off',
'no-shadow': 'off',
'no-useless-constructor': 'off',
'semi': ['error', 'never'],
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'spaced-comment': ['error', 'always'],
'sort-imports': 'off',
'@typescript-eslint/ban-ts-comment': ['off'],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-useless-constructor': ['error'],
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
'@typescript-eslint/no-explicit-any': 'off',
'vue/no-unused-properties': [
'error',
{
groups: ['props', 'data', 'computed', 'methods', 'setup'],
deepData: true,
ignorePublicMembers: false,
},
],
'vue/valid-v-slot': ['error', { allowModifiers: true }],
'no-await-in-loop': 'off',
'vue/multi-word-component-names': 'off',
'vue/max-len': [
'error',
{
code: 180,
template: 180,
tabWidth: 4,
comments: 180,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreHTMLAttributeValues: true,
ignoreHTMLTextContents: true,
ignoreUrls: true,
},
],
},
settings: {
jsdoc: {
mode: 'typescript',
},
},
overrides: [
{
files: ['*.vue'],
rules: {
'max-len': ['off'],
},
},
],
}