(export)
export statements, including re-exports
clojure
(export source?)Where:
- source: module source string for re-exports (the "mod" in
export { a } from "mod") *
Matching:
- named exports, e.g.
export const x = 1 - default exports, e.g.
export default function() {} - re-exports, e.g.
export { a } from "mod" - namespace re-exports, e.g.
export * from "mod"
Behavior
- When a source filter is provided, only re-exports with a
fromclause are matched.
Examples
Find modules that re-export from a deprecated package.
clojure
(export /legacy-lib/)Selects in lines { 1 } but not in { 2, 3 }:
typescript
export { createStore } from "legacy-lib"
export { createStore } from "modern-lib"
export const version = 1Locate all export statements before converting a module to default export only.
clojure
(export)Selects in lines { 1, 2 } but not in { 3 }:
typescript
export const a = 1
export default function() {}
const local = 1Audit star re-exports from a package during dependency cleanup.
clojure
(export "@company/ui")Selects in lines { 1, 2 } but not in { 3 }:
typescript
export * from "@company/ui"
export { Button } from "@company/ui"
export * from "@company/icons"