-
Notifications
You must be signed in to change notification settings - Fork 42
/
.eslintrc.js
50 lines (46 loc) · 1.22 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
module.exports = {
env: {
browser: true,
es2021: true,
node: true
},
extends: [
'plugin:vue/vue3-essential',
'standard-with-typescript',
'plugin:vue/vue3-recommended',
'plugin:prettier/recommended'
],
overrides: [
{
files: ['*.vue'],
rules: {
'no-undef': 'off'
}
}
],
parserOptions: {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser',
sourceType: 'module',
project: ['./tsconfig.json'],
extraFileExtensions: ['.vue']
},
ignorePatterns: ['vite.config.ts', 'vitest.config.ts'],
plugins: ['vue'],
rules: {
'no-console':
process.env.NODE_ENV === 'production'
? ['error', { allow: ['warn', 'error'] }]
: 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
// 解决 prettier 行尾报错
'prettier/prettier': ['error', { endOfLine: 'auto' }],
'no-plusplus': 'off',
'no-fallthrough': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'vue/multi-word-component-names': 'off',
'vue/no-setup-props-destructure': 'off'
}
};