-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Missing type definition for pretty-format/ConvertAnsi plugin #12881
Comments
Have you tried this: import { plugins } from 'pretty-format';
plugins.ConvertAnsi; |
Yes, However, A workaround exists, but I think it is a bug that this feature, which is also described in CHANGELOG, is not available only in TypeScript. |
Hm.. Not sure if the only documented way of importing plugins can be called a workaround. See readme section |
@SimenB It would be easy to get back the missing Also it does not look like the Perhaps it makes sense to look for alternatives instead of the
I like the latter the best. The plugin would have own What do you think? |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
@sounisi5011 Just to draw your attention. Recently I published
I wrote it for one of my projects. Perhaps it might help to solve your issue too? |
@mrazauskas Thank you very much. I appreciate it. But what I am wanting is consistent behavior of multiple import ways. In other words, the goal is to have both I thought #12308 would also solve the traditional redundant import method of "import However, if #12308 did not consider such a use case at all, it is my mistake. I leave it to the maintainers to decide if this issue should be resolved. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
pretty-format 28.0.0+
Steps to reproduce
Install
[email protected]
Setup TypeScript 4.7+ by setting the
moduleResolution
flag to"Node16"
or"NodeNext"
intsconfig.json
.Write the following code:
Run
tsc
Expected behavior
Import will succeed. No TypeScript error is generated due to module import.
Actual behavior
TypeScript reports the following error:
Additional context
The reason is missing
build/plugins/ConvertAnsi.d.ts
file in published npm package.With #12308, it is now possible to import
ConvertAnsi
plugins directly. In addition, TypeScript 4.7 now supports theexports
field.Until pretty-format 27.5.1, the type definition file
build/plugins/ConvertAnsi.d.ts
corresponding to thebuild/plugins/ConvertAnsi.js
file was included in the package and could be imported successfully. However, since pretty-format 28.0.0, all type definition files in the subdirectories have been removed and only thebuild/index.d.ts
file exists.Difference between published pretty-format 27.5.1 and pretty-format 28.0.0 by Renovate
Environment
The text was updated successfully, but these errors were encountered: