Skip to content

(export)

export statements, including re-exports

clojure
(export source?)

Where:

  1. source: module source string for re-exports (the "mod" in export { a } from "mod") *

Matching:

  1. named exports, e.g. export const x = 1
  2. default exports, e.g. export default function() {}
  3. re-exports, e.g. export { a } from "mod"
  4. namespace re-exports, e.g. export * from "mod"

Behavior

  • When a source filter is provided, only re-exports with a from clause 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 = 1

Locate 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 = 1

Audit 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"

Arguments

source

• Identifier: shorthand for (str)
• String: shorthand for (str)
• Pattern: shorthand for (str)
(str)
(:into) (:and) (:or) (:not) (:text) (:kind) (:replace) (:capture)

Copyright © 2022-present Semantic Works, Inc.