2017-06-23 125 views

回答

2

剛剛找到解決方案。下面的命令會同時指定TSTSX

prettier --write ./src/**/*.{ts,tsx} 

Prettier使用Glob語法其語法類似於正則表達式,在殼中。

見GLOB語法細節:https://github.com/isaacs/node-glob/blob/master/README.md#glob-primer

+0

你確定這不是你的shell擴展該glob模式? – robertklep

+0

嗯..也許沒有''「'會直接用shell? https://github.com/prettier/prettier#cli但我在窗口,所以不知道.. 請如果你能提供更好的解釋將不勝感激,我可以接受你的答案。或者只是編輯.. – Jurosh

+0

啊,在Windows中它可能工作不同。無論如何,這並不是真正的相關,因爲它的工作原理:D – robertklep

相關問題