Skip to content

Commit 4cfc062

Browse files
authored
feat: Support ES2024 and regexp v flag (#575)
* feat: Support ES2024 and regexp v flag * update acorn
1 parent 114dafb commit 4cfc062

15 files changed

Lines changed: 505 additions & 12 deletions

README.md

Lines changed: 5 additions & 5 deletions
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 or 14 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) or 2023 (same as 14) to use the year-based naming.
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.
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 2022 features and partially supports ECMAScript 2023 features.
234+
Espree supports all ECMAScript 2023 features and partially supports ECMAScript 2024 features.
235235

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

238-
* [Hashbang grammar](https://github.com/tc39/proposal-hashbang)
238+
* [RegExp v flag with set notation + properties of strings](https://github.com/tc39/proposal-regexp-v-flag)
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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const SUPPORTED_VERSIONS = [
1818
11, // 2020
1919
12, // 2021
2020
13, // 2022
21-
14 // 2023
21+
14, // 2023
22+
15 // 2024
2223
];
2324

2425
/**

package.json

Lines changed: 1 addition & 1 deletion
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.8.0",
35+
"acorn": "^8.9.0",
3636
"acorn-jsx": "^5.3.2",
3737
"eslint-visitor-keys": "^3.4.1"
3838
},
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
2-
"index": 4,
2+
"index": 10,
33
"lineNumber": 1,
4-
"column": 5,
5-
"message": "Cannot use new with import()"
4+
"column": 11,
5+
"message": "Unexpected token ("
66
};
Lines changed: 6 additions & 0 deletions
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: /[A&&&]/: Invalid character in character class"
6+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const re1 = /[A&&&]/v;
Lines changed: 6 additions & 0 deletions
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: /[^\\q{abc}]/: Negated character class may contain strings"
6+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const re1 = /[^\q{abc}]/v
Lines changed: 6 additions & 0 deletions
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: /\\P{Basic_Emoji}/: Invalid property name"
6+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const re1 = /\P{Basic_Emoji}/v

0 commit comments

Comments
 (0)