-
-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🧩 Finding references to .json
files
#883
Comments
Since .json is not a default extension you could try to add a compiler for it and do something like this: {
compilers: {
json: text => `export default ${JSON.parse(text)}`
}
} |
Sadly it didn't work. I had to filter out the Also, my JSON files are in "compilerOptions": {
"paths": {
"@locales/*": ["public/locales/*"]
}
} but it didn't work either when I manually moved a couple of JSONs to the Thanks for trying to help though |
Without a reproduction or something it's mostly guessing as there isn't much to look into. Haven't had a need for this myself nor did i see similar reports. |
Apologies, here's the repro https://github.com/bartekczyz/knip-json-references-repro |
@webpro mind taking a look? 😅 |
Well, I'm currently at work. This open source business isn't that lucrative! No problem, no offense, but I'll be doing this as time and motivation permits. Sometimes instantly, sometimes... not. |
Sorry mate, didn't want to sound so pushy :< |
No worries, valid use case and repro after all. |
Here's a version you could try:
The downside of this approach, and the reason it's not in main yet, is that all the I do see the value of the use case though, and this is only an issue when actually adding the
|
It worked like I expected, thanks!
Currently we use One thing that regressed is cache files appearing in the cwd:
|
Discuss anything related to Knip
Hello :)
I'm using
knip --trace
to get and process the dependency graph, however it won't list.json
files I import in my.ts
,.tsx
files. Is/will that be possible? :)The text was updated successfully, but these errors were encountered: