Skip to content

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

Closed

Description

@adithyaakrishna

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 :)

Activity

  1. added
    bug
    on Jun 9, 2023
  2. ashutosh-rath02 commented on Jun 12, 2023

    @ashutosh-rath02
    Contributor

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

  3. adithyaakrishna commented on Jun 12, 2023

    @adithyaakrishna
    ContributorAuthor

    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"
        }
  4. ashutosh-rath02 commented on Jun 12, 2023

    @ashutosh-rath02
    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.

  5. adithyaakrishna commented on Jun 12, 2023

    @adithyaakrishna
    ContributorAuthor

    Yes, that would be a good starting point :)

  6. ashutosh-rath02 commented on Jun 12, 2023

    @ashutosh-rath02
    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

  7. ashutosh-rath02 commented on Jun 16, 2023

    @ashutosh-rath02
    Contributor

    @adithyaakrishna sir can you please check this?

  8. adithyaakrishna commented on Jun 19, 2023

    @adithyaakrishna
    ContributorAuthor

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

  9. alabulei1 commented on Sep 8, 2023

    @alabulei1
    Collaborator

    Hi @adithyaakrishna

    Could you please check out the status of this issue?

  10. adithyaakrishna commented on Sep 8, 2023

    @adithyaakrishna
    ContributorAuthor

    I'll fix it and send a PR :)

  11. alabulei1 commented on Jan 25, 2024

    @alabulei1
    Collaborator

    Any progress for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions