typescript-plugin/skills/typescript-strict/SKILL.md
TypeScript strict mode: tsconfig.json, strict flags, Bundler/NodeNext moduleResolution, verbatimModuleSyntax. Use when setting up TS or migrating to stricter type safety.
npx skillsauth add laurigates/claude-plugins typescript-strictInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
tools
Scaffold a new ComfyUI custom-node repo (pyproject, CI, release-please, vitest+pytest, JS extension skeleton) in the picker/gesture vein. Use when bootstrapping or init-ing a comfyui node pack.
tools
Orchestrate a ComfyUI node pack from idea to registry: scaffold, create + seed the repo, open the gitops adoption PR. Use when releasing or spinning up a new comfyui node pack.
testing
macOS EndpointSecurity/EDR high CPU & battery drain. Use when Kandji ESF / XProtect pegs a core; trace the exec storm via powermetrics + eslogger.
development
odiff pixel-by-pixel image diffing. Use when comparing screenshots, detecting visual regressions, diffing before/after PNGs, asserting golden images.