diff --git a/dev/lib/syntax.js b/dev/lib/syntax.js index 823e4f5..65ea8ee 100644 --- a/dev/lib/syntax.js +++ b/dev/lib/syntax.js @@ -13,7 +13,7 @@ * @property {Acorn} acorn * Acorn parser to use (required). * @property {AcornOptions | null | undefined} [acornOptions] - * Configuration for acorn (default: `{ecmaVersion: 2020, locations: true, + * Configuration for acorn (default: `{ecmaVersion: 2024, locations: true, * sourceType: 'module'}`); all fields except `locations` can be set. * @property {boolean | null | undefined} [addResult=false] * Whether to add `estree` fields to tokens with results from acorn @@ -57,8 +57,9 @@ export function mdxjsEsm(options) { const acorn = options.acorn const acornOptions = Object.assign( - {ecmaVersion: 2020, sourceType: 'module'}, - options.acornOptions + {ecmaVersion: 2024, sourceType: 'module'}, + options.acornOptions, + {locations: true} ) return { diff --git a/readme.md b/readme.md index afa75b7..29b6ddf 100644 --- a/readme.md +++ b/readme.md @@ -139,7 +139,7 @@ Configuration (TypeScript type). * `acorn` ([`Acorn`][acorn], required) — acorn parser to use * `acornOptions` ([`AcornOptions`][acorn-options], default: - `{ecmaVersion: 2020, locations: true, sourceType: 'module'}`) + `{ecmaVersion: 2024, locations: true, sourceType: 'module'}`) — configuration for acorn; all fields except `locations` can be set * `addResult` (`boolean`, default: `false`) — whether to add `estree` fields to tokens with results from acorn