技術

【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

[Rails] deviseのパスワード認証を半角英数字だけ許可する

こんばんは ログイン機能を作る時ってdeviseが便利ですよね。 ですが、デフォ …

【ionic】バックボタンの文字だけ消す

どうも中田です。 今回はHTML5ハイブリッド開発でお馴染みのionicについて …

[Rails] モデルが初期化されてないとな(not initialized)

どうも中田です Railsで、modelの initialize に処理を追加す …

no image

[Angular]APIから画像を取得して表示する

こんばんは アプリケーションを作っていてフロント側で画像を出すときって ストレー …

[Xcode] SDK Version Issue – This app was built with the iOS 12.0 SDK. Starting March 2019, all iOS apps submitted to the App Store must be built with the iOS 12.1 SDK or later, included in Xcode 10.1 or later.

こんにちは。たなかです。 2019年、ブログ初更新になります。今年もよろしくお願 …