-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
69 lines (69 loc) · 2.03 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
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/vue3-recommended',
'airbnb-base',
'@vue/typescript/recommended',
'@vue/prettier',
'@vue/prettier/@typescript-eslint',
],
parserOptions: {
ecmaVersion: 2020,
},
plugins: ['import'],
rules: {
'prettier/prettier': 0,
'no-undef': 0,
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
// 'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
'import/no-extraneous-dependencies': ['error', { devDependencies: ['vite.config.ts'] }],
'import/no-unresolved': [
2,
{
ignore: ['^@/'], // @ 是设置的路径别名
},
],
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
'vue/v-on-event-hyphenation': [
'error',
'never',
{
autofix: true,
},
],
'vue/attribute-hyphenation': ['error', 'never'],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-void': ['error', { allowAsStatement: true }],
'no-restricted-globals': ['error', 'event', 'fdescribe'],
'import/prefer-default-export': 0,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
alias: {
map: [['/@', './src']],
extensions: ['.ts', '.js', '.jsx', '.json', '.scss'],
},
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
};