Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support ES2024 and regexp v flag #575

Merged
merged 2 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message is kind of misleading as all the flags are valid regex flags but the combination (uv) is invalid. Nothing we can do about it in espree, though.

};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const re1 = /[A&&B]/uv;