Skip to content

Commit 1d94b91

Browse files
committed
Refactor docs
1 parent 13da6ad commit 1d94b91

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

readme.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ If you have code, use something like [SWC][] or [esbuild][] instead.
4343
## Install
4444

4545
This package is [ESM only][esm].
46-
In Node.js (version 14.14+ and 16.0+), install with [npm][]:
46+
In Node.js (version 16+), install with [npm][]:
4747

4848
```sh
4949
npm install estree-util-build-jsx
@@ -91,10 +91,10 @@ console.log(
9191

9292
```js
9393
import fs from 'node:fs/promises'
94+
import jsx from 'acorn-jsx'
9495
import {fromJs} from 'esast-util-from-js'
9596
import {buildJsx} from 'estree-util-build-jsx'
9697
import {toJs} from 'estree-util-to-js'
97-
import jsx from 'acorn-jsx'
9898

9999
const doc = String(await fs.readFile('example.jsx'))
100100

@@ -123,7 +123,7 @@ console.log(x(null, null, 1 + 1, x("self-closing"), x("x", Object.assign({
123123

124124
## API
125125

126-
This package exports the identifier [`buildJsx`][build-jsx].
126+
This package exports the identifier [`buildJsx`][api-build-jsx].
127127
There is no default export.
128128

129129
### `buildJsx(tree[, options])`
@@ -147,7 +147,7 @@ Some differences:
147147

148148
* `tree` ([`Node`][node])
149149
— tree to transform (typically [`Program`][program])
150-
* `options` ([`Options`][options], optional)
150+
* `options` ([`Options`][api-options], optional)
151151
— configuration
152152

153153
###### Returns
@@ -165,7 +165,7 @@ Configuration (TypeScript type).
165165

166166
###### `runtime`
167167

168-
Choose the [runtime][jsx-runtime] ([`Runtime`][runtime], default: `'classic'`).
168+
Choose the [runtime][jsx-runtime] ([`Runtime`][api-runtime], default: `'classic'`).
169169

170170
Comment form: `@jsxRuntime theRuntime`.
171171

@@ -249,14 +249,18 @@ tree.comments = comments
249249
## Types
250250
251251
This package is fully typed with [TypeScript][].
252-
It exports the additional type [`Options`][options] and [`Runtime`][runtime].
252+
It exports the additional type [`Options`][api-options] and
253+
[`Runtime`][api-runtime].
253254
254255
## Compatibility
255256
256-
Projects maintained by the unified collective are compatible with all maintained
257+
Projects maintained by the unified collective are compatible with maintained
257258
versions of Node.js.
258-
As of now, that is Node.js 14.14+ and 16.0+.
259-
Our projects sometimes work with older versions, but this is not guaranteed.
259+
260+
When we cut a new major release, we drop support for unmaintained versions of
261+
Node.
262+
This means we try to keep the current release line, `estree-util-build-jsx@^2`,
263+
compatible with Node.js 12.
260264
261265
## Related
262266
@@ -298,9 +302,9 @@ abide by its terms.
298302
299303
[downloads]: https://www.npmjs.com/package/estree-util-build-jsx
300304
301-
[size-badge]: https://img.shields.io/bundlephobia/minzip/estree-util-build-jsx.svg
305+
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=estree-util-build-jsx
302306
303-
[size]: https://bundlephobia.com/result?p=estree-util-build-jsx
307+
[size]: https://bundlejs.com/?q=estree-util-build-jsx
304308
305309
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
306310
@@ -346,8 +350,8 @@ abide by its terms.
346350
347351
[esbuild]: https://esbuild.github.io
348352
349-
[build-jsx]: #buildjsxtree-options
353+
[api-build-jsx]: #buildjsxtree-options
350354
351-
[options]: #options
355+
[api-options]: #options
352356
353-
[runtime]: #runtime-1
357+
[api-runtime]: #runtime-1

0 commit comments

Comments
 (0)