configure-typescript
Skill7 starsChanged 16 days agoMITView on GitHub
Use when setting up or hardening TypeScript in a frontend project - strict flags, noUncheckedIndexedAccess, TS 6/7-safe paths, and one @/ alias kept in sync across tsconfig, Vite, Vitest, Storybook and Playwright.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- VelimirMueller/claude-skillsword for word, first seen Oct 11, 2026
Other versions1 project uses a version of this.
Word for word · 1
- VelimirMueller/claude-skills★ 7100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository156 other files it gives its agents.
- skills/swift/swiftui-design-principles/AGENTS.mdAGENTS.md
- skills/swift/ios-code-audit/CLAUDE.mdCLAUDE.md
- skills/swift/swift-focusengine-pro/llms.txtllms.txt
- build-llm-seamSkill
- build-mcp-serverSkill
- build-rag-pipelineSkill
- secure-llm-featuresSkill
- set-up-llm-evalsSkill
- build-nextjs-backendSkill
- build-supabase-edge-functionSkill
- configure-backend-testsSkill
- design-http-apiSkill
- harden-backendSkill
- scaffold-fastapi-serviceSkill
- scaffold-go-serviceSkill
- scaffold-hono-serviceSkill
- secure-supabase-rlsSkill
- set-up-backend-authSkill
- set-up-background-jobsSkill
- set-up-databaseSkill
- set-up-nextjs-supabase-authSkill
- set-up-observabilitySkill
- set-up-supabaseSkill
- build-cliSkill
- release-cliSkill
- set-up-dev-toolchainSkill
- audit-securitySkill
- audit-toolchainSkill
- extend-skillsetSkill
- promote-releaseSkill
- set-up-stack-profileSkill
- write-commit-messagesSkill
- write-pull-requestsSkill
- analyze-complexitySkill
- apply-algorithmsSkill
- apply-design-patternsSkill
- apply-design-principlesSkill
- apply-solidSkill
- choose-data-structureSkill
- debug-systematicallySkill
- enforce-dependency-ruleSkill
- refactor-safelySkill
- slice-and-estimateSkill
- write-clean-testsSkill
- write-readable-codeSkill
- clean-frontend-scaffoldingSkill
- configure-accessibilitySkill
- configure-analyticsSkill
- configure-ciSkill
- configure-error-trackingSkill
- configure-lintingSkill
- configure-test-stackSkill
- create-moduleSkill
- optimize-performanceSkill
- scaffold-frontend-projectSkill
- set-up-authSkill
- set-up-design-systemSkill
- set-up-document-headSkill
- set-up-error-boundariesSkill
- set-up-feature-flagsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Read .claude/stack-profile.md if present: package_manager replaces pnpm below (../_shared/stack-versions.md, "Stack profile").
- Distinctive: line 19
If every flag is in place and every config has the matching alias, exit early.
- Very specific: line 49
Add a typecheck script. tsc --noEmit at the root checks nothing in the Vite template (files: [], exit 0 on a real error), so the script …
- Very specific: line 98
Run pnpm typecheck again: still 0 errors.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Configure TypeScript
1. Audit current state
Read .claude/stack-profile.md if present: package_manager replaces pnpm below (../_shared/stack-versions.md, "Stack profile"); frontend.framework decides the type-check binary (tsc for React, vue-tsc for Vue).
Inspect the tsconfig that holds the app options. The Vite 8 templates split them: root tsconfig.json is only { "files": [], "references": [...] }, and the options live in tsconfig.app.json.
- Is
compilerOptions.stricttrue? ArenoUncheckedIndexedAccess,noImplicitOverride,noUnusedLocals,noUnusedParameters,noFallthroughCasesInSwitch,verbatimModuleSyntaxset? - Is there a
pathsmapping for@/*? IsbaseUrlset? RemovebaseUrl: TS 6.0 errors on it (TS5101) and TS 7.0 deletes it (TS5102).pathsentries are relative to the tsconfig that declares them, so"./src/*"works without it. - Does a
typecheckscript exist? (step 3)
Inspect alias config in whichever exist: vite.config.ts (resolve.alias), vitest.config.ts, .storybook/main.ts, playwright.config.ts.
If every flag is in place and every config has the matching alias, exit early.
2. Decide what to do
- Nothing strict → apply the full set below.
- Strict on but flags missing → add them.
- Flags in place but alias missing somewhere → add it to those configs.
- A flag that produces hundreds of errors on an existing codebase → enable it in its own PR (
tsconfig-rules.md, "When to deviate").
3. Update the app tsconfig
Merge into tsconfig.app.json (or tsconfig.json when there is no split):
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"verbatimModuleSyntax": true,
"paths": { "@/*": ["./src/*"] }
}
}The Vite templates already set noUnusedLocals, noUnusedParameters, noFallthroughCasesInSwitch, verbatimModuleSyntax and erasableSyntaxOnly; keep them. Do not add esModuleInterop, allowSyntheticDefaultImports or useDefineForClassFields: tsc --showConfig on TS 6.0 reports them already on for module: esnext and target: es2023. isolatedModules is not needed either; the Vite templates omit it. exactOptionalPropertyTypes is opt-in, not in the default set: see tsconfig-rules.md.
Add a typecheck script. tsc --noEmit at the root checks nothing in the Vite template (files: [], exit 0 on a real error), so the script must build the references:
{ "scripts": { "typecheck": "tsc -b" } }Vue: "typecheck": "vue-tsc -b". Every other skill in this catalogue verifies with pnpm typecheck.
4. Update vite.config.ts
import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
export default defineConfig({
resolve: {
alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) },
},
// ... existing plugins stay
});Vite 8 can read paths itself with resolve.tsconfigPaths: true, one source of truth instead of two. It is off here because the Vite docs flag a performance cost and it follows include, so an alias in a CSS or .vue file needs matching include entries (docs). The explicit alias costs one line.
5. Vitest (if present)
Vitest 5 inline projects inherit the root config, so a mergeConfig(viteConfig, ...) setup (see path-aliases.md) carries the alias into every project. A standalone vitest.config.ts with no merge needs the alias block from step 4. tests/ needs its own tsconfig so test files are type-checked; configure-test-stack creates it.
6. Storybook (if installed)
Storybook 10's Vite builders (@storybook/react-vite, @storybook/vue3-vite) load the project's vite.config.ts, so the alias is inherited. Add nothing. For another builder, inject the alias in viteFinal.
7. Playwright (if installed)
Playwright resolves paths from the nearest tsconfig itself (verified with 1.64, including through references). Add nothing. Do not add tsconfig-paths or a globalSetup to register aliases: it is dead weight, and the usual snippet (globalSetup: require.resolve(...)) crashes in an ESM project ("type": "module", which the Vite templates set). e2e specs rarely need to import app code; if one does, use a relative import.
8. Verify
pnpm typecheckExpected: exit 0, no output. Prove the alias with a throwaway file:
// src/__alias-check.ts
import { env } from '@/libs/env'; // any existing module under src/
export const check = env;Run pnpm typecheck again: still 0 errors. Change the import to @/does-not-exist and confirm it now fails, so you know the check can fail. Delete src/__alias-check.ts.
References
- ./tsconfig-rules.md — every flag with rationale, TS 6/7 notes, the opt-in tier.
- ./path-aliases.md — alias snippets for every config file.
- ../_shared/conventions.md —
@/prefix and the type-check rule.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

