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

Categories

0 votes
930 views
in Technique[技术] by (71.8m points)

如何对 react 项目进行整体的格式化?

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


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

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...