Back to Explore

syntax-tree/hast-util-to-estree

GitHub
1 watchersOpen source

Last release:

hast-util-to-estree is a JavaScript utility that converts a hast (HTML) syntax tree into an estree (JavaScript AST) syntax tree with JSX nodes, including support for embedded MDX nodes. It’s useful when you want to embed HTML as JSX inside JavaScript while working with syntax trees.

Project status

  • Active maintenance: The last recorded upstream update is 2025-03-03, and there have been no further updates since, so relative to 2026-06-09 the project appears quiet or in maintenance mode, not actively evolving day to day.
  • Updates cadence: In early 2025 there were quick successive updates (3.1.1 in 2025-01-03, 3.1.2 in 2025-02-19, 3.1.3 in 2025-03-03), but prior to that the cadence was much slower (next major was 2023-09-01, and a major at 2023-08-04).

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • 3.1.3

    Release 3.1.3 is a small refactor described as externalizing some code. The code change centers on how CSS style strings are converted into a JavaScript/React-compatible style object.

  • 3.1.2

    Release 3.1.2 is primarily a dependency update. The release notes only mention updating `property-information`, but the actual diff also updates other tooling dependencies and refreshes README assets/links.

  • 3.1.1

    Release 3.1.1 updates the `style-to-object` dependency and refactors internal type documentation to use `@import` statements. It also adds declaration maps (via TypeScript `declarationMap`) to improve type debugging in editors.

  • 3.1.0

    Release 3.1.0 adds a new `tableCellAlignToStyle` configuration option. The code changes convert obsolete `align` attributes on `td` and `th` into a CSS-style `style` object with `textAlign` (or `text-align` when `stylePropertyNameCase: 'css'`).

    Features
  • 3.0.0

    hast-util-to-estree 3.0.0 is a major release that drops support for Node < 16 and switches the package to use an `exports` entrypoint. The release notes also mention improved error reporting for invalid `style` attributes and updates to `@types/hast`.

    Breaking
  • 2.3.3

    Release 2.3.3 contains no described code-level changes beyond a note that it is the same as 2.3.2, but with missing generated types. The provided diff shows only a package.json update, primarily dependency version bumps (TypeScript, Node types, and the linter).

    Breaking
  • 2.3.2

    Release 2.3.2 is a targeted fix for how `style` properties are converted into estree nodes. Specifically, it corrects the AST output when CSS property names are not valid JavaScript identifiers.

    Breaking
  • 2.3.1

    Version 2.3.1 makes a targeted fix to table whitespace handling by updating which table-related elements are treated as “table elements”. The release notes only mention removal of `th` and `td` from that set.

    Breaking
  • 2.3.0

    Release 2.3.0 adds configurable casing behavior for how hast element attributes and inline style objects are emitted into estree/JSX. It introduces options to output HTML-style attribute names and CSS-style style property names, and adds documentation about framework differences.

    Features
  • 2.2.1

    Release 2.2.1 is a small maintenance update. The release notes only mention updating the `style-to-object` dependency (commit 54952b5).