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

Husky git hook with lint-staged not working #1417

Open
RatikantS opened this issue Apr 8, 2024 · 1 comment
Open

Husky git hook with lint-staged not working #1417

RatikantS opened this issue Apr 8, 2024 · 1 comment

Comments

@RatikantS
Copy link

RatikantS commented Apr 8, 2024

I have just added "npm run test" to git commit hook, its failing with below error (refer the snapshot) - seems the matching files are being passed as argument?

"husky": "^8.0.3",
"lint-staged": "^15.2.2",

Config in .lintstagedrc file:

{
    "src/**/*.{js,ts}": [
        "npm run test"
    ]
}

image

@TobiTenno
Copy link

yes, that is how lint-staged works in general. you can ignore them by providing a lambda in your config instead of a json-formatted config file, like in lint-staged's ts example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants