-
Notifications
You must be signed in to change notification settings - Fork 43
/
.eslintrc.cjs
92 lines (91 loc) · 2.57 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
module.exports = {
root: true,
extends: [
// add more generic rulesets here, such as:
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-essential',
'plugin:vue/vue3-recommended',
'prettier',
],
parser: 'vue-eslint-parser',
parserOptions: {
parser: {
// Script parser for `<script>`
js: '@typescript-eslint/parser',
// Script parser for `<script lang="ts">`
ts: '@typescript-eslint/parser',
},
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
extraFileExtensions: ['.vue'],
},
overrides: [
{
files: ['*.vue'],
rules: {},
},
{
files: ['*.cjs'],
rules: {},
},
],
rules: {
// override/add rules settings here, such as:
'lines-around-comment': ['warn', { beforeBlockComment: true }],
'vue/multi-word-component-names': 'off',
'vue/require-default-prop': 'off',
'vue/no-v-html': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { args: 'after-used' }],
'no-undef': 'off', // ts(2304)
'@typescript-eslint/no-duplicate-enum-values': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'allowSingleOrDouble',
filter: {
// you can expand this regex to add more allowed names
regex: '^((__v_.*)|([0-9]+))$',
match: false,
},
},
{
selector: 'variable',
modifiers: ['const'],
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'allowSingleOrDouble',
},
{
selector: ['memberLike'],
format: null,
// format: ['camelCase', 'PascalCase'],
// leadingUnderscore: 'allowSingleOrDouble',
// filter: {
// // you can expand this regex to add more allowed names
// regex: '^((__v_.*)|([0-9]+))$',
// match: false,
// },
},
{
selector: 'enumMember',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allowSingleOrDouble',
},
{
selector: ['typeLike', 'enum'],
format: ['PascalCase'],
leadingUnderscore: 'allowSingleOrDouble',
},
{
selector: ['default'],
modifiers: ['destructured', 'exported'],
format: null,
},
],
},
};