create-index
create-index copied to clipboard
There is no check if the imported file has a default.
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.
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.
If no export default is found, instead could you create
import * as moduleNameHold from './moduleName.js';
export const moduleName = moduleNameHold;
?