Named Imports Stable Paths
Use `import { foo, bar } from './lib'` rather than `import lib from './lib'` followed by `lib.foo` and `lib.bar`.…
$ prime install @web-style/rule-named-imports-stable-paths Projection
Always in _index.xml · the agent never has to ask for this.
NamedImportsStablePaths [rule] v0.1.0
Use import { foo, bar } from './lib' rather than import lib from './lib' followed by lib.foo and lib.bar. Named imports document the API surface, make tree-shaking effective, and resist the trap of a default export later being replaced by a namespace object.
Loaded when retrieval picks the atom as adjacent / supporting.
NamedImportsStablePaths [rule] v0.1.0
Use import { foo, bar } from './lib' rather than import lib from './lib' followed by lib.foo and lib.bar. Named imports document the API surface, make tree-shaking effective, and resist the trap of a default export later being replaced by a namespace object.
Checks
- Each external value used in the file is imported by name at the top.
- Default imports appear only when the source module has exactly one logical export (e.g. a React component file).
- Import paths are stable: prefer package roots (
'lodash/get','@scope/pkg') over cross-package deep paths intodist/orsrc/. - Imports are sorted: external packages first, then internal, then relative — and grouped with blank lines (Airbnb / ESLint
import/order).
Label
Prefer named imports from stable paths; reserve default imports for true single-export modules
Loaded when retrieval picks the atom as a focal / direct hit.
NamedImportsStablePaths [rule] v0.1.0
Use import { foo, bar } from './lib' rather than import lib from './lib' followed by lib.foo and lib.bar. Named imports document the API surface, make tree-shaking effective, and resist the trap of a default export later being replaced by a namespace object.
Checks
- Each external value used in the file is imported by name at the top.
- Default imports appear only when the source module has exactly one logical export (e.g. a React component file).
- Import paths are stable: prefer package roots (
'lodash/get','@scope/pkg') over cross-package deep paths intodist/orsrc/. - Imports are sorted: external packages first, then internal, then relative — and grouped with blank lines (Airbnb / ESLint
import/order).
Label
Prefer named imports from stable paths; reserve default imports for true single-export modules
Label
Prefer named imports from stable paths; reserve default imports for true single-export modules
Source
prime-system/examples/web-style/primes/compiled/@web-style/rule-named-imports-stable-paths/atom.yaml