Summary
WP-Code-Check currently includes .ts and .tsx in file_patterns for its JS/Node.js/headless pattern categories, but all checks are language-agnostic security and reliability patterns. There are zero TypeScript-specific checks today.
Problem
TypeScript projects have a class of common antipatterns that suppress or circumvent the type system. These are detectable with grep and don't require AST analysis, making them a natural fit for WPCC's zero-dependency design.
Proposed grep-feasible TypeScript checks
| Antipattern |
Grep pattern |
Why it matters |
@ts-ignore |
@ts-ignore |
Silences type errors without fixing them |
@ts-nocheck |
@ts-nocheck |
Disables type checking for entire file |
@ts-expect-error (without comment) |
@ts-expect-error\s*$ |
Suppression without explanation |
as any |
as\s+any |
Unsafe type assertion, defeats type safety |
<any> type assertion |
<any> |
Legacy syntax for the same problem |
: any type annotation |
:\s*any\b |
Explicit opt-out of type safety |
// eslint-disable (broad) |
eslint-disable(?!-next-line) |
File-wide lint suppression |
| Non-null assertion abuse |
\w+!\. or \w+!\[ |
Overrides null safety checks |
Checks that are NOT feasible with grep
These require tsc or @typescript-eslint and are out of scope:
- Implicit
any (missing annotations where inference fails)
- Missing return types on exported functions
- Unsafe generic usage
strictNullChecks compliance
- Unused type imports
Suggested implementation
- New pattern category:
typescript (or extend existing nodejs category)
- New pattern files:
ts-001-type-suppression.json, ts-002-unsafe-any.json, etc.
file_patterns: ["*.ts", "*.tsx"] only (not .js)
- Severity: advisory/warning — these are code smells, not always bugs
Acceptance criteria
🤖 Generated with Claude Code
Summary
WP-Code-Check currently includes
.tsand.tsxinfile_patternsfor its JS/Node.js/headless pattern categories, but all checks are language-agnostic security and reliability patterns. There are zero TypeScript-specific checks today.Problem
TypeScript projects have a class of common antipatterns that suppress or circumvent the type system. These are detectable with grep and don't require AST analysis, making them a natural fit for WPCC's zero-dependency design.
Proposed grep-feasible TypeScript checks
@ts-ignore@ts-ignore@ts-nocheck@ts-nocheck@ts-expect-error(without comment)@ts-expect-error\s*$as anyas\s+any<any>type assertion<any>: anytype annotation:\s*any\b// eslint-disable(broad)eslint-disable(?!-next-line)\w+!\.or\w+!\[Checks that are NOT feasible with grep
These require
tscor@typescript-eslintand are out of scope:any(missing annotations where inference fails)strictNullCheckscomplianceSuggested implementation
typescript(or extend existingnodejscategory)ts-001-type-suppression.json,ts-002-unsafe-any.json, etc.file_patterns:["*.ts", "*.tsx"]only (not.js)Acceptance criteria
.ts/.tsxfiles onlywpcc --featureslists the new patterns🤖 Generated with Claude Code