tessl install tessl/npm-acorn-jsx@5.3.0JSX 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%
Build a validation tool that analyzes JSX code and detects invalid attribute expressions.
Your tool should parse JSX source code and identify attributes that have empty expression containers. When such invalid syntax is found, the tool should report an error with a descriptive message indicating the problem.
The validator should:
attribute={})@generates
Implement a function validateJSX that takes a string of JSX source code and returns a validation result object with the following structure:
{
valid: boolean, // true if no errors, false otherwise
error: string | null // error message if invalid, null otherwise
}<div attr={} />), the validator returns valid: false with an appropriate error message @test<div attr={value} />), the validator returns valid: true with no error @test<div>{}</div>), the validator returns valid: true since this is allowed in JSX @test/**
* Validates JSX source code for empty expression containers in attributes
*
* @param {string} jsxCode - The JSX source code to validate
* @returns {Object} Validation result with 'valid' boolean and 'error' string
*/
function validateJSX(jsxCode) {
// Implementation here
}
module.exports = { validateJSX };JavaScript parser that provides the base parsing functionality.
JSX parsing plugin for Acorn that adds JSX syntax support and validation.