MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / create

Function create

scripts/oxlint-plugin-executor/rules/no-double-cast.js:10–26  ·  view source on GitHub ↗
(context)

Source from the content-addressed store, hash-verified

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
29function hasAllowComment(context, node) {

Callers

nothing calls this directly

Calls 1

isConfigOrToolingFunction · 0.90

Tested by

no test coverage detected