CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-tsconfig--node14

A base TSConfig for working with Node 14.

84

1.05x
Overview
Eval results
Files

task.mdevals/scenario-5/

Multi-Framework TypeScript Configuration Tool

A command-line utility that generates TypeScript configurations for different framework setups, utilizing pre-configured base configurations and applying framework-specific customizations.

Capabilities

Generate Next.js Configuration

Creates a TypeScript configuration file optimized for Next.js projects with proper include patterns and plugin setup.

  • Calling generateTsConfig with framework "nextjs" and targetDir "./nextjs-project" creates a tsconfig.json that includes "next-env.d.ts" in the include array @test
  • The generated Next.js configuration contains a plugins array with an entry for "next" @test

Generate Remix Configuration

Creates a TypeScript configuration file for Remix projects with path aliases for the app directory.

  • Calling generateTsConfig with framework "remix" and targetDir "./remix-project" creates a tsconfig.json with paths containing "~/" mapped to ["./app/"] @test

Generate Nuxt Configuration

Creates a TypeScript configuration file for Nuxt projects with dual path aliases and exclude patterns.

  • Calling generateTsConfig with framework "nuxt" and targetDir "./nuxt-project" creates a tsconfig.json with paths containing both "~/" and "@/" aliases @test
  • The generated Nuxt configuration contains an exclude array with ".nuxt" directory @test

Generate Combined Configuration

Creates a TypeScript configuration that extends multiple base configurations using TypeScript 5.0+ multiple extends feature.

  • Calling generateTsConfig with framework "node-strict" and targetDir "./strict-node-project" creates a tsconfig.json where the extends field is an array containing two base configurations @test

Implementation

@generates

API

/**
 * Configuration options for generating TypeScript configuration files
 */
interface ConfigOptions {
  /** Target directory where tsconfig.json will be generated */
  targetDir: string;
  /** Framework type to generate configuration for */
  framework: 'nextjs' | 'remix' | 'nuxt' | 'node-strict';
  /** Additional compiler options to include (optional) */
  additionalOptions?: Record<string, any>;
}

/**
 * Generates a framework-specific TypeScript configuration file
 *
 * @param options - Configuration generation options
 * @returns Promise that resolves to the path of the generated tsconfig.json file
 * @throws Error if the target directory doesn't exist or framework is unsupported
 */
export async function generateTsConfig(options: ConfigOptions): Promise<string>;

/**
 * Validates that a generated tsconfig.json has the correct structure
 *
 * @param configPath - Path to the tsconfig.json file to validate
 * @returns Promise that resolves to true if valid, false otherwise
 */
export async function validateTsConfig(configPath: string): Promise<boolean>;

Dependencies { .dependencies }

@tsconfig/bases { .dependency }

Provides pre-configured TypeScript configuration files for different frameworks and runtimes that can be extended via the extends field.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-tsconfig--node14

tile.json