技術

【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 を使っています。コメントデータの処理方法の詳細はこちらをご覧ください

関連記事

go

【Golang】package strconvのintSize = 32 << (∧uint(0) >> 63)は何をしているのか

こんにちは Goのstrconvのパッケージを読んでたらintSizeというもの …

「Google Inside Music」で自分の好きな音楽を聞いてみる(local環境構築 編)

以前紹介した「Google Inside Music」。 「Google Ins …

[AWS S3] This XML file does not appear to have any style information associated with it. The document tree is shown below.

はじめまして。田中です。 AWSを触りはじめてから1ヶ月ちょっと。七転び八起きな …

no image

【Rails5.2】bootstrap4を追加する

こんにちは 今回はRails5にbootstrap4を追加したいと思います。 使 …

[ionic] アプリ名にハイフンやアンダーバー入ってると困る件

どうも中田です 今日もionicのお話。 スマホアプリ作るときに test-ap …