Skip to content

Commit 4a6dee1

Browse files
authored
fix(no-unsupported-features/es-syntax): Promise.withResolvers is supported since Node.js 22.0.0 (#577)
1 parent f1d47af commit 4a6dee1

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

‎lib/rules/no-unsupported-features/es-syntax.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@
437437
"supported": ">=10.0.0"
438438
},
439439
"no-promise-withresolvers": {
440-
"supported": ">=22.11.0"
440+
"supported": ">=22.0.0"
441441
},
442442
"no-promise": {
443443
"supported": ">=0.12.0"

‎tests/lib/rules/no-unsupported-features/es-syntax.js‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3111,6 +3111,34 @@ runTests([
31113111
],
31123112
},
31133113
//----------------------------------------------------------------------
3114+
// ES2024
3115+
//----------------------------------------------------------------------
3116+
{
3117+
keyword: "promiseWithresolvers",
3118+
valid: [
3119+
{
3120+
code: "Promise.withResolvers()",
3121+
options: [{ version: "22.0.0" }],
3122+
},
3123+
],
3124+
invalid: [
3125+
{
3126+
code: "Promise.withResolvers()",
3127+
options: [{ version: "21.7.3" }],
3128+
errors: [
3129+
{
3130+
messageId: "not-supported-till",
3131+
data: {
3132+
featureName: "promise-withresolvers",
3133+
supported: ">=22.0.0",
3134+
version: "21.7.3",
3135+
},
3136+
},
3137+
],
3138+
},
3139+
],
3140+
},
3141+
//----------------------------------------------------------------------
31143142
// MISC
31153143
//----------------------------------------------------------------------
31163144
{

0 commit comments

Comments
 (0)