Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Type-only imports and exportsNew to Visual Studio Code? Get it now.
Type-only imports and exports

Type-only imports and exports

mscolnick

|
248 installs
| (0) | Free
Convert imports and exports to type-only declarations
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSCode Type-only imports and exports

Overview

Convert imports or exports to import type and export type when possible.

For imports:

// CONVERT THIS

import UserComponent, { UserComponentProps } from './UserComponent';

// TO

import UserComponent from './UserComponent';
import type { UserComponentProps } from "./UserComponent";

For exports:

// CONVERT THIS

export { UserComponentProps, UserComponent } from './UserComponent';
export { UserType } from './types';
export { DEFAULT_USER } from './constants';

// TO

export { UserComponent } from './UserComponent';
export type { UserComponentProps } from "./UserComponent";
export { DEFAULT_USER } from './constants';
export type { UserType } from "./types";

Changelog

CHANGELOG.md

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft