-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
66 lines (66 loc) · 1.67 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
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
// 开启setup语法糖环境
'vue/setup-compiler-macros': true,
},
extends: [
// 'plugin:vue/essential',
// 'plugin:vue/vue3-essential',
'plugin:vue/vue3-recommended',
'plugin:import/recommended',
'airbnb-base',
// 'plugin:prettier/recommended',
'plugin:@typescript-eslint/eslint-recommended',
],
parserOptions: {
ecmaVersion: 6,
parser: '@typescript-eslint/parser',
sourceType: 'module',
},
plugins: [
'vue',
'@typescript-eslint',
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
// 'prettier/prettier': 'error',
'import/no-extraneous-dependencies': ['error', {'devDependencies': true}],
'import/extensions': 'off',
'import/prefer-default-export': 'off',
'no-mixed-spaces-and-tabs': 'error',
'quotes': [2, 'single'],
'vue/html-self-closing': ['error', {
'html': {
'void': 'always',
},
}],
'vue/html-closing-bracket-newline': 'off', // 不强制换行
'vue/multiline-html-element-content-newline': 'off',
'vue/singleline-html-element-content-newline': 'off', // 不强制换行
'vue/max-attributes-per-line': ['error', {
singleline: { max: 2 },
multiline: { max: 1 }
}], // vue template模板元素第一行最多5个属性
'arrow-parens': 'off',
'no-param-reassign': [
2,
{
props: false,
},
],
},
settings: {
'import/resolver': {
alias: {
map: [
['@', './src'],
],
extensions: ['.ts', '.js', '.jsx', '.json'],
},
},
},
};