2
1

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 5 years have passed since last update.

JetBrains製IDEで保存時に Prettier で整形する

Posted at

Rails + TypeScript + webpack環境構築

入れるべきプラグインは次の2つ。

  • File Watchers
    • ファイルの変更を検知して処理を行いたい時に役立つプラグイン。
  • Prettier
    • File Watchers で Prettier を使う設定テンプレを追加してくれる。
    • Reformat with Prettier アクションも追加してくれる。

設定

Settings => Tools => File Watchers

file_watchers.png

File type に自動整形を行いたいファイルの種類をを選択。(ここでは TypeScript
globalの /usr/lib/node_modules/prettierを使うなら Program を変更。
ほかは変更不要。

new_watcher.png

複数の種類で自動整形したいなら、ファイルの種類の数だけ設定すればOK。

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?