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

Documentation clarification #231

Open
justin-barca opened this issue Mar 3, 2020 · 0 comments
Open

Documentation clarification #231

justin-barca opened this issue Mar 3, 2020 · 0 comments

Comments

@justin-barca
Copy link

In https://github.com/speedskater/babel-plugin-rewire#test-code-2 a named import is used for the rewire api. Later in the documentation you say If no default export is present, the API-Object named __RewireAPI__ becomes the default export of the module. The example code has no default export so I think the example test should use the default import in order to avoid the as syntax and clarify. The statement If no default export is present, the API-Object named __RewireAPI__ becomes the default export of the module. could be improved by adding and is also available as a named import. If the module without a default export has a named export with the rewire, why also provide it as a default export? Naming clashes are unlikely and no module using this should have an export RewireAPI because that would be confusing.

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

1 participant