typescript-config-surgeon

Audits and generates tsconfig, ESLint flat config, and Prettier configurations for TypeScript projects.

1|Updated May 4, 2026
One-click install
npx skills add https://github.com/Scardubu/SwarmXQ --skill typescript-config-surgeon-scardubu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-config-surgeon
Source: https://github.com/Scardubu/SwarmXQ/tree/main/.ai/skills/typescript-config-surgeon
Command: npx skills add https://github.com/Scardubu/SwarmXQ --skill typescript-config-surgeon-scardubu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? TypeScript toolchain files (tsconfig.json, ESLint flat config, Prettier config) have subtle interdependencies that cause hours of debugging when misconfigured — wrong moduleResolution, broken path aliases, slow type-checking, and ESLint/Prettier rule conflicts. ## Core Features & Use Cases - Config Generation: Produces coordinated tsconfig.json, ESLint 9 flat config, .prettierrc.json, and package.json scripts for Next.js 15, Node.js/Fastify, library packages, and monorepos with project references. - Failure Diagnosis: Fixes common issues like path aliases failing at runtime, moduleResolution errors in Node.js, exactOptionalPropertyTypes breakage, and slow type-aware linting. - Use Case: A developer sets up a pnpm monorepo with a Next.js web app and Fastify API, and needs strict-mode tsconfigs, a shared ESLint flat config with Prettier conflict resolution, and VS Code integration that all work together. ## Quick Start Ask the assistant to audit and fix the TypeScript, ESLint, and Prettier configuration for your project, for example by saying "set up strict TypeScript with ESLint flat config and Prettier for my Next.js monorepo".

Frequently Asked Questions about typescript-config-surgeon

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

FAQPage Schema
How do I set up ESLint flat config with TypeScript and Prettier?

Create an eslint.config.ts using typescript-eslint's strictTypeChecked presets, add React and Next.js plugin rules, and place eslint-config-prettier last in the config array. The Prettier config entry disables all ESLint formatting rules that would conflict with Prettier.

How do I fix TypeScript path aliases not working at runtime in Node.js?

Path aliases defined in tsconfig.json only work at compile time, so Node.js needs tsconfig-paths to resolve them at runtime. Install it as a dev dependency and run your app with node -r tsconfig-paths/register or ts-node -r tsconfig-paths/register.

Should I use moduleResolution bundler or NodeNext in tsconfig?

Use bundler for Next.js and Vite projects where a bundler handles module resolution. Use NodeNext for pure Node.js projects, which requires explicit .js extensions in relative imports that the compiler maps back to .ts files.

Why is ESLint type-aware linting slow and how do I speed it up?

Type-aware rules using parserOptions.project are slow when applied to every file. Scope them to TypeScript files only with a files: ['**/*.{ts,tsx}'] block, and enable skipLibCheck and incremental in tsconfig for faster type-checking.

Does exactOptionalPropertyTypes break existing TypeScript code?

Yes, it makes optional properties reject explicit undefined assignments, so { debug: undefined } fails against { debug?: boolean }. Fix it by declaring the property as boolean | undefined or omitting the property entirely instead of assigning undefined.