typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

--watch causes --skipLibCheck to be ignored

Open nf-wbeck opened this issue 7 months ago • 0 comments

For a project with the skipLibCheck compilerOption set to false:

npx tsgo --project tsconfig.json

Correctly emits errors inside node_modules and project type declaration files.

npx tsgo --project tsconfig.json --skipLibCheck

Correctly omits errors inside node_modules and project type declaration files.

npx tsgo --project tsconfig.json --skipLibCheck --watch

Incorrectly emits errors inside node_modules and project type declaration files.

Updating the project configuration with skipLibCheck set to true and omitting the CLI --skipLibCheck flag will allow --watch to behave correctly.

tsconfig.common.json

{
    "compilerOptions": {
        "allowJs": false,
        "alwaysStrict": true,
        "baseUrl": "./",
        "rootDir": "./src",
        "forceConsistentCasingInFileNames": true,
        "incremental": true,
        "lib": ["ES2023"],
        "module": "nodenext",
        "moduleResolution": "nodenext",
        "noFallthroughCasesInSwitch": true,
        "noImplicitAny": true,
        "noImplicitReturns": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "outDir": "./dist",
        "resolveJsonModule": true,
        "sourceMap": true,
        "strict": true,
        "strictBindCallApply": true,
        "strictFunctionTypes": true,
        "strictNullChecks": true,
        "target": "ES2022",
        "typeRoots": ["./types", "./node_modules/@types"]
    }
}

tsconfig.json

{
    "extends": "./tsconfig.common.json",
    "emit": "noEmit",
    "compilerOptions": {
        "skipLibCheck": false,
        "tsBuildInfoFile": "./build/.tsbuildInfo"
    },
    "include": ["./src/**/*.ts", "./types/**/*.d.ts"]
}

nf-wbeck avatar May 23 '25 18:05 nf-wbeck