Summary
unsafe_type_assertion reports line and column from node.type.getStart(sourceFile) (the any keyword position), while all other AST assertion types (unsafe_double_type_assertion, unsafe_object_assertion, unsafe_array_assertion) use node.getStart() (the start of the entire AsExpression).
Impact
- For single-line
value as any, the difference is minor (column points to any instead of value)
- For multiline
value as\n any, the line differs — unsafe_type_assertion reports line 2, other assertion types would report line 1
- If consumers use
column for editor annotations or sorting, values won't be directly comparable across assertion types
- Suppression behavior is unaffected (uses expression-start line for all branches)
Location
ai-slop-detector.ts:244-259
Resolution
Align unsafe_type_assertion to use node.getStart() like the other assertion types, or document the intentional difference if multiline accuracy is preferred.
Summary
unsafe_type_assertionreportslineandcolumnfromnode.type.getStart(sourceFile)(theanykeyword position), while all other AST assertion types (unsafe_double_type_assertion,unsafe_object_assertion,unsafe_array_assertion) usenode.getStart()(the start of the entireAsExpression).Impact
value as any, the difference is minor (column points toanyinstead ofvalue)value as\n any, the line differs —unsafe_type_assertionreports line 2, other assertion types would report line 1columnfor editor annotations or sorting, values won't be directly comparable across assertion typesLocation
ai-slop-detector.ts:244-259Resolution
Align
unsafe_type_assertionto usenode.getStart()like the other assertion types, or document the intentional difference if multiline accuracy is preferred.