Skip to content

Possible typo on local setup guide #2511

Closed
@dmoonfire

Description

@dmoonfire

On https://commitlint.js.org/#/./guides-local-setup?id=guides-local-setup, there is the following block of instructions.

# Add hook
npx husky add .husky/commit-msg "npx --no-install commitlint --edit $1"
# or
yarn husky add .husky/commit-msg "yarn commitlint --edit $1"

If the file .husky/commit-msg already exists, you can edit the file and put this:

# .husky/commit-msg
# ...
npx --no-install commitlint --edit $1
# or
yarn commitlint --edit $1

Expected Behavior

Following the two sets of directions would produce the file with a $1 in it.

Current Behavior

When following the first direction yarn husky add .husky/commit-msg "yarn commitlint --edit $1", it puts yarn commitlint --edit in the file.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

I believe changing the first set of directions to:

# Add hook
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit $1'
# or
yarn husky add .husky/commit-msg 'yarn commitlint --edit $1'

Steps to Reproduce (for bugs)

  1. Follow the first set of directions and look at the file.
  2. Look at the file and see a missing $1.

Context

No major impact, just required an extra step to puzzle out.

Your Environment

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions