Reports imports of individual modules from packages configured in barrelImportPackages that should be named imports from the package barrel
| Property | Value |
|---|---|
| Category | Style |
| Default severity | off |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377148 |
| Language Service name | preferBarrelImport |
| Oxlint name | effecttsgo/prefer-barrel-import |
import * as Record from "effect/Record"
/**
^^^^^^^^^^^^^^^ effecttsgo(prefer-barrel-import): 'effect/Record' is imported directly, but barrelImportPackages expects named imports from the barrel 'effect'. Use 'import { Record } from "effect"' instead.
*/
export const keys = Record.keys({ a: 1 })See the Language Service setup guide for installation instructions.
See the Oxlint setup guide for installation and patching instructions.
{
"$schema": "./node_modules/@effect/tsgo/oxlint-schema.json",
"options": {
"typeAware": true
},
"plugins": ["effecttsgo"],
"rules": {
"effecttsgo/prefer-barrel-import": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "preferBarrelImport": "warning" } } ] } }