Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Prettier
Search
chiroruxx
April 25, 2018
Technology
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Prettier
chiroruxx
April 25, 2018
More Decks by chiroruxx
See All by chiroruxx
Contextとはなにか
chiroruxx
1
470
初心者エンジニアから中級者エンジニアになるためにオススメの1冊
chiroruxx
0
150
Laravelのパッケージ全部紹介する
chiroruxx
2
160
Gopher のための「自由な話し合い」ワークショップ
chiroruxx
0
56
PHPをGoで動かす
chiroruxx
0
120
Goを使ってTDDを体験しよう!
chiroruxx
1
1.4k
今ならできる!PhpStormプラグイン開発
chiroruxx
0
130
Go Connectへの想い
chiroruxx
0
250
eBPF with PHPをさわる
chiroruxx
0
210
Other Decks in Technology
See All in Technology
『GOエコノミー 』(相乗りサービス) におけるスペック駆動開発
mot_techtalk
1
260
BedrockとLambdaで作る リアルタイム進行型推理ゲーム
kawametho
0
170
データ品質を壊しながらSnowflakeのAIに分析させてみた
kawanago
0
460
ログラスのマルチプロダクトを 支える認証基盤 〜テナントごとに異なる統制とどう向き合うか〜
dada4386
3
340
検証フェーズはAIの回答を判断するための学習機会
toru_kubota
2
470
OSC2026on_the-world-is-waiting-for-your-voice.pdf
naruoga
0
330
個別開発で終わらせない。 現場の課題をプロダクトの強さに変える StockmarkのFDE
ktkrhr
0
560
全社共通データ基盤をつくる。ソニーのDatabricks活用とデータガバナンス設計の裏側
sony
0
350
The kernel report
ennael
PRO
1
230
組み立てて楽しむ AWS Blocks 入門
kmiya84377
0
190
[2026 Oracle Technical Deep Dive] AI時代のアプリケーションを支えるCloud NativeとJava EEモダナイゼーション (2026年9月17日開催)
oracle4engineer
PRO
0
110
OpenSharing について熱く語る〜AI アセットの共有について〜
kameitomohiro
0
190
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
10k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
The browser strikes back
jonoalderson
0
1.8k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Navigating Weather and Climate Data
rabernat
0
540
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Building Applications with DynamoDB
mza
96
7.2k
Everyday Curiosity
cassininazir
0
340
Side Projects
sachag
456
43k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
Transcript
PRETTIER PHP勉強会@東京 前田 和人
自己紹介 ▪ 前田 和人 ▪ @chiroruxxxx ▪ 弁護士ドットコム株式会社 ▪ Android派
None
Prettierってなに
Prettierとは? ▪ JavaScript®界隈で有名なコードフォーマッター ▪ Gopherの人はgofmtを思い浮かべてくれるといいです ▪ それのPHP版が出たという話
インストール $ yarn add --dev prettier/prettier @prettier/plugin-php ▪ これだけ!
実行 ▪ $ yarn run prettier /path/to/file –write ▪ Writeオプションがない場合は結果が出力されて終わる
▪ Writeオプションがある場合はファイルが書き換わる
使用例 <?php $indent = function () { return 2; };
<?php $indent=function(){return 2;};
php-cbfやphp-cs-fixerで 良いのでは
他ツールとの違い ▪ php-cbf・php-cs-fixer – PSRなどの様々なコーディング規約に則っているかを チェックする – 多くのオプションがあり独自カスタマイズ可能 – 違反をチェックしてくれる
▪ pritter – 対応しているものはPSR-1, PSR-2, PSR-12のみ – なるべくオプションを制限 – 違反という概念がない
その他の魅力 ▪ 長い行の自動改行 <?php $result = preg_match('@.*/ab.@', 'tooLongStriiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiing!'); <?php $result
= preg_match( '@.*/ab.@', 'tooLongStriiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiing!' );
その他の魅力 ▪ 無駄なスペースの除去 <?php $a = 'b’; <?php $a =
'b';
まとめ ▪ 良い – 細かい部分までフォーマットしてくれる – 設定がほぼ要らない ▪ 悪い –
JavaScript®依存 – ドキュメントが少ない – 細かい設定ができない ▪ アルファ版なので、今後を見守りたいですね