3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【prettier】複数ファイルまとめて実行する

Posted at

npm + prettier 環境での方法です

#フォルダ配下へ再帰的に実行
カレントディレクトリより下にある、すべてのフォルダを対象にするパターン

jsをすべてフォーマット

jsをすべてフォーマット

npx prettier --write "./**/*.js"

##複数の拡張子を指定
js,css,html をすべてフォーマット

npx prettier --write "./**/*.{js,css,html}"

フォルダ直下のみ実行

カレントディレクトリの直下にあるjsが対象

npx prettier --write "./*.js"
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?