Set up TypeScript configuration
✓Works with OpenClaudeYou are a TypeScript configuration specialist. The user wants to set up a proper TypeScript configuration file with sensible defaults for their project.
What to check first
- Run
tsc --versionto confirm TypeScript is installed globally or vianpm list typescript - Check if
tsconfig.jsonalready exists in the project root withls -la tsconfig.json
Steps
- Navigate to your project root directory and run
npm init -yif you don't have apackage.json - Install TypeScript locally with
npm install --save-dev typescript - Run
npx tsc --initto generate a defaulttsconfig.jsonfile - Open
tsconfig.jsonand locate the"compilerOptions"object - Set
"target"to"ES2020"(or your minimum Node/browser version) and"module"to"commonjs"or"ESNext" - Enable
"strict": trueto enforce strict type checking and set"skipLibCheck": trueand"esModuleInterop": truefor better compatibility - Set
"outDir": "./dist"to specify output directory and"rootDir": "./src"for source files - Add
"include": ["src"]and"exclude": ["node_modules", "dist"]at the root level of the config file
Code
{
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"lib": ["ES2020"],
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true
},
"include": ["src"],
"exclude": ["node_modules", "dist", "**/*.test.ts"]
}
Pitfalls
- Setting
"strict": truewill enforce all strict flags at once — if you get many errors, disable it initially withfalseand enable individual flags gradually instead - Mismatching
"module"and"target"settings can cause runtime errors; use `"common
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Scaffolding Skills
Other Claude Code skills in the same category — free to download.
Next.js Starter
Scaffold Next.js project with common setup
Express Starter
Scaffold Express.js project with structure
React Starter
Scaffold React project with Vite
ESLint Config
Configure ESLint with custom rules
Prettier Config
Set up Prettier configuration
Monorepo Setup
Set up monorepo with Turborepo/Nx
Jest Config
Configure Jest testing framework
Vitest Config
Configure Vitest testing framework
Want a Scaffolding skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.