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

Change / Ban all usages of export * from ... so that all exports (and imports) are explicit #2368

Open
JamieDanielson opened this issue Aug 2, 2024 · 2 comments

Comments

@JamieDanielson
Copy link
Member

Make all imports and exports explicit so that internal classes / objects etc are not inadvertently made public and become part of the public API. Also helps with tree-shaking.

Similar to open-telemetry/opentelemetry-js#4186 in core, but in contrib, this involves:

  1. Change all export * from 'foo'; to export { foo } from 'foo'; for parity
  2. Add the ESLint rule "no-restricted-syntax": ["error", "ExportAllDeclaration"], to error on these types of exports

As an example:

export * from './AsyncHooksContextManager';
becomes
export { AsyncHooksContextManager } from './AsyncHooksContextManager';

@Joice-crypto
Copy link

hello, I would like to work on this

@Joice-crypto
Copy link

Hi, could you please chek my PR? @JamieDanielson

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

2 participants