0.0.6 • Published 7 months ago
eslint-plugin-no-re-export v0.0.6
eslint-plugin-no-re-export
Disallow re-exporting in TypeScript/JavaScript.
Installation
# npm
npm install eslint-plugin-no-re-export --save-dev
# yarn
yarn add eslint-plugin-no-re-export --dev
# bun
bun install eslint-plugin-no-re-export --save-dev
Usage
Add no-re-export
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["no-re-export"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"no-re-export/no-re-export": "error"
}
}
Rules
Rule ID | Description |
---|---|
no-re-export | disallow re-exporting in TypeScript/JavaScript |
References
- Speeding up the JavaScript ecosystem - The barrel file debacle by @marvinhagemeister
- Burn the Barrel! by @uglow
- Your Next.js Bundle Will Thank You by @askides
- Barrel files in JavaScript by @flaming
Comment by @ljharb at eslint-plugin-import/issues/1920
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.