Open sslotsky opened 5 years ago
With allowJs
, Typescript can get a collect type even it is a js file, for example:
var foo = 1 // foo is number
/**
* @param {number} baz
*/
function bar(baz) { // baz is number
}
So it is possible.
Hmm, I see your point. This tool won't tell me how much of my code is type safe, i.e. how much of it will compile safely; it will only tell me how many of my identifiers have types that can be inferred.
@sslotsky have a similar setup as your project (Javascript files being migrated to TS). What approach did you folks use to get typescript coverage? Is there a way to include JS files in coverage and have their coverage percentage as 0 instead of what's reported by the tool?
Version(if relevant): 1.10.0
I have a large project that's 100% JavaScript, and we'd like to start converting to TS. I added this tool and a
tsconfig.json
, and I converted one small file to TypeScript. The result:My
tsconfig.json
:How can it report such a high coverage ratio when only one of my files is typed?