CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-acorn-jsx

tessl install tessl/npm-acorn-jsx@5.3.0

JSX parsing plugin for the Acorn JavaScript parser that enables fast parsing of React JSX syntax

Agent Success

Agent success rate when using this tile

76%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.69x

Baseline

Agent success rate without this tile

45%

task.mdevals/scenario-8/

JSX Boolean Attribute Parser

A utility that parses JSX code containing boolean attributes and extracts information about those attributes.

Capabilities

Parse JSX with boolean attributes

  • Parse JSX code <input disabled /> and identify that the disabled attribute has a null value @test
  • Parse JSX code <button selected /> and identify that the selected attribute has a null value @test
  • Parse JSX code <input disabled checked /> and identify multiple boolean attributes with null values @test
  • Parse JSX code <input type="text" disabled /> with mixed boolean and string attributes and correctly distinguish between them @test

Implementation

@generates

API

/**
 * Parses JSX code and returns an array of boolean attributes found in the code.
 * Each boolean attribute object contains the attribute name and its value (should be null).
 *
 * @param {string} jsxCode - The JSX code to parse
 * @returns {Array<{name: string, value: null}>} Array of boolean attributes with their values
 * @throws {Error} If the JSX code is invalid
 */
function parseBooleanAttributes(jsxCode) {
  // Implementation here
}

module.exports = { parseBooleanAttributes };

Dependencies { .dependencies }

acorn { .dependency }

Provides JavaScript parsing capabilities.

acorn-jsx { .dependency }

Provides JSX parsing support for Acorn parser.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/acorn-jsx@5.3.x
tile.json