技術

【Angular】component.htmlをprettierで整形する

投稿日:

こんにちは

今回はcomponent.htmlをprettierで整形する方法を紹介したいと思います。

prettierとangular-html-parserをインストールします。

$ npm i prettier angular-html-parser --save-dev

インストールしたらpackage.jsonに以下を記述します。

"scripts": {
  "prettier-html": "prettier --parser angular --write **/*.component.html"
}

npm scriptを実行します。

$ npm run prettier-html

これでcomponet.htmlがprettierによって整形されるようになりました。

-技術

執筆者:


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください

関連記事

no image

【nginx/unicorn】(13: Permission denied) while connecting to upstream

どうも中田です。 AWS上でAPIサーバを構築してて、 * Webサーバ:ngi …

no image

【ionic】$ionicHistory.clearCache()が効かぬ!

どうも中田です。   ログアウトしたら、viewの情報を初期化したい! …

[Rails] バージョン上げるときに気をつけること

どうも中田です。 セキュリティ診断とかで引っかかってrailsのバージョンあげた …

no image

CSSで片方を固定、片方を可変のレイアウトを実装

こんばんは IE8・9ではdisplay: flex;が使えないがために片方を固 …

[ionic] Error code 70 / requires a provisioning profile with the Push Notifications feature.

どうも中田です ionic使っててbuildで引っかかりましたー ionicでp …