Skip to content
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

installLogsCollector.d.ts: An export assignment cannot be used in a module with other exported elements. #149

Closed
ghost opened this issue Jun 7, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 7, 2022

If your tests are in a TS project and skipLibCheck is false, TSC complains about the combination of exports used in installLogsCollector.d.ts and installLogsPrinter.d.ts.

node_modules/cypress-terminal-report/src/installLogsCollector.d.ts:70:1 - error TS2309: An export assignment cannot be used in a module with other exported elements.

70 export = installLogsCollector;

This is because you can't combine individual exports (eg. export type Severity = '' | 'error' | 'warning';) with export assignment (eg. export = installLogsCollector;).

I believe the fix is simply to change the export assignment to a default export (eg. export default installLogsCollector;). When I make this change locally, the default export is typed as expected and I can still import the declared types individually. I'll raise a PR with the fix for both files.

@ghost
Copy link
Author

ghost commented Jun 7, 2022

Never mind, I see this has been fixed and just hadn't released when I last checked a week ago! Thanks 😄

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants