This gives quite some extra TS errors.
In storybook, *.stories.ts files are usually not written in a way that allows .d.ts files to be generated from them.
In a fresh storybook vite react project, users now get the following TS error:
Exported variable 'meta' has or is using name 'ButtonProps' from external module "src/stories/Button"
but cannot be named.
ts(4023)
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
This PR introduced new default values for the tsconfig.json created with create-vite: https://github.com/vitejs/vite/pull/15913
This PR uses TS references and sets
composite: true
in tsconfig.json: https://github.com/vitejs/vite/blob/167006e74751a66776f4f48316262449b19bf186/packages/create-vite/template-react-ts/tsconfig.app.json#L1-L9The references feature uses
.d.ts
files when references reference each other. Sodeclaration
is forced to be set to true: https://www.typescriptlang.org/tsconfig/#declarationThis gives quite some extra TS errors. In storybook, *.stories.ts files are usually not written in a way that allows .d.ts files to be generated from them.
In a fresh storybook vite react project, users now get the following TS error:
Reproduction
https://stackblitz.com/edit/github-nup1wj?file=src%2Fvite-env.d.ts
Steps to reproduce
Clone the stackblitz repro locally. As stackblitz is also broken by this PR.
The error will popup in your editor in Button.stories.tsx, but not when running tsc on the command line.
System Info
Used Package Manager
npm
Logs
No response
Validations