-
-
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
no-internal-modules: configuration to opt in/out to enable/disable exports linting #1920
Comments
It's not a breaking change for eslint plugins, where the bug being fixed can be "the build passed, but should not have". Semver works a bit differently in the eslint ecosystem. Can you clarify a bit what's getting warned here but shouldn't be? Typically, |
After that "fix", all of those exports in barrel file (see image in issue description) are violating From my experience, exporting from nested paths is rarely a violation in a proper constraint systems with proper public API designs. If we could add my proposed feature to opt out from applying this rule on exports it would be wonderful.
|
This sounds like a different rule to me. Barrel exports increase bundle size and memory footprint, and are the only reason treeshaking is needed (to only-partially clean up sloppy importing), and in my experience, are best avoided, especially in any codebase of significant scale/size. no-internal-modules should be configured to warn for a directory inside a “package”, but only applied to things outside the “package”, and thus should be allowed for a barrel export which is inside the package but outside the directory. |
Some time ago
no-internal-modules
rule added ES modules exports linting as a "fix" -> minor version bump (which was a breaking change btw).From my experience, linting exports with this rule doesn't make much sense, as barrel/public-api files, can re-export from any nested path.
For better imagination I'm adding showcase of scaffold/public API
feature proposal
The text was updated successfully, but these errors were encountered: