unicorn/no-barrel-files
eslint-plugin-unicorn
No autofix
eslint.config.js
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-barrel-files": "error",
},
},
];export {foo} from './foo.js';import {foo} from './foo.js';
export {foo};export * from './foo.js';
export * from './bar.js';export const foo = 1;import {foo} from './foo.js';
export const bar = foo;export {foo} from './foo.js';
export const bar = 1;Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
unicorn/no-barrel-files
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-barrel-files": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce a consistent style for optional loop sources.