# Husky

> Huskeyは、悪質なコミット、プッシュなどを防ぐことができます🐶!

コミットが行われる前に何らかのJavaScript/TypeScriptコードを実行したい場合は、huskyがそのためのツールです。

たとえば、huskyを使用して、ファイルが自動的によりきれいにフォーマットされるようにすることができます。手動でファイルをフォーマットしたかを心配する必要は二度とありません。代わりにコードの目的にフォーカスすることができます。セットアップの方法は以下の通りです：

* `npm install husky -D`
* `scripts`を`package.json`に追加します：

```javascript
    "precommit": "npm run prettier:write",
```

コードをコミットし、フォーマットの変更が必要があるときはいつでも、変更されたファイルが、git logに書き込まれます。あなたは下記のことが可能です:

* あなたのコードを既にpushしている場合は、単純に`pretty`というコメントでコミットしてください。
* コードをpushしていない場合は、最後のコミットをamendしてください。スーパーヒーローのように見えます。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://typescript-jp.gitbook.io/deep-dive/intro-2/husky.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
