/typescript:typescript-qualityfrom typescript
Use for TypeScript type-safety work - fixing type errors from tsc or tsrs, adding types or TSDoc, enabling strict mode, sourcing @types packages, or Oxlint/ast-grep lint errors and disable directives. Provides guidance on strict mode compliance, TSDoc documentation, and DefinitelyTyped packages.
Ships in typescript. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill covers TypeScript-specific quality requirements including strict mode compliance, type safety, and documentation standards.
Run type checking through package.json scripts:
bun run typecheck # Preferred - uses project tsconfig.json
Fallback when no typecheck script exists: run the compiler the project declares in package.json. Use bunx tsrs --noEmit for a tsrs project and bunx tsc --noEmit otherwise. tsrs is a Rust port of the TypeScript compiler with tsc's CLI flags.
Run the compiler against the full project, not individual files, because it needs full project context for correct type-checking. This applies to tsrs as well as tsc. A plugin guard blocks per-file invocations of both tsc and tsrs.
All TypeScript projects use strict mode. Ensure:
any types - all variables, parameters, and return types should have explicit types or be inferable@ts-ignore without exceptional justification and comment explaining why!) without safety checks or clear documentationDocument public APIs with TSDoc format:
/**
* Brief description of function purpose
*
* @param input - Description of the input parameter
* @param schema - Description of the schema parameter
* @returns Description of return value
* @throws {ErrorType} When this error is thrown
* @example
* ```typescript
* const result = myFunction(input, schema);
* ```
*/
export function myFunction<T>(input: unknown, schema: Schema<T>): T {
// implementation
}
Package includes types field in package.json - no @types package needed.
For packages without bundled types:
bun add -d @types/package-name
Match the @types major version to the package major version (e.g., [email protected] uses @types/[email protected]).
If a package has no types and no @types package exists:
.d.ts file with minimal declarationsdeclare module 'package-name';Before completing TypeScript work:
bun run typecheck or watcher)bun run lint; see Linting below)Which linter runs is decided by the project's package.json scripts and config files (oxlint.config.ts vs eslint.config.*). Some projects still run ESLint.
bun run lint. For auto-fix, run bun run lint:fix if the script exists, then review the diff.node node_modules/oxlint/bin/oxlint --deny-warnings <paths>
Bun truncates piped output at 64 KiB, and some rules resolve globs against the working directory. This is a deliberate exception to the bun-first rule.--deny-warnings. Warnings alone exit 0, and unused disable directives are reported as warnings.tsconfig.json. Lint does not report compiler diagnostics, so the typecheck gate stays separate.bun run check:ast-grep, which runs ast-grep scan) where one exists.// eslint-disable-next-line <rule-id> -- <specific reason>
Oxlint honours ESLint directive syntax. The rule list and the reason are both required. Use the id Oxlint reports: ESLint-plugin rules loaded under an alias carry the alias prefix (eslint-core/, unicorn-js/, import-x-js/, n-js/, jest-js/).disable-next-line or disable-line, for local exceptions. Whole-file disables go in the file header before any code. Never use eslint-enable or oxlint-enable, or inline eslint, global, globals, exported, or eslint-env config comments. Delete a directive once it is no longer needed, since it fails the gate as unused.// ast-grep-ignore: <rule-id> -- <reason>
In .js/.jsx files the shared rule ids end in -javascript; in .tsx they end in -tsx.package.json is still linted by ESLint, since Oxlint does not lint JSON. The project's lint script already runs it.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub hughescr/claude-code-config --plugin typescript