No staged files match any of provided globs
See original GitHub issueDescription
Folder Structure
Both client and server have package.json with different lint-staged config
client/package.json
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "lint-staged"
}
},
"lint-staged": {
"*": [
"prettier --write",
"eslint",
"git add"
]
}
server/package.json
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "lint-staged"
}
},
"lint-staged": {
"*.js": [
"prettier --write",
"eslint",
"git add"
]
}
lint-stage is working on the staged files of the server folder but not working staged files of the client folder instead it complains about No staged files match any of provided globs
. But if I run npx lint-staged -d
from the client folder using cmd, lint-stage works on staged files of the client folder.
Environment
- OS: Windows 10
- Node.js: v10.15.0
lint-staged
: 9.2.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:14
- Comments:23
Top Results From Across the Web
No staged files match any of provided globs - Stack Overflow
The problem is caused by the cache,you can try to change your code as you like.Then git add.,Then git commit -m ... you...
Read more >lint-staged - npm
Linter commands work on a subset of all staged files, defined by a glob pattern. lint-staged uses micromatch for matching files with the ......
Read more >Files changed (35) - Renovate Bot Package Diff
A git stash is created before running any tasks, so in case of errors any lost changes can be ... logger.log('No staged files...
Read more >Diving into Husky and Lint-staged | Laurie on Tech
Pre-push · Run ESLint against all the files: eslint '*.js' · Diff against main : eslint --no-error-on-unmatched-pattern $(git diff main... --name- ...
Read more >lint-staged: Lint Your Staged Files | Karuppiah's Blog
lint-staged will take care of passing the file path of the staged files as it's the one that knows which files are staged...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
removing the
node_modules
folder and runningnpm install
solved this for me.I have the same issue.
Folder structure is the following:
The one in the ‘server’ folder works fine, but the one in client just throws: No staged files match any of provided globs
Both
husky
andlint-staged
versions in both directories are the same.