-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
add no-import-module-exports #760
Comments
I like this in most cases, but this seems like it would prevent the very best practice of, in your package's entry point, doing |
Sure, doesn't have to be enabled by default 👍 |
Right, but it means I wouldn't be able to enable it at all in anything that wasn't a top-level app. What if it: That way by default it allows your entry point to do the right thing (so I can both use and recommend it) and it's configurable if you have multiple entry points. |
Sounds solid 👍 |
@kentcdodds which issue with webpack 2 tree shaking are you referring to? I'd like to add a blurb about it in the docs. Also, any other motivating factors for the rule would be welcome. |
Whoops! I forgot to link to the issue. It's this one :) |
… with CommonJS exports Fixes import-js#760
… with CommonJS exports Fixes import-js#760
… with CommonJS exports Fixes import-js#760
Due to this issue with webpack tree-shaking, and the fact that some people cannot adopt
no-commonjs
quite yet, I think this would be really handy. I've written the rule for my own stuff and would be happy to add it here (or retrofitno-commonjs
with options to cover this use case).Here's my rule:
And the associated tests:
Let me know what you all think :)
The text was updated successfully, but these errors were encountered: