Knip (5.19.0) may behave differently on different environments, depending on
During the block
knip/packages/knip/src/util/globby.ts
Line 136 in 7c9b645
**
which leads to the problem, that git ignore rules now may match outside the project.
Example:
# .gitignore
# ignore all files in builds folders in the project
builds/
// bug in knip
// doesn't match any file, because absolute path matches a gitignore rule
fastGlob(['src/index.ts'], {
cwd: '/Users/xxx/builds/project',
ignore: ['**/builds/**', '**/builds'] // generated from git-ignore
})
// maybe-fix in knip
fastGlob(['src/index.ts'], {
cwd: '/Users/xxx/builds/project',
ignore: ['/Users/xxx/builds/project/**/builds/**', '/Users/xxx/builds/project/**/builds'] // fix
})
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too