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

PrettierをPHPでも使う方法

Posted at

PHP版のPrettierをインストール

$ npm install -g prettier @prettier/plugin-php

VSCodeの保存時に自動的にPrettierを起動させる

VSCodeのsettings.jsonに下記を追記する
※settings.jsonを開くには画面左下の⚙️を押し、右上の{}を押す

  "editor.formatOnSave": true,

Prettier整形させたくない時

  • prettier-ignore のコメントつけるとその下の行は整形されない
// prettier-ignore
$hoge = [
1,2,3,
  4,5,6
];
1
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
1
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?