-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
| "typesVersions": { | |
| "*": { | |
| "classadder": [ | |
| "./src/classadder/index.ts" | |
| ], | |
| "internal": [ | |
| "./src/internal/index.ts" | |
| ], | |
| "*": [ | |
| "./src/*" | |
| ] | |
| } | |
| }, |
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 whenstrictNullChecksis enabled in tsconfig #530@smui/common- typescript errors whennoUncheckedIndexedAccesscompiler option is enabled #531
while errors can still occur in
.d.tsfiles due to differing tsconfigs, it's far less common when exporting*.d.tsfiles as function implementations don't need to be typechecked. in this case, switching all of thetypesVersionstothe .d.tsfiles in/distfixes all of the above errors -
prevents the
skipLibCheckcompiler 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-checkas 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/*"
]
}
}
}