checkJs default has changed in tsgo
In the TypeScript Go implementation, checkJs now defaults to true, whereas it previously defaulted to false.
https://github.com/microsoft/typescript-go/blob/4764672ab5f048554d3fe7134aee1cec6bd85e1c/internal/core/compileroptions.go#L218
Wanted to call it out as I was unsure if this change was intentional
I don't think that's what that code means; CheckJs is a tristate between true, false, and unset. If it's unset, that will evaluate to false. Also, the linked code is GetAllowJS, so this is about how allowJs behaves.
Did you confuse options.CheckJs == TSTrue for options.CheckJs = TSTrue, an assignment?
Sorry, I attributed the wrong line of code. I have a minimal repro that shows the default has changed. Will send it momentarily
https://github.com/issacgerges/tsgo-checkjs/tree/main
Can you paste the result of tsgo --showConfig?
{
"allowJs": true,
"incremental": true,
"module": 99,
"moduleResolution": 100,
"noImplicitAny": true,
"outDir": "/Users/igerges/source/tsgo-checkjs/.ts-out",
"rootDir": "/Users/igerges/source/tsgo-checkjs",
"configFilePath": "/Users/igerges/source/tsgo-checkjs/tsconfig.json",
"showConfig": true
}
Thanks, this is a bug.
I'm seeing this behaviour too - our repo has allowJs set globally, but checkJs set on a per-file basis via comments, and running tsgo lists errors in a lot of JS files.
Let me know if there's any more information needed
What errors are you seeing specifically? I believe I'll have fixed this in #930 when merged. You could build from that PR and check, too.