@@ -3,10 +3,10 @@ module.exports = {
3
3
env : {
4
4
node : true ,
5
5
} ,
6
- extends : [ " plugin:vue/essential" , " eslint:recommended" , " @vue/prettier" ] ,
6
+ extends : [ ' plugin:vue/essential' , ' eslint:recommended' , ' @vue/prettier' ] ,
7
7
// 【parserOptions】扩展 ESLint 对 JavaScript 新语法和实验性特性的支持
8
8
parserOptions : {
9
- parser : " babel-eslint" ,
9
+ parser : ' babel-eslint' ,
10
10
ecmaFeatures : {
11
11
// 支持装饰器
12
12
legacyDecorators : true ,
@@ -36,55 +36,55 @@ module.exports = {
36
36
/* prettier的配置说明 ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ */
37
37
38
38
rules : {
39
- " prettier/prettier" : [
40
- " error" ,
39
+ ' prettier/prettier' : [
40
+ ' error' ,
41
41
{
42
42
semi : false ,
43
43
singleQuote : true ,
44
44
tabWidth : 2 ,
45
45
printWidth : 120 ,
46
- arrowParens : " avoid" ,
46
+ arrowParens : ' avoid' ,
47
47
bracketSpacing : true ,
48
48
insertPragma : false ,
49
49
jsxBracketSameLine : false ,
50
50
jsxSingleQuote : false ,
51
- proseWrap : " preserve" ,
52
- quoteProps : " as-needed" ,
51
+ proseWrap : ' preserve' ,
52
+ quoteProps : ' as-needed' ,
53
53
requirePragma : false ,
54
- trailingComma : " none" ,
54
+ trailingComma : ' none' ,
55
55
useTabs : false ,
56
56
} ,
57
57
] ,
58
- " no-console" : process . env . NODE_ENV === " production" ? " warn" : " off" ,
59
- " no-debugger" : process . env . NODE_ENV === " production" ? " warn" : " off" ,
58
+ ' no-console' : process . env . NODE_ENV === ' production' ? ' warn' : ' off' ,
59
+ ' no-debugger' : process . env . NODE_ENV === ' production' ? ' warn' : ' off' ,
60
60
// 使用2个空格缩进
61
61
indent : [
62
- " error" ,
62
+ ' error' ,
63
63
2 ,
64
64
{
65
65
SwitchCase : 1 ,
66
66
flatTernaryExpressions : true ,
67
67
} ,
68
68
] ,
69
69
// 代码后不使用分号
70
- semi : [ " error" , " never" ] ,
70
+ semi : [ ' error' , ' never' ] ,
71
71
// 注释 // 或 /* 之后必须有一个空格
72
- " spaced-comment" : [ " error" , " always" ] ,
72
+ ' spaced-comment' : [ ' error' , ' always' ] ,
73
73
// 必须使用let 或 const, 不能使用var
74
- " no-var" : " error" ,
74
+ ' no-var' : ' error' ,
75
75
quotes : [
76
- " warn" ,
77
- " single" ,
76
+ ' warn' ,
77
+ ' single' ,
78
78
{
79
79
avoidEscape : true ,
80
80
allowTemplateLiterals : true ,
81
81
} ,
82
82
] ,
83
83
// 禁止重复导入模块,对于同一模块内内容,应一次导入
84
- " no-duplicate-imports" : " error" ,
84
+ ' no-duplicate-imports' : ' error' ,
85
85
// 箭头函数前后必须要有空格
86
- " arrow-spacing" : [
87
- " error" ,
86
+ ' arrow-spacing' : [
87
+ ' error' ,
88
88
{
89
89
before : true ,
90
90
after : true ,
@@ -94,13 +94,10 @@ module.exports = {
94
94
// overrides 字段的作用是为特定文件或目录定义独立的规则,允许你对不同文件类型或路径应用不同的代码检查规则
95
95
overrides : [
96
96
{
97
- files : [
98
- "**/__tests__/*.{j,t}s?(x)" ,
99
- "**/tests/unit/**/*.spec.{j,t}s?(x)" ,
100
- ] ,
97
+ files : [ '**/__tests__/*.{j,t}s?(x)' , '**/tests/unit/**/*.spec.{j,t}s?(x)' ] ,
101
98
env : {
102
99
jest : true ,
103
100
} ,
104
101
} ,
105
102
] ,
106
- }
103
+ }
0 commit comments