AST utility module for statically analyzing JSX
50
Pending
Does it follow best practices?
Impact
50%
1.42xAverage score across 10 eval scenarios
Pending
The risk profile of this skill
Create a utility that parses JSX source and produces evaluated prop snapshots for a given component.
componentName, returning one entry per element in document order. @testpropNames; missing props are omitted. Boolean shorthand and string "true" / "false" convert to booleans; literal numbers and strings are preserved. @testnull while other props remain intact. @test@generates
export interface PropSnapshot {
elementIndex: number;
props: Record<string, any>;
}
export function generatePropSnapshots(
sourceCode: string,
componentName: string,
propNames: string[]
): PropSnapshot[];Evaluates JSX prop values into JavaScript equivalents and assists with JSX attribute access.
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10