File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module.exports = {
14
14
"react/no-array-index-key" : "off" ,
15
15
"react/jsx-props-no-spreading" : "off" ,
16
16
"no-console" : "off" ,
17
+ semi : [ "error" , "always" ] ,
17
18
quotes : [ "error" , "single" ] ,
18
19
} ,
19
20
env : {
Original file line number Diff line number Diff line change @@ -4,13 +4,15 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo
4
4
5
5
In the project directory, you can run:
6
6
7
-
8
7
### ` npm install `
9
8
10
9
安装依赖
11
10
12
11
### ` npm start `
13
12
14
- 启动项目(http://localhost:3000) .<br >
13
+ 启动项目(< http://localhost:3000 > ) .<br >
15
14
15
+ ### tip
16
16
17
+ 该项目解决 eslint 和 prettier 的方式为,vscode 自动保存时使用 eslint 规则,然后在 pre-commit 里先走 prettier 的规则,再走 eslint --fix。
18
+ 考虑的点在于:如果在自动保存的时候,同时启用两个规则,有些规则会导致冲突。eslint 主要是为了处理某些 js 规范,prettier 是为了代码简洁,美观。如果先走 eslint 再走 prettier,会导致某些冲突。反之则不会,对于开发来讲 eslint 的优先级是大于 prettier 的
You can’t perform that action at this time.
0 commit comments