Processes and reports false positives for non-project files
See original GitHub issueThanks for creating ts-prune, it works really well! It just correctly found 80 unused exports from our project!
One problem that I have though is ts-prune processes some files that are not specified in tsconfig.json’s “include” property, and also reports false positives for those files.
The exports (not unused) that are reported incorrectly are in the path .circleci/ecs-deployment/src/aws.ts and they’re imported from .circleci/ecs-deployment/src/index.ts, in case these file paths are somehow causing the bug.
My tsconfig.json
{
"compilerOptions": {
"allowJs": false,
"jsx": "react",
"moduleResolution": "node",
"outDir": "out",
"sourceMap": true,
"strictNullChecks": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"target": "es6",
"module": "commonjs",
"lib": [
"dom",
"es2017"
]
},
"include": [
"backend",
"client",
"common",
"migrations",
"scripts",
"test",
"types"
]
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Combining the red flag approach with process mining
The aim of our research is to reduce the number of false positives by combining the red flag-based approach with process mining.
Read more >False-Positive Results in Rapid Antigen Tests for SARS-CoV-2
This study examines the incidence of false-positive results in a sample of rapid antigen tests used to serially screen asymptomatic workers ...
Read more >7 ways to filter out cyber alert false positives - GCN
2. Test the rules as silent rules before committing them. This will help determine whether the rules are generating false positives without ...
Read more >Determining Occurrence Dynamics when False Positives Occur
We demonstrate how to simultaneously account for non-detection (false negatives) and misclassification (false positives) when estimating ...
Read more >On Their Watch - Human Rights Watch
Seven years after the false positives scandal erupted, ... the army reported as killed in military operations grew from 27 in 2004, ...
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 Free
Top 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

Thanks for reporting this @emlai.
If it’s not specified in the tsconfig.json, and if you still want to ignore them, what you outlined in #13 seems like a good option.
I’m putting most of my effort right now in performance improvements. It would be a while before I get to this. However, if you want to do a PR for it, I’m more than happy to guide you through it.
In the meantime,
ts-prune | grep -v .circleci/ecs-deployment/srcmight work for that directory?@nadeesha Yeah I can confirm
1is what’s happening. The directory structure looks like this (so e.g. we have a separate tsconfig there):A file inside
.circleci/ecs-deployment/srcis being imported from one of the main project files.If I add
.circleci/ecs-deploymentto the main tsconfig, then the false positives go away. Adding only.circlecidoesn’t work. However, adding.circleci/ecs-deploymentto the main tsconfig causes the project to not compile, so we can’t simply do that.Still, would be nice if there were no false positives reported when we import files not specified in tsconfig.