Skip to content

checkJs default has changed in tsgo #928

Closed
@issacgerges

Description

@issacgerges

In the TypeScript Go implementation, checkJs now defaults to true, whereas it previously defaulted to false.

return options.CheckJs == TSTrue

Wanted to call it out as I was unsure if this change was intentional

Activity

changed the title [-]Some config option defaults have changed in typescript-go[/-] [+]checkJs default has changed in tsgo[/+] on May 23, 2025
jakebailey

jakebailey commented on May 23, 2025

@jakebailey
Member

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.

jakebailey

jakebailey commented on May 23, 2025

@jakebailey
Member

Did you confuse options.CheckJs == TSTrue for options.CheckJs = TSTrue, an assignment?

issacgerges

issacgerges commented on May 23, 2025

@issacgerges
Author

Sorry, I attributed the wrong line of code. I have a minimal repro that shows the default has changed. Will send it momentarily

jakebailey

jakebailey commented on May 23, 2025

@jakebailey
Member

Can you paste the result of tsgo --showConfig?

issacgerges

issacgerges commented on May 23, 2025

@issacgerges
Author
{
    "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
}
jakebailey

jakebailey commented on May 23, 2025

@jakebailey
Member

Thanks, this is a bug.

glenjamin

glenjamin commented on May 28, 2025

@glenjamin

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

jakebailey

jakebailey commented on May 28, 2025

@jakebailey
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @glenjamin@jakebailey@issacgerges

      Issue actions

        checkJs default has changed in tsgo · Issue #928 · microsoft/typescript-go