-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
104 lines (102 loc) · 2.39 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
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution');
const [error, warn, off] = [2, 1, 0];
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier',
,
'google',
],
parserOptions: {
ecmaVersion: 'latest',
},
plugins: ['modules-newline'],
rules: {
'@typescript-eslint/no-explicit-any': off,
'no-debugger': warn,
'no-console': [warn, { allow: ['warn', 'error'] }],
// note: rebind google config coz of some reasons
'require-jsdoc': off,
'max-len': [
warn,
{
code: 120,
tabWidth: 2,
ignoreUrls: true,
ignorePattern: 'goog.(module|require)',
},
],
'new-cap': off,
'linebreak-style': [error, 'unix'],
'@typescript-eslint/explicit-module-boundary-types': off,
'object-curly-spacing': [warn, 'always'],
'object-curly-newline': [
warn,
{
ObjectPattern: {
multiline: true,
minProperties: 2,
},
ObjectExpression: {
multiline: true,
minProperties: 2,
},
ImportDeclaration: {
multiline: true,
minProperties: 3,
},
ExportDeclaration: {
multiline: true,
minProperties: 3,
},
},
],
'object-property-newline': warn,
'modules-newline/import-declaration-newline': off,
'modules-newline/export-declaration-newline': warn,
},
overrides: [
{
files: ['*.vue'],
parser: 'vue-eslint-parser',
rules: {
'vue/max-attributes-per-line': [
'error',
{
singleline: {
max: 3,
},
multiline: {
max: 1,
},
},
],
'vue/no-v-html': off, // note: need in some cases sometimes
'vue/no-unused-vars': error,
'no-invalid-this': off,
// ts conflicts
'@typescript-eslint/explicit-module-boundary-types': off,
},
},
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
rules: {
'no-unused-vars': off,
'@typescript-eslint/no-unused-vars': error,
},
},
],
globals: {
defineProps: 'readonly',
defineEmits: 'readonly',
withDefaults: 'readonly',
},
};