(context)
| 8 | }, |
| 9 | }, |
| 10 | create(context) { |
| 11 | if (isConfigOrTooling(context.filename)) return {}; |
| 12 | |
| 13 | return { |
| 14 | TSAsExpression(node) { |
| 15 | if (node.expression?.type !== "TSAsExpression") return; |
| 16 | const innerType = node.expression.typeAnnotation?.type; |
| 17 | if (innerType !== "TSUnknownKeyword" && innerType !== "TSAnyKeyword") return; |
| 18 | if (hasAllowComment(context, node)) return; |
| 19 | context.report({ |
| 20 | node, |
| 21 | message: |
| 22 | "Avoid double casts through unknown/any; use a typed boundary, schema decode, or a narrow allow comment with a reason. Skill: wrdn-effect-schema-boundaries.", |
| 23 | }); |
| 24 | }, |
| 25 | }; |
| 26 | }, |
| 27 | }; |
| 28 | |
| 29 | function hasAllowComment(context, node) { |
nothing calls this directly
no test coverage detected