Skip to content

Commit 3059713

Browse files
ota-meshimdjermanovic
andauthoredJun 17, 2024··
feat: Support ES2025 and RegExp duplicate named capturing groups (#608)
* feat: Support ES2025 and RegExp duplicate named capturing groups * update readme * Update README.md Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> --------- Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
1 parent 821b331 commit 3059713

13 files changed

+433
-10
lines changed
 

‎README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ const options = {
140140
// create a top-level tokens array containing all tokens
141141
tokens: false,
142142

143-
// Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14 or 15 to specify the version of ECMAScript syntax you want to use.
144-
// You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023 (same as 14) or 2024 (same as 15) to use the year-based naming.
143+
// Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 or 16 to specify the version of ECMAScript syntax you want to use.
144+
// You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023 (same as 14), 2024 (same as 15) or 2025 (same as 16) to use the year-based naming.
145145
// You can also set "latest" to use the most recently supported version.
146146
ecmaVersion: 3,
147147

@@ -231,11 +231,11 @@ We are building on top of Acorn, however, so that we can contribute back and hel
231231

232232
### What ECMAScript features do you support?
233233

234-
Espree supports all ECMAScript 2023 features and partially supports ECMAScript 2024 features.
234+
Espree supports all ECMAScript 2024 features and partially supports ECMAScript 2025 features.
235235

236-
Because ECMAScript 2024 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
236+
Because ECMAScript 2025 is still under development, we are implementing features as they are finalized. Currently, Espree supports:
237237

238-
* [RegExp v flag with set notation + properties of strings](https://github.com/tc39/proposal-regexp-v-flag)
238+
* [RegExp Duplicate named capturing groups](https://github.com/tc39/proposal-duplicate-named-capturing-groups)
239239

240240
See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized.
241241

‎lib/options.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ const SUPPORTED_VERSIONS = [
1919
12, // 2021
2020
13, // 2022
2121
14, // 2023
22-
15 // 2024
22+
15, // 2024
23+
16 // 2025
2324
];
2425

2526
/**

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"funding": "https://opencollective.com/eslint",
3333
"license": "BSD-2-Clause",
3434
"dependencies": {
35-
"acorn": "^8.11.3",
35+
"acorn": "^8.12.0",
3636
"acorn-jsx": "^5.3.2",
3737
"eslint-visitor-keys": "^4.0.0"
3838
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
"index": 13,
3+
"lineNumber": 1,
4+
"column": 14,
5+
"message": "Invalid regular expression: /(?<x>a)|(?<x>b)(?<x>c)/: Duplicate capture group name"
6+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const re1 = /(?<x>a)|(?<x>b)(?<x>c)/;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
"index": 13,
3+
"lineNumber": 1,
4+
"column": 14,
5+
"message": "Invalid regular expression: /(?<x>a)(?:(?<x>b)|(?<x>c))/: Duplicate capture group name"
6+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const re1 = /(?<x>a)(?:(?<x>b)|(?<x>c))/;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
"index": 13,
3+
"lineNumber": 1,
4+
"column": 14,
5+
"message": "Invalid regular expression: /(?<x>a)(?<x>b)/: Duplicate capture group name"
6+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const re1 = /(?<x>a)(?<x>b)/;

0 commit comments

Comments
 (0)
Please sign in to comment.