typescript-config-surgeon

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

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

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; the skill generates a shared tsconfig.base.json, per-package overrides, a strict type-checked ESLint flat config with eslint-config-prettier last, and validate scripts for CI. ## Quick Start Ask the assistant to audit and fix the TypeScript, ESLint, and Prettier configuration in your project, for example by saying "fix my tsconfig and set up ESLint flat config with Prettier for my Next.js app".

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 for TypeScript?

Create an eslint.config.ts using typescript-eslint's config helper, combining eslint recommended, strictTypeChecked, and stylisticTypeChecked rule sets. Place eslint-config-prettier last in the array so it disables all ESLint rules that conflict with Prettier formatting.

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

Path aliases defined in tsconfig paths do not resolve at runtime in Node.js by default. Install tsconfig-paths and run with node -r tsconfig-paths/register, or use ts-node with the same register flag during development.

Should I use moduleResolution bundler or NodeNext?

Use bundler for Next.js and Vite projects where a bundler handles 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 TypeScript ESLint linting so slow?

Type-aware rules using parserOptions.project run the TypeScript compiler on every linted file, which is expensive. Scope type-aware rules to only **/*.{ts,tsx} files in the flat config and enable skipLibCheck plus incremental in tsconfig to speed up checking.

Why does exactOptionalPropertyTypes break my existing code?

With exactOptionalPropertyTypes, assigning undefined to an optional property is an error because optional means absent, not undefined. Either omit the property entirely or declare the type as boolean | undefined when undefined assignment is intentional.

Does this config work with ESLint 8 and .eslintrc.json?

The generated configuration targets ESLint 9 flat config (eslint.config.ts) and requires eslint.useFlatConfig in VS Code settings. Projects on ESLint 8 with .eslintrc.json should migrate, as the flat config format differs structurally from the legacy format.