-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Strange declarations created within typescript-in-jsdoc #34994
Comments
probably related do #33626 |
Strange - I don't even know why the |
BTW if you would add in the source file of validate.js, it will fix the d.ts file, /** @typedef {import("./ValidationError").default} _default */ The namespace export won't be gone, but |
We don't track exceptions in any way, so that shouldn't be it. As I said - I'll need to look into it, something strange is going on. |
Ah, I see. We're picking up the additions made in |
So, I can provide a quick fix that elides the buggy declarations from the file, as they're fairly easy to detect, but the shape is quite troublesome to serialize with fidelity: For a full and complete fix that includes all the information from the assignments of
import mod from "mod";
export default mod;
mod.MyMember = class MyMember {
// ...
} emits as import mod from "mod";
export default mod;
class MyMember {
// ...
}
declare module "mod" {
export namespace default {
export { MyMember }
}
} and would be valid in TS (rather than throwing with something like |
@Bnaya @vankop as a workaround until we have a fix, if you move the augmentating assignments into the file with the original declaration, we should do a little better. So rather than module.exports.ValidationError = ValidationError.default;
// Todo remove this in next major release
module.exports.ValidateError = ValidationError.default; in validate.ValidationError = ValidationError.default;
// Todo remove this in next major release
validate.ValidateError = ValidationError.default; in |
@weswigham I think we can move |
@weswigham It seems like that the |
TypeScript Version: 3.7.2
Search Terms:
Code
https://github.com/webpack/schema-utils/blob/72d2ea1b6025f0069b5bde49ea057df376c22057/src/validate.js
Expected behavior:
Expect correct declaration file created
Actual behavior:
https://github.com/webpack/schema-utils/blob/7b41f1ec6f0be3ecd7b023bdd3d6a5db052bbee3/dist/validate.d.ts
Got strange export:
If you will take a look on source code, it does not have
_default
export andValidateError
export eitherRelated Issues:
downstream issue: webpack/schema-utils#75
The text was updated successfully, but these errors were encountered: