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

Bug: lint-staged script missing for husky pre-commit-hook #99

Open
adithyaakrishna opened this issue Jun 9, 2023 · 10 comments · May be fixed by #115
Open

Bug: lint-staged script missing for husky pre-commit-hook #99

adithyaakrishna opened this issue Jun 9, 2023 · 10 comments · May be fixed by #115
Labels
bug Something isn't working

Comments

@adithyaakrishna
Copy link
Contributor

Describe the bug.

The pre-commit hook for husky is missing a script to lint staged files for git commit workflow

Describe the steps to reproduce the behavior.

  • Clone this repo
  • Make some changes with lint issues
  • Try committing the change, husky will exit with code 1 similar to the below screenshot

Expected behavior.

Add a lint-staged script to handle and fix the error

Screenshots.

image

Operating Environment

Windows/macOS/Linux

Additional Information

Credits to @Lucif3r-in at #76 (comment) for noticing this bug :)

@adithyaakrishna adithyaakrishna added the bug Something isn't working label Jun 9, 2023
@ashutosh-rath02
Copy link
Contributor

@adithyaakrishna Can you suggest what should be the expected behaviour ?

@adithyaakrishna
Copy link
Contributor Author

adithyaakrishna commented Jun 12, 2023

We would need to add a lint-staged script under https://github.com/WasmEdge/docs/blob/main/package.json#L6

The script would be something like this, but not the exact one as we need to make changes according to this repo

"lint-staged": {
        "*.ts*": "eslint --ignore-path .gitignore --cache --fix"
    }

@ashutosh-rath02
Copy link
Contributor

We would need to add a lint-staged script under https://github.com/WasmEdge/docs/blob/main/package.json#L6

The script would be something like this, but not the exact one as we need to make changes according to this repo

"lint-staged": {
        "*.ts*": "eslint --ignore-path .gitignore --cache --fix"
    }

@adithyaakrishna I was looking into this https://github.com/okonet/lint-staged#Configuration for reference.

@adithyaakrishna
Copy link
Contributor Author

Yes, that would be a good starting point :)

@ashutosh-rath02
Copy link
Contributor

@adithyaakrishna We were getting the error as lint-staged wasn't mentioned in the script. Now that is fixed but there is an issue of cspell which is causing the commit to fail.
image

@ashutosh-rath02
Copy link
Contributor

@adithyaakrishna sir can you please check this?

@adithyaakrishna
Copy link
Contributor Author

@Lucif3r-in You can remove the cspell check for the project AFAIK. We need the lint-staged script to work

This was referenced Jun 19, 2023
@alabulei1
Copy link
Collaborator

Hi @adithyaakrishna

Could you please check out the status of this issue?

@adithyaakrishna
Copy link
Contributor Author

I'll fix it and send a PR :)

@alabulei1
Copy link
Collaborator

Any progress for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants