From typescript-plugin
Provides 2025 TypeScript strict mode tsconfig.json recommendations, explains strict flags like noUncheckedIndexedAccess, moduleResolution (Bundler vs NodeNext), verbatimModuleSyntax. Use for new projects or stricter type safety migrations.
How this skill is triggered — by the user, by Claude, or both
Slash command
/typescript-plugin:typescript-stricthaikuThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Modern TypeScript configuration with strict type checking for maximum safety and developer experience. This guide focuses on TypeScript 5.x best practices for 2025.
Modern TypeScript configuration with strict type checking for maximum safety and developer experience. This guide focuses on TypeScript 5.x best practices for 2025.
| Use this skill when... | Use another approach when... |
|---|---|
| Setting up a new TypeScript project | Debugging runtime errors (use debugger) |
| Migrating to stricter type safety | Configuring build tools (use bundler docs) |
| Choosing moduleResolution strategy | Writing application logic |
| Enabling noUncheckedIndexedAccess | Optimizing bundle size (use bundler skills) |
What is Strict Mode?
Key Capabilities
{
"compilerOptions": {
// Type Checking
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
// Modules
"module": "ESNext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": false,
"verbatimModuleSyntax": true,
// Emit
"target": "ES2022",
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"outDir": "dist",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"removeComments": false,
"noEmit": false,
// Interop
"isolatedModules": true,
"allowJs": false,
"checkJs": false,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "build"]
}
strict: true (Umbrella Flag)Enables all strict type-checking options:
{
"strict": true
// Equivalent to:
// "noImplicitAny": true,
// "strictNullChecks": true,
// "strictFunctionTypes": true,
// "strictBindCallApply": true,
// "strictPropertyInitialization": true,
// "noImplicitThis": true,
// "alwaysStrict": true
}
Always enable strict: true for new projects.
| Flag | Purpose |
|---|---|
noUncheckedIndexedAccess | Index signatures return T | undefined instead of T |
noImplicitOverride | Require override keyword for overridden methods |
noPropertyAccessFromIndexSignature | Force bracket notation for index signatures |
noFallthroughCasesInSwitch | Prevent fallthrough in switch statements |
exactOptionalPropertyTypes | Optional properties cannot be set to undefined explicitly |
noUncheckedIndexedAccess (Essential)// With noUncheckedIndexedAccess
const users: Record<string, User> = {};
const user = users['john'];
// Type: User | undefined (correct - must check before use)
if (user) {
console.log(user.name); // Type narrowed to User
}
Always enable this flag to prevent runtime errors.
| Strategy | Use For | Extensions Required |
|---|---|---|
Bundler | Vite, Webpack, Bun projects | No |
NodeNext | Node.js libraries and servers | Yes (.js) |
moduleResolution: "Bundler" (Vite/Bun){
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Bundler"
}
}
exports field supportmoduleResolution: "NodeNext" (Node.js){
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
}
type: "module".js extensions (even for .ts files)Prevents TypeScript from rewriting imports/exports.
{
"compilerOptions": {
"verbatimModuleSyntax": true
}
}
// Error: 'User' is a type and must be imported with 'import type'
import { User } from './types';
// Correct
import type { User } from './types';
// Correct (mixed import)
import { fetchUser, type User } from './api';
Replaces deprecated importsNotUsedAsValues and preserveValueImports.
| Context | Command |
|---|---|
| Check errors | bunx tsc --noEmit |
| Check single file | bunx tsc --noEmit src/utils.ts |
| Show config | bunx tsc --showConfig |
| Check module resolution | bunx tsc --showConfig | grep moduleResolution |
| Flag | Value | Category |
|---|---|---|
strict | true | Type Checking |
noUncheckedIndexedAccess | true | Type Checking |
noImplicitOverride | true | Type Checking |
noPropertyAccessFromIndexSignature | true | Type Checking |
noFallthroughCasesInSwitch | true | Type Checking |
module | ESNext / NodeNext | Modules |
moduleResolution | Bundler / NodeNext | Modules |
verbatimModuleSyntax | true | Modules |
target | ES2022 | Emit |
isolatedModules | true | Interop |
skipLibCheck | true | Interop |
For detailed examples, advanced patterns, and best practices, see REFERENCE.md.
npx claudepluginhub laurigates/claude-plugins --plugin typescript-pluginEnables and satisfies strict TypeScript checks including strictNullChecks, noImplicitAny, and exactOptionalPropertyTypes. Guides incremental adoption and debugging of strict flag errors.
Guides TypeScript code with pedantic best practices: strict tsconfig flags like noUncheckedIndexedAccess, discriminated unions over assertions, Zod runtime validation, barrel exports, as const, ESLint rules.
TypeScript deep-dive skill covering type-level programming, performance optimization, monorepo patterns, and migration strategies. Also redirects to specialized subagents for bundler/module/type issues.