Skip to content

tsc --watch doesn't pick up on changes to --jsx #51829

Description

// ./tsconfig.json{"compilerOptions": {"target": "esnext","module": "commonjs","noEmit": true,}}
// ./src/index.tsxdeclarevarFoo: any;letx=<Foo></Foo>;
[4:24:35 PM] Starting compilation in watch mode...
src/index.tsx:3:9 - error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
3 let x = <Foo></Foo>;
~~~~~
[4:24:37 PM] Found 1 error. Watching for file changes.

Now add "jsx": "react", to the tsconfig.json.

 {
"compilerOptions": {
+ "jsx": "react",
"target": "esnext",
"module": "commonjs",
"noEmit": true,
}
}

Expected: Error should be gone.
Actual: Error is still present.

Metadata

Metadata

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions