tsc correctly raises TS errors - tsup builds and ignores errors
See original GitHub issueIf I run pnpm exec tsc --noEmit
then I get 5 errors. If I run pnpm exec tsup src/index.ts --dts
then I 0 errors.
I realize I don’t provide enough info here but first I just want to ask if this isn’t a bug?
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to (temporarily!) ignore errors during a TypeScript migration
Tsc -silent lets you ignore certain TypeScript errors. By ignoring the errors that came from code not yet migrated, I could add TypeScript...
Read more >TypeScript's @ts-expect-error: The best way to ignore errors
One of the sneakier new awesome features of the recently released TypeScript 3.9 was the new comment `// @ ts -expect- error `....
Read more >Typescript: Why doesn't visual studio code report the same ...
When I've done this the errors will appear on the command line. ... VS Code may report errors for incompatible types whereas tsc...
Read more >ts-loader - npm
Start using ts-loader in your project by running `npm i ... The build should fail on TypeScript compilation errors as of webpack 2....
Read more >how to generate tsconfig.json Code Example
npx tsc --init. ... TS_NODE_PROJECT="path/to/tsconfig.json" node --loader ts-node/esm . ... Error: You have both a tsconfig.json and a jsconfig.json ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it seems that rollup-plugin-dts doesn’t type check
bar.ts
at all, code like this will also not throw errors:Here are my thoughts:
rollup-plugin-dts use typescript’s api(
program.emit
) generate declaration file forindex.ts
, then use Rollup bundle the generated code. dts forindex.ts
will be :This has nothing to do with
./bar.ts
, so Rollup will not resolve, tranform./bar.ts
will also not do type checking~I’m not sure if it is a bug of rollup-plugin-dts, seems that the recommended way to use this plugin is with generated dts with tsc(https://github.com/Swatinem/rollup-plugin-dts/issues/41#issuecomment-503550069) ~
Can we use tsc generate declaration files and then use rollup-plugin-dts or api-extractor bundle dts files? this also should be no problem with type check 😃
I ran into the same problem 😦 I had to use
tsc
andtsc-watch
package and runtsup
in its success callback. The dev and build step looks like this: