11module . exports = {
22 extends : [
33 'airbnb-base' ,
4- 'prettier' , // eslint-config-prettier 处理冲突
54 'plugin:react/recommended' ,
65 'plugin:@typescript-eslint/recommended' ,
6+ 'plugin:prettier/recommended' ,
77 ] ,
88 parser : '@typescript-eslint/parser' ,
9- plugins : [ '@typescript-eslint' , 'react-hooks' , 'simple-import-sort' ] ,
9+ plugins : [ '@typescript-eslint' , 'react-hooks' , 'simple-import-sort' , 'prettier' ] ,
1010 env : {
1111 browser : true ,
1212 node : true ,
@@ -69,7 +69,25 @@ module.exports = {
6969 ] ,
7070 'max-len' : 'off' ,
7171 'no-shadow' : 'off' ,
72-
72+ 'prettier/prettier' : [
73+ 'error' ,
74+ {
75+ printWidth : 120 ,
76+ tabWidth : 2 ,
77+ useTabs : false ,
78+ semi : true ,
79+ singleQuote : true ,
80+ quoteProps : 'as-needed' ,
81+ jsxSingleQuote : false ,
82+ trailingComma : 'all' ,
83+ bracketSpacing : true ,
84+ jsxBracketSameLine : false ,
85+ arrowParens : 'always' ,
86+ proseWrap : 'preserve' ,
87+ htmlWhitespaceSensitivity : 'css' ,
88+ endOfLine : 'lf' ,
89+ } ,
90+ ] ,
7391 // import config
7492 'import/order' : 'off' ,
7593 'import/extensions' : 'off' ,
@@ -103,7 +121,6 @@ module.exports = {
103121 } ,
104122 ] ,
105123 'simple-import-sort/exports' : 'error' ,
106-
107124 // typescript config
108125 '@typescript-eslint/explicit-module-boundary-types' : 'off' ,
109126 '@typescript-eslint/ban-types' : 'off' ,
@@ -125,7 +142,6 @@ module.exports = {
125142 disallowTypeAnnotations : false ,
126143 } ,
127144 ] ,
128-
129145 // react config
130146 'react/display-name' : 'off' ,
131147 'react-hooks/exhaustive-deps' : 'warn' ,
0 commit comments