Open DetachHead opened 2 years ago
Mhm this is tricky. We don't want to do that because these types are only relevant when using the babel preprocessor. But since the type definitions are static, we can't model that. Maybe we need to add comments that tell TS to ignore the type errors.
Maybe we need to add comments that tell TS to ignore the type errors.
unfortunately that probably won't work due to https://github.com/microsoft/TypeScript/issues/38628
but yeah i agree it's a tough situation, ideally you could have conditional dependencies based on whether you're using the babel preprocessor but i don't think npm supports such a thing
Describe the bug when attempting to type check
svelte.config.js
with typescript, i get the following error:because
@types/babel__core
is required by users downstream (if they're using typescript), i'd suggest moving it todependencies
instead ofdevDependencies
. otherwise users will have to manually add@types/babel__core
to theirpackage.json
to get rid of the errors.To Reproduce
Expected behavior all dependencies required for type checking downstream are included in
dependencies
Information about your project:
Your browser and the version: n/a
Your operating system: n/a
svelte-preprocess
version: 4.10.5Whether your project uses Webpack or Rollup: vite (which i think uses rollup? idk im new)
Additional context
see https://github.com/openapi-library/OpenAPIValidators/issues/258#issuecomment-999980975 for more info