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-9/

TypeScript Configuration Helper

Build a Node.js script that helps developers select appropriate base TypeScript configurations based on their project requirements, with focus on legacy runtime support and experimental feature needs.

@generates

Capabilities

Base Configuration Recommendation

  • Return "node10" when asked for a configuration supporting legacy ES5 target @test
  • Return "taro" when asked for a configuration supporting decorators @test

Configuration Extension

  • Generate a minimal tsconfig.json that extends a specified base configuration using the "extends" field @test
  • Include the proper package path format when extending (e.g., "@tsconfig/node10/tsconfig.json") @test

Feature Availability Check

  • Identify which base configurations support experimental decorators from a given list @test
  • Identify which base configurations target ES5 or use CommonJS from a given list @test

API

/**
 * Recommends a base configuration name based on requirements
 * @param requirements - Object with optional properties: needsDecorators (boolean), needsLegacyTarget (boolean)
 * @returns The name of a suitable base configuration (e.g., "node10", "taro", "ember")
 */
export function recommendConfig(requirements: {
  needsDecorators?: boolean;
  needsLegacyTarget?: boolean;
}): string;

/**
 * Generates a minimal tsconfig.json object that extends a base configuration
 * @param baseName - The base configuration name (e.g., "node10", "strictest")
 * @returns An object with an "extends" field pointing to the base configuration
 */
export function generateExtendingConfig(baseName: string): {
  extends: string;
};

/**
 * Finds all configurations in a list that support a specific feature
 * @param configNames - Array of base configuration names to check
 * @param feature - The feature to check for: "decorators" or "legacy"
 * @returns Array of configuration names that support the feature
 */
export function findConfigsWithFeature(
  configNames: string[],
  feature: "decorators" | "legacy"
): string[];

Dependencies { .dependencies }

@tsconfig/bases { .dependency }

Provides base TypeScript configuration presets for various environments and experimental features.

Install with Tessl CLI

npx tessl i tessl/npm-tsconfig--node14

tile.json