Comments (5)
Please post your debug logs by running lint-staged with the --debug
flag. I don't have access to this environment so I can't really help unless I get the info produced here:
lint-staged/lib/resolveGitRepo.js
Lines 65 to 72 in 6c226c5
from lint-staged.
Uploading SE_MCM.pdf…
https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md
from lint-staged.
Please post your debug logs by running lint-staged with the
--debug
flag.
2024-06-07T20:29:26.167Z lint-staged:bin Running `[email protected]` on Node.js v20.14.0 (win32)
2024-06-07T20:29:26.168Z lint-staged:bin Options parsed from command-line: {
allowEmpty: false,
concurrent: true,
configPath: undefined,
cwd: undefined,
debug: true,
diff: undefined,
diffFilter: undefined,
maxArgLength: undefined,
quiet: false,
relative: false,
shell: false,
stash: true,
hidePartiallyStaged: true,
verbose: false
}
2024-06-07T20:29:26.170Z lint-staged:validateOptions Validating options...
2024-06-07T20:29:26.170Z lint-staged:validateOptions Validated options!
2024-06-07T20:29:26.170Z lint-staged Unset GIT_LITERAL_PATHSPECS (was `undefined`)
2024-06-07T20:29:26.171Z lint-staged:runAll Running all linter scripts...
2024-06-07T20:29:26.171Z lint-staged:runAll Using working directory `\\wsl.localhost\Ubuntu\home\***\apps\front-next`
2024-06-07T20:29:26.171Z lint-staged:resolveGitRepo Resolving git repo from `\\wsl.localhost\Ubuntu\home\***\apps\front-next`
2024-06-07T20:29:26.171Z lint-staged:resolveGitRepo Unset GIT_DIR (was `undefined`)
2024-06-07T20:29:26.171Z lint-staged:resolveGitRepo Unset GIT_WORK_TREE (was `undefined`)
2024-06-07T20:29:26.172Z lint-staged:execGit Running git command [ 'rev-parse', '--show-prefix' ]
2024-06-07T20:29:26.335Z lint-staged:resolveGitRepo Failed to resolve git repo with error: Error: ENOENT: no such file or directory, lstat '\\wsl.localhost\Ubuntu\wsl.localhost\Ubuntu\home\***\.git'
at async Object.lstat (node:internal/fs/promises:1018:18)
at async resolveGitConfigDir (file://wsl.localhost/Ubuntu/home/***/node_modules/lint-staged/lib/resolveGitRepo.js:19:17)
at async resolveGitRepo (file://wsl.localhost/Ubuntu/home/***/node_modules/lint-staged/lib/resolveGitRepo.js:69:40)
at async runAll (file://wsl.localhost/Ubuntu/home/***/node_modules/lint-staged/lib/runAll.js:97:36)
at async lintStaged (file://wsl.localhost/Ubuntu/home/***/node_modules/lint-staged/lib/index.js:110:17)
at async file://wsl.localhost/Ubuntu/home/***/node_modules/lint-staged/bin/lint-staged.js:146:18 {
errno: -4058,
code: 'ENOENT',
syscall: 'lstat',
path: '\\\\wsl.localhost\\Ubuntu\\wsl.localhost\\Ubuntu\\home\\***\\.git'
}
× Current directory is not a git directory!
Done in 4s 405ms
husky - pre-commit script failed (code 1)
from lint-staged.
Hey, would you be willing to test the code in this PR locally? Since there's no build-step you can just directly edit the files in your project's node_modules/lint-staged/
directory: #1433
from lint-staged.
Yep, this error has gone, but I got new one after your fix, × Failed to get staged files!
I added some extra debug logs to point where git diff command is called and see that path is correct, so it should be some different problem.
I think you can close this issue with this fix, thanks!
from lint-staged.
Related Issues (20)
- "No files matching the pattern ... was found" when using ESLint flat configuration file format HOT 2
- No staged files found HOT 2
- Script fails when using grouped layouts in Next.js HOT 5
- lint-staged does not detect changed files, skips scripts HOT 4
- High vulnerability in 'braces' dependency HOT 3
- Add flag to simplify testing `lint-staged` integration HOT 2
- Silent failure of configuration loading HOT 2
- 'lint-staged' will not restore changes if there's an error or the script is halted HOT 4
- Monorepo and different `.lintstagedrc.json` configuration files HOT 2
- Issue: Targeted files skip tsconfig HOT 1
- Failing to get staged files on 15.2.6 HOT 11
- Version 12+ results in exit code 1 instead of working HOT 2
- Fail to find git dir with git "rev-parse" HOT 1
- The 'File Ignored' warning is still a big problem HOT 1
- 'Integrate with Next.js' not working properly without '--dir' in monorepo.
- The docs suggests having empty config, but it doesn't work HOT 3
- Failed to get staged files HOT 18
- Execute vue-tsc --noEmit through lint-staged to detect that the scope includes the node_modules file HOT 6
- tsc bug when running through lint-staged HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lint-staged.