Knip configuration #2152
-
QuestionI added I have some lambda.ts files that are entry points. I'd assume this would tell knip that they are entry points, but knip marks them as unused files. Running knip by itself does correctly use my config file and does not mark the Note: I'm trying to specify the entry two ways.
I also tried explicitly setting the config in and Further the ingnore directives don't work for knip. Any ideas? How to reproduce (optional)Expected behavior (optional)No response CLI Versionqlty 0.540.0 macos-arm64 (d4b1d76 2025-06-05) Information about Qlty configuration and environment (optional)// Add your qlty.toml
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
Can you share the invocation file for knip? |
Beta Was this translation helpful? Give feedback.
-
|
@marschattha Hey this is a snippet of the
It also looks like |
Beta Was this translation helpful? Give feedback.
-
|
I am guessing you have a subdirectory containing your package.json file? Because of how knip runs in the same directory as package.json, it might not load the config which is copied over form qlty/configs/* to project root directory. This sort of situation can normally be managed by explicitly adding a config flag but for some reason knip doesn't seem to be working with an absolute path to config, i-e The workaround you can do is keep the knip.json file in the same directory as your package.json file (you will need multiple knip.json files if you have multiple package.json files). |
Beta Was this translation helpful? Give feedback.
I am guessing you have a subdirectory containing your package.json file?
Because of how knip runs in the same directory as package.json, it might not load the config which is copied over form qlty/configs/* to project root directory.
This sort of situation can normally be managed by explicitly adding a config flag but for some reason knip doesn't seem to be working with an absolute path to config, i-e
knip --no-progress --reporter --config /User/name/work/project/.qlty/configs/knip.jsondoesn't work but
knip --no-progress --reporter --config .qlty/configs/knip.jsonworks.The workaround you can do is keep the knip.json file in the same directory as your package.json file (you will need mu…