imports-exports

Enforce ESLint rules for TypeScript import ordering and named exports.

3|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/guicheffer/devorch-cli --skill imports-exports
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: imports-exports
Source: https://github.com/guicheffer/devorch-cli/tree/main/templates/skills/code-quality/imports-exports
Command: npx skills add https://github.com/guicheffer/devorch-cli --skill imports-exports

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces consistent and maintainable import and export conventions in TypeScript projects, improving code readability and reducing errors.

Core Features & Use Cases

  • ESLint-Enforced Ordering: Automatically organizes imports into predefined groups (React, external, internal, etc.) with blank lines between them.
  • Named Exports Only: Enforces the use of named exports for better IDE support and tree-shaking.
  • Path Aliases: Promotes the use of path aliases (e.g., @libs/, @modules/) over relative paths for cleaner, more stable imports.
  • Type-Only Imports: Encourages import type for better bundle size optimization.
  • Barrel Exports: Guides the creation of index.ts files to simplify module APIs.
  • Use Case: When writing new TypeScript files or reviewing code, ensure all imports are correctly ordered, named exports are used, and path aliases are leveraged for internal modules.

Quick Start

Run yarn lint --fix to automatically format your imports and exports according to the defined standards.

Frequently Asked Questions about imports-exports

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize TypeScript import ordering and export conventions in my project?

Standardizing TypeScript imports and exports involves enforcing ESLint rules for import ordering, named exports, type-only imports, and path alias usage. This ensures code consistency, improves maintainability, and optimizes bundle sizes through structured module declarations.

What is the best way to enforce named exports and type-only imports in TypeScript?

Enforcing named exports and type-only imports in TypeScript is done by applying strict ESLint rules that require named exports for better tree-shaking and `import type` for bundle size optimization. This structure improves IDE support and module organization.

How do I organize TypeScript module imports into predefined groups with ESLint?

Organizing TypeScript module imports into predefined groups is achieved by configuring ESLint to automatically sort and separate imports into predefined groups like React, external, and internal modules. This automated grouping enforces code readability and structural consistency across the codebase.

Does using path aliases over relative paths improve TypeScript code maintainability?

Using path aliases like `@libs/` or `@modules/` over relative paths significantly improves TypeScript code maintainability and stability. It creates cleaner module declarations and prevents broken imports during file refactoring.

When should I use barrel exports for TypeScript module APIs?

You should use barrel exports by creating `index.ts` files when you need to simplify and centralize your TypeScript module APIs. This approach streamlines external consumption of internal modules and enforces consistent import paths.