Rules
no-import-from-barrel-package
Import specific modules rather than value exports from barrels.
Purpose and behavior
Import specific modules rather than value exports from barrels.
Official Effect rule. Reports namespace and named value specifiers from matching barrel paths. Skips whole type imports and named type specifiers; default and side-effect imports are not reported. Relative index filenames are recognized syntactically, while directory imports are checked for an existing index file using the filesystem. The preset matches Effect root/lowercase barrel paths and recommends module namespace imports, such as effect/Effect. No automatic fix is supplied.
Options
{ checkPatterns?: string[], checkRelativeIndexImports?: boolean }. Rule defaults: checkPatterns is and relative-index checking is true. Patterns are JavaScript regular expressions, not globs. The Effect preset explicitly uses "^effect...", "^@effect/^/+..." and enables relative-index checking. The example uses that preset.
Invalid example
import { Effect } from 'effect'Valid example
import * as Effect from 'effect/Effect'Fixes and exceptions
This rule reports diagnostics without an automatic fix. Rewrite the code deliberately rather than guessing its intended semantics.
For a genuine boundary exception, use an oxlint-disable-next-line rules/no-import-from-barrel-package -- reason comment. Examples illustrate this rule alone and may omit imports and declarations.
Source and tests
Enabled by the Effect preset.