0
0

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 1 year has passed since last update.

commit時にcommit-lintを実行する方法【Lefthook】

Last updated at Posted at 2023-07-28

パッケージのインストール

以下のコマンドを実行してLefthookをインストールします。

ターミナル
$ yarn add -D lefthook

Lefthookの設定

Lefthookの設定をします。
lefthook.ymlを作成し、以下のように記述します。

lefthook.yml
commit-msg:
  skip: merge
  commands:
    commitlint:
      run: yarn commitlint --edit {1}

動作確認

以下のコマンドを実行し、正常に動作するか確認します。

ターミナル
$ npx lefthook install && npx lefthook run commit-msg
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?