ESLint plugin (v1.3.1) that disallows barrel files — re-export modules that aggregate and re-export other modules. Barrel files are known to slow down builds/tests, cause circular dependencies, and hinder tree shaking. This plugin provides a single rule `no-barrel-files` that flags patterns like `export * from './foo'` or re-importing a default and re-exporting it. Supports flat config (ESLint 9+) and legacy config (ESLint 8). Actively maintained with TypeScript type declarations. Alternative to manual code review or other linting rules that partially address barrel files.
npm install eslint-plugin-no-barrel-filesVerified import paths — ran on the pinned version, not inferred.
Shows two ESLint configurations: legacy CommonJS for ESLint 8 and modern ESM flat config for ESLint 9+. Enables the single rule that flags barrel file patterns.
Replace `noBarrelFiles.flat` with `noBarrelFiles.configs.recommended` in flat config.
Use `configs.recommended` instead of `flat`.
Set rule name as `'no-barrel-files/no-barrel-files'`.
If needed, manually audit or extend the rule. Check plugin issue tracker for potential updates.
Run `npm install eslint-plugin-no-barrel-files --save-dev`.
Set severity to 2 (or 'error') in an array: `['error']` or `2`.
Use `noBarrelFiles.configs.recommended` instead of `noBarrelFiles.flat`.