You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A new rule that allows you to ban the creation of export {} from '...'.
This will help enforce a policy to not create barrel files, which are index.js / index.ts files that only serves to export parts of other modules.
This is not a commentary on the good or bad for this way of organizing modules and packages, I'd just like to be able to set up linting rules over its usage.
With eslint's own settings we can already control the file patterns any individual rule applies to.
Perhaps having a flag to distinguish between export-only files and files that mix re-exported elements and exports of locally defined elements. Although that could also be achieved with lint-ignore comments.
The text was updated successfully, but these errors were encountered:
blended-bram
changed the title
Rule for banning barrel files
Rule for banning export {} from '...'Oct 2, 2024
I didn't know about no-restricted-syntax; thanks for pointing it out.
Then this issue can become a direct feature request for a no-barrel-exports rule.
A new rule that allows you to ban the creation of
export {} from '...'
.This will help enforce a policy to not create barrel files, which are
index.js
/index.ts
files that only serves to export parts of other modules.This is not a commentary on the good or bad for this way of organizing modules and packages, I'd just like to be able to set up linting rules over its usage.
With eslint's own settings we can already control the file patterns any individual rule applies to.
Perhaps having a flag to distinguish between export-only files and files that mix re-exported elements and exports of locally defined elements. Although that could also be achieved with lint-ignore comments.
The text was updated successfully, but these errors were encountered: