-
Notifications
You must be signed in to change notification settings - Fork 17
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
Package does not pass AreTheTypesWrong #70
Comments
Er, sorry, misread esbuild's output. var src_exports = {};
__export(src_exports, {
configs: () => configs,
default: () => src_default,
rules: () => rules
});
module.exports = __toCommonJS(src_exports); I think it actually needs |
I should really just defer to the ATTW message 😅
|
Oh I didn't know someone published types for this package. |
My suggestion is probably wrong; you may need to declare a different type instead that's an object type with a default prop and not mix syntax. I think TS will error? |
Finally took some time to do the change suggested by ATTW cli, it was green after the change. |
(I had forgotten about this; when I have some time later I can try and come up with a "real" declaration for the shape of your runtime export.) |
export = _default both is valid for the cli and provide correct typing for moduleResolution bundler and node16 (with I think this is good enough for me! |
I'm testing with node16 in a plain CJS file, where those synthetic defaults and such don't work since TS wouldn't transform them (which should be the case for nearly all eslint configs). |
See: https://arethetypeswrong.github.io/?p=eslint-plugin-react-refresh%400.4.16
The package is bundled, and ends with:
This means that the output dts file should actually read
export = _default;
, notexport default _default;
, since an export nameddefault
does not actually exist at runtime.I noticed this on DT, which previously held types for this package (but will have to be deleted now that you're doing it): https://github.com/DefinitelyTyped/DefinitelyTyped/actions/runs/12118993180/job/33784693075#step:12:2663
The text was updated successfully, but these errors were encountered: