Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsc --noEmit does not detect issues in react-ts template #17585

Open
7 tasks done
JElgar opened this issue Jun 28, 2024 · 1 comment
Open
7 tasks done

tsc --noEmit does not detect issues in react-ts template #17585

JElgar opened this issue Jun 28, 2024 · 1 comment

Comments

@JElgar
Copy link

JElgar commented Jun 28, 2024

Describe the bug

After adding type errors in project tsc not showing any errors when run (npx tsc -w) in react-ts template.

Reproduction

https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts

Steps to reproduce

  1. Clone https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts or open https://vite.new/react-ts
  2. Open src/main.tsx and add const a: string = 2 somewhere
  3. Run npx tsc --noEmit

tsc will say there is no issue (when it should be complaining about the line we just added

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitejs/plugin-react: ^4.3.1 => 4.3.1 
    vite: ^5.3.1 => 5.3.2

Used Package Manager

npm

Logs

~/projects/vitejs-vite-whkhm3 2s
❯ npx tsc --noEmit

^ there is no output

Validations

@sapphi-red
Copy link
Member

sapphi-red commented Jun 29, 2024

You need to run tsc -b instead of tsc --noEmit.

But that might be not intuitive. Maybe this could be one reason to revert #15913 and merge the tsconfigs (#15913).

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

No branches or pull requests

2 participants