WasmEdge / docs

https://wasmedge.org/docs/
Apache License 2.0
17 stars 58 forks source link

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

Open adithyaakrishna opened 1 year ago

adithyaakrishna commented 1 year ago

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.

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 https://github.com/WasmEdge/docs/issues/76#issuecomment-1583160438 for noticing this bug :)

ashutosh-rath02 commented 1 year ago

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

adithyaakrishna commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Yes, that would be a good starting point :)

ashutosh-rath02 commented 1 year ago

@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 commented 1 year ago

@adithyaakrishna sir can you please check this?

adithyaakrishna commented 1 year ago

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

alabulei1 commented 1 year ago

Hi @adithyaakrishna

Could you please check out the status of this issue?

adithyaakrishna commented 1 year ago

I'll fix it and send a PR :)

alabulei1 commented 7 months ago

Any progress for this issue?