Codiga has joined Datadog!

Read the Blog
Skip to main content

HTML Attribute AST JavaScript Object

The HTML Attritube object matches a JavaScript HTML Attribute as the one you have in JSX. It is attached to a HTML Element.

The astType value for this node is htmlattribute.

Code Pattern

This object captures the part attr="val" in the following code pattern.

return <MyComponent attr="val" />;

Attributes

  • name (type AstString): the name of the attribute
  • value (type AstElement): the value of the attribute

See Also

Examples of rules