Description
Describe the bug
the typesVersions
field in package.json
for the following packages point to the source code in /src
instead of the type declaration files in /dist
:
@smui/common
@smui/snackbar
@smui/select
@smui/textfield
svelte-material-ui/packages/common/package.json
Lines 13 to 25 in c61a67b
this causes several problems:
-
causes compile errors in usages of these packages if the tsconfig files are different:
- TypeScript Error "Not all code paths return a value." #514
@smui/common
- "Type 'CustomEvent<T | undefined>' is not assignable to type 'CustomEvent<T>'" error whenstrictNullChecks
is enabled in tsconfig #530@smui/common
- typescript errors whennoUncheckedIndexedAccess
compiler option is enabled #531
while errors can still occur in
.d.ts
files due to differing tsconfigs, it's far less common when exporting*.d.ts
files as function implementations don't need to be typechecked. in this case, switching all of thetypesVersions
tothe .d.ts
files in/dist
fixes all of the above errors -
prevents the
skipLibCheck
compiler option from working. this means there's no way to work around the above errors other than disabling the strictness flags that are causing them -
probably slows down
svelte-check
as it's needlessly checking implementation code that the user did not write.
To Reproduce
see the issues linked above
Expected behavior
example typesVersions
for @smui/common
:
{
"typesVersions": {
"*": {
"classadder": [
"./dist/classadder/index.d.ts"
],
"internal": [
"./dist/internal/index.d.ts"
],
"*": [
"./dist/*"
]
}
}
}
Activity
@smui/common
- "Type 'CustomEvent<T | undefined>' is not assignable to type 'CustomEvent<T>'" error whenstrictNullChecks
is enabled in tsconfig #530@smui/common
- typescript errors whennoUncheckedIndexedAccess
compiler option is enabled #531typesVersions
pointing to source code instead of declaration files #533svelte.config.js
withmoduleResolution
set tonodenext
sveltejs/vite-plugin-svelte#619