Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

最近接手了一个react的项目,但是之前代码格式化做的不好,自己打算用 prettier + eslint 重新对代码进行格式化,但是目前能做的只有保存的时候自动格式化,一次只能处理一个文件,请问有没有一种办法可以一次将所有的 jsx 文件进行格式化?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
954 views
Welcome To Ask or Share your Answers For Others

1 Answer

eslint提供了eslint --fix等指令,可以全局格式化代码,具体可以查看eslint使用文档。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...