We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
module.exports
Reported at #46011 (comment)
Run declaration emit on this JS
/** @typedef {string} S */ /** @type {any} */ module.exports = "";
declare const _exports: any; export = _exports; declare namespace _exports { export { S }; } type S = string;
The declaration file is error-free.
declare const _exports: any; export = _exports; export type S = string;
The declaration file errors with An export assignment cannot be used in a module with other exported elements.
An export assignment cannot be used in a module with other exported elements.
Declaration emit works as expected if module.exports is assigned to an identifier that doesn’t necessitate the _exports temp variable synthesis:
_exports
/** @typedef {string} S */ /** @type {any} */ const x = ""; module.exports = x;
produces:
export = x; /** @typedef {string} S */ /** @type {any} */ declare const x: any; declare namespace x { export { S }; } type S = string;
The text was updated successfully, but these errors were encountered:
sandersn
No branches or pull requests
Reported at #46011 (comment)
Repro steps
Run declaration emit on this JS
Expected behavior
The declaration file is error-free.
Actual behavior
The declaration file errors with
An export assignment cannot be used in a module with other exported elements.
Additional info
Declaration emit works as expected if
module.exports
is assigned to an identifier that doesn’t necessitate the_exports
temp variable synthesis:produces:
The text was updated successfully, but these errors were encountered: