Skip to content

Commit

Permalink
feat: Support ES2024 and regexp v flag (#575)
Browse files Browse the repository at this point in the history
* feat: Support ES2024 and regexp v flag

* update acorn
  • Loading branch information
ota-meshi authored Jun 19, 2023
1 parent 114dafb commit 4cfc062
Show file tree
Hide file tree
Showing 15 changed files with 505 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ const options = {
// create a top-level tokens array containing all tokens
tokens: false,

// 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.
// 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.
// 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.
// 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.
// You can also set "latest" to use the most recently supported version.
ecmaVersion: 3,

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

### What ECMAScript features do you support?

Espree supports all ECMAScript 2022 features and partially supports ECMAScript 2023 features.
Espree supports all ECMAScript 2023 features and partially supports ECMAScript 2024 features.

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

* [Hashbang grammar](https://github.com/tc39/proposal-hashbang)
* [RegExp v flag with set notation + properties of strings](https://github.com/tc39/proposal-regexp-v-flag)

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

Expand Down
3 changes: 2 additions & 1 deletion lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const SUPPORTED_VERSIONS = [
11, // 2020
12, // 2021
13, // 2022
14 // 2023
14, // 2023
15 // 2024
];

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"funding": "https://opencollective.com/eslint",
"license": "BSD-2-Clause",
"dependencies": {
"acorn": "^8.8.0",
"acorn": "^8.9.0",
"acorn-jsx": "^5.3.2",
"eslint-visitor-keys": "^3.4.1"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
"index": 4,
"index": 10,
"lineNumber": 1,
"column": 5,
"message": "Cannot use new with import()"
"column": 11,
"message": "Unexpected token ("
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 13,
"lineNumber": 1,
"column": 14,
"message": "Invalid regular expression: /[A&&&]/: Invalid character in character class"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const re1 = /[A&&&]/v;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 13,
"lineNumber": 1,
"column": 14,
"message": "Invalid regular expression: /[^\\q{abc}]/: Negated character class may contain strings"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const re1 = /[^\q{abc}]/v
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 13,
"lineNumber": 1,
"column": 14,
"message": "Invalid regular expression: /\\P{Basic_Emoji}/: Invalid property name"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const re1 = /\P{Basic_Emoji}/v
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
"index": 13,
"lineNumber": 1,
"column": 14,
"message": "Invalid regular expression flag"
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const re1 = /[A&&B]/uv;
Loading

0 comments on commit 4cfc062

Please sign in to comment.