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

There is no check if the imported file has a default. #36

Open
Guibod opened this issue Jan 29, 2017 · 2 comments
Open

There is no check if the imported file has a default. #36

Guibod opened this issue Jan 29, 2017 · 2 comments

Comments

@Guibod
Copy link
Contributor

Guibod commented Jan 29, 2017

Create-index is pretty dumb actually, it would try to include a file as default only if it exists and validates some naming convention. It may eventually import as default a file without default.

@gajus
Copy link
Owner

gajus commented Jan 29, 2017

I don't think this is "dumb". Project directory structure is "dumb" if index.js is used with create-index in a directory that includes files without export default.

In the above case, it would be an enhancement to throw an error. In combination with the proposed ignore configuration, it would cover all use case.

@DaveWelling
Copy link

DaveWelling commented May 10, 2018

If no export default is found, instead could you create
import * as moduleNameHold from './moduleName.js';
export const moduleName = moduleNameHold;
?

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

No branches or pull requests

3 participants