oxc/npm/oxc-parser
oxc-bot 6c01fd7480
release(crates): v0.30.5 (#6163)
## [0.30.5] - 2024-09-29

### Features

- 15552ac napi/transform: Display semantic error (#6160) (Boshen)
- f50fdcd napi/transform: Make react refresh option take a boolean
(#6146) (Boshen)

### Bug Fixes

- f27d59f napi/transform: Remove confusing `jsx` option (#6159) (Boshen)
- bfd1988 transformer/react: Should not collect use-hooks if it's a
nested member expression (#6143) (Dunqing)

### Refactor

- ab187d1 codegen: Restrict visibility of internal methods (#6145)
(DonIsaac)
- 375bebe transformer: Improve parsing React pragmas (#6138)
(overlookmotel)
- 0836f6b transformer: Move parsing pragmas into TS transform (#6137)
(overlookmotel)
- 30424fa transformer: TS transforms only store options they need
(#6135) (overlookmotel)

---------

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-29 15:20:19 +08:00
..
scripts chore: use dprint to format js, json and markdown 2024-09-08 13:24:58 +08:00
CHANGELOG.md release(oxc): crates v0.28.0 (#5696) 2024-09-11 17:57:55 +08:00
package.json release(crates): v0.30.5 (#6163) 2024-09-29 15:20:19 +08:00
README.md chore: use dprint to format js, json and markdown 2024-09-08 13:24:58 +08:00

The JavaScript Oxidation Compiler

See index.d.ts for parseSync and parseAsync API.

ESM

import assert from 'assert';
import oxc from 'oxc-parser';

function test(ret) {
  const program = JSON.parse(ret.program);
  assert(program.body.length == 1);
  assert(ret.errors.length == 0);
}

const sourceText = "let foo: Foo = 'foo';";
const options = {
  sourceFilename: 'text.tsx', // the extension is used to determine which dialect to parse
};

test(oxc.parseSync(sourceText, options));

async function main() {
  test(await oxc.parseAsync(sourceText, options));
}

main();