You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Property '"."' of type 'PackageExportsEntry | PackageExportsFallback | undefined'
is not assignable to 'string' index type 'PackageExportsEntry | PackageExportsFallback'.
15443 "."?: PackageExportsEntry | PackageExportsFallback;
The error is that the field "." is optional (it is declared with ?:, but also an "or" with undefined would result in the same error),
and its type is the same of the "index type" ([k: string]: PackageExportsEntry | PackageExportsFallback;), except that the index type is not optional.
So the fix is to make also the index type optional:
Hi,
I have used this tool to generate a
package.json
type description, starting from the official JSON schema.The generated output file is almost correct, but it requires few manual fixes.
So here I report the issues I have found, to allow to improve the tool.
1 Linter
Yes, this is not a bug, but since tslint is deprecated since a lot of time, it could be nice to replace:
with:
2 Error in compiling
There are some places where something as this is generated:
And it fails to compile:
The error is that the field
"."
is optional (it is declared with?:
, but also an "or" with undefined would result in the same error),and its type is the same of the "index type" (
[k: string]: PackageExportsEntry | PackageExportsFallback;
), except that the index type is not optional.So the fix is to make also the index type optional:
Regards
The text was updated successfully, but these errors were encountered: