CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-jsx-ast-utils

AST utility module for statically analyzing JSX

50

1.42x
Quality

Pending

Does it follow best practices?

Impact

50%

1.42x

Average score across 10 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

task.mdevals/scenario-2/

JSX Attribute Name Extraction

Build a helper that returns the names of JSX attributes from a parsed AST node, preserving namespace prefixes when they exist.

Capabilities

Collects attribute names from JSX opening elements

  • Given a JSX opening element for <svg:path focusable="false" xlink:href="#icon" />, the helper returns ["focusable", "xlink:href"] in source order. @test
  • Namespaced attributes keep their original prefix and local name (for example xml:lang stays exactly that). @test

Skips spreads without failing

  • Spread attributes in the attributes array are ignored without throwing or adding placeholders to the result. @test

Rejects non-JSX inputs

  • Passing a node that is not a JSX opening element triggers a thrown error that explains the expectation. @test

Implementation

@generates

API

export function extractAttributeNames(
  node: JSXOpeningElement,
): string[];

Dependencies { .dependencies }

jsx-ast-utils { .dependency }

Utilities for inspecting JSX AST nodes and reading attribute names with namespace support.

tile.json