diff --git a/acorn/README.md b/acorn/README.md index cfc51b384..f7ff96624 100644 --- a/acorn/README.md +++ b/acorn/README.md @@ -50,12 +50,11 @@ Options are provided by in a second argument, which should be an object containing any of these fields (only `ecmaVersion` is required): -- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be - either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 (2019), - 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` (the - latest the library supports). This influences support for strict - mode, the set of reserved words, and support for new syntax - features. +- **ecmaVersion**: Indicates the ECMAScript version to parse. Can be a + number, either in year (`2022`) or plain version number (`6`) form, + or `"latest"` (the latest the library supports). This influences + support for strict mode, the set of reserved words, and support for + new syntax features. **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being implemented by Acorn. Other proposed new features must be diff --git a/acorn/src/acorn.d.ts b/acorn/src/acorn.d.ts index cf72b3704..71b37916e 100644 --- a/acorn/src/acorn.d.ts +++ b/acorn/src/acorn.d.ts @@ -573,16 +573,15 @@ export function tokenizer(input: string, options: Options): { [Symbol.iterator](): Iterator } -export type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | "latest" +export type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | "latest" export interface Options { /** - * `ecmaVersion` indicates the ECMAScript version to parse. Must be - * either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10 - * (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"` - * (the latest version the library supports). This influences - * support for strict mode, the set of reserved words, and support - * for new syntax features. + * `ecmaVersion` indicates the ECMAScript version to parse. Can be a + * number, either in year (`2022`) or plain version number (`6`) form, + * or `"latest"` (the latest the library supports). This influences + * support for strict mode, the set of reserved words, and support for + * new syntax features. */ ecmaVersion: ecmaVersion