You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Detect unsafe TypeScript type assertions, including double assertions #22
KarpeSlop does not currently report unsafe TypeScript as assertions such as:
valueasunknownasTargetvalueasTarget
This is related to the previously closed #10, but the gap is broader: double assertions and ordinary unchecked object/array assertions can bypass structural type safety at database and external-data boundaries without any warning in strict mode.
Expected behavior
Strict analysis should report unsafe TypeScript assertions, including:
value as unknown as Target
Unchecked object assertions such as value as Record<string, unknown>
Unchecked array or domain-row assertions such as data as EventRow[]
The report should include the file, line, assertion form, and severity.
Scope boundaries
Do not report satisfies expressions as assertions.
Avoid false positives for generated declaration files and framework-required boundary declarations where possible.
Preserve the existing any and unsafe-type detectors.
Neither assertion form was reported by npx karpeslop@latest --quiet --strict in the consuming project. Please add fixtures and regression tests for these patterns.
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
💬 Have feedback or questions? Drop into our discord!
Activity
coderabbitai commentedon Jul 22, 2026
🔗 Related PRs
#9 - fix: resolve all false positives (issues
#2,#6,#7,#8) [merged]📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
Merge pull request #23 from CodeDeficient/feat/issue-22-unsafe-assert…
CodeDeficient commentedon Jul 27, 2026
Resolved by PR #24 (merged at 2026-07-27T19:07:54Z). The following AST-based detection is now implemented in findUnsafeAssertions():
All four forms: per-AST-node precise counts, test-file exclusion, .d.ts exclusion, inline suppression, configurable severityOverrides.
Follow-up items tracked separately: