Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update setting-up-your-editor.md #13473

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions docusaurus/docs/setting-up-your-editor.md
Expand Up @@ -116,13 +116,20 @@ Prettier is an opinionated code formatter with support for JavaScript, CSS and J
To format our code whenever we make a commit in git, we need to install the following dependencies:

```sh
npm install --save husky lint-staged prettier
npm install --save-dev husky lint-staged prettier
```

Alternatively you may use `yarn`:

```sh
yarn add husky lint-staged prettier
yarn add husky lint-staged prettier --dev
```

Afterwards, install the githooks by running this set of commands since [husky doesn't automatically install hooks](https://blog.typicode.com/posts/husky-git-hooks-autoinstall/):

```sh
npm pkg set scripts.prepare="husky install"
npm run prepare
```

- `husky` makes it possible to use githooks as if they are npm scripts.
Expand Down