10up / wp-scaffold

10up WordPress project scaffold.
MIT License
184 stars 46 forks source link

Lint-staged assumes you have 10up-toolkit installed globally #220

Open johnwatkins0 opened 3 months ago

johnwatkins0 commented 3 months ago

Describe the bug

In a fresh clone of the scaffold, on a newish laptop where I have never installed 10up-toolkit globally, my initial commit fails because the commands in .lintstagedrc.json assume 10up-toolkit is available globally. I'm not sure this repository should assume 10up-toolkit is available globally, and I think it's a better practice to use the local copy of the script anyway so that the lintstaged results are aligned with the results in your code editor and CI processes.

Steps to Reproduce

  1. Clone the repo in an environment where 10up-toolkit is not installed globally
  2. npm install to set up husky and lint-staged
  3. Run a commit and see the errors
  4. Install 10up-toolkit globally, commit again, and see that 10up-toolkit runs as expected (with linting errors as of today, but that's a separate issue)

Screenshots, screen recording, code snippet

No response

Environment information

Node 20 / NPM 10

WordPress information

No response

Code of Conduct

nicholasio commented 3 months ago

Has anyone else being able to reproduce this?

darylldoyle commented 3 months ago

@nicholasio I haven't been able to replicate this either. My version always uses the local version as I don't have it installed globally 🤔

image

image