From 5826877f7b33548e5ba984878dd4a8eac8448f87 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Tue, 18 Mar 2025 08:02:44 +0000 Subject: [PATCH 01/19] docs: Update README sponsors --- README.md | 2 +- packages/eslint-scope/README.md | 2 +- packages/eslint-visitor-keys/README.md | 2 +- packages/espree/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 116a62e5..4e7ee5c5 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite JetBrains Liftoff StackBlitz

Bronze Sponsors

+

Vite Liftoff StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index 2896d81e..8b0d8a97 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -101,7 +101,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite JetBrains Liftoff StackBlitz

Bronze Sponsors

+

Vite Liftoff StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index 3bb0e93b..2c3f8ecd 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -112,7 +112,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite JetBrains Liftoff StackBlitz

Bronze Sponsors

+

Vite Liftoff StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. diff --git a/packages/espree/README.md b/packages/espree/README.md index 22e3c7e8..eb2595e0 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -255,7 +255,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite JetBrains Liftoff StackBlitz

Bronze Sponsors

+

Vite Liftoff StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. From ed2f030cff89d4b468e8efa838a0c460a685c784 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Tue, 1 Apr 2025 08:02:40 +0000 Subject: [PATCH 02/19] docs: Update README sponsors --- README.md | 4 ++-- packages/eslint-scope/README.md | 4 ++-- packages/eslint-visitor-keys/README.md | 4 ++-- packages/espree/README.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4e7ee5c5..deb49734 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

+

Qlty Software trunk.io

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index 8b0d8a97..b4e1d024 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -100,9 +100,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

+

Qlty Software trunk.io

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index 2c3f8ecd..b8c11b61 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -111,9 +111,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

+

Qlty Software trunk.io

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/espree/README.md b/packages/espree/README.md index eb2595e0..c9fa0ee2 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -254,9 +254,9 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io Shopify

Silver Sponsors

+

Qlty Software trunk.io

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

From 36ece38bc6ddb88ad5f6f997a46d97168c558d9e Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Thu, 3 Apr 2025 08:02:32 +0000 Subject: [PATCH 03/19] docs: Update README sponsors --- README.md | 2 +- packages/eslint-scope/README.md | 2 +- packages/eslint-visitor-keys/README.md | 2 +- packages/espree/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index deb49734..26ddebd1 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

-

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index b4e1d024..01084192 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -102,7 +102,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

-

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index b8c11b61..4b817045 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -113,7 +113,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

-

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/espree/README.md b/packages/espree/README.md index c9fa0ee2..971e2e7f 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -256,7 +256,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

-

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

From 2800ec840bfe811e3def5b1a6e15828031cf8fbf Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Sat, 5 Apr 2025 08:02:23 +0000 Subject: [PATCH 04/19] docs: Update README sponsors --- README.md | 2 +- packages/eslint-scope/README.md | 2 +- packages/eslint-visitor-keys/README.md | 2 +- packages/espree/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 26ddebd1..4e7ee5c5 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io

Silver Sponsors

+

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index 01084192..8b0d8a97 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -100,7 +100,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io

Silver Sponsors

+

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index 4b817045..2c3f8ecd 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -111,7 +111,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io

Silver Sponsors

+

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

diff --git a/packages/espree/README.md b/packages/espree/README.md index 971e2e7f..eb2595e0 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -254,7 +254,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

-

Qlty Software trunk.io

Silver Sponsors

+

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

From cb3b0d11a16a0addc9e6632472f989316493a518 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Tue, 15 Apr 2025 08:02:41 +0000 Subject: [PATCH 05/19] docs: Update README sponsors --- README.md | 2 +- packages/eslint-scope/README.md | 2 +- packages/eslint-visitor-keys/README.md | 2 +- packages/espree/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4e7ee5c5..9a611b60 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff StackBlitz

Bronze Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index 8b0d8a97..ddd0b60e 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -101,7 +101,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff StackBlitz

Bronze Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index 2c3f8ecd..feb3c177 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -112,7 +112,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff StackBlitz

Bronze Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. diff --git a/packages/espree/README.md b/packages/espree/README.md index eb2595e0..d256f719 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -255,7 +255,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff StackBlitz

Bronze Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. From b66adb97f296764d2d9290d7f13aa9c2cfeff4b8 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Wed, 16 Apr 2025 08:02:56 +0000 Subject: [PATCH 06/19] docs: Update README sponsors --- README.md | 3 ++- packages/eslint-scope/README.md | 3 ++- packages/eslint-visitor-keys/README.md | 3 ++- packages/espree/README.md | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9a611b60..e51bd97a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ We work hard to ensure that the packages inside this repository are safe for eve The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) to get your logo on our READMEs and [website](https://eslint.org/sponsors). -

Platinum Sponsors

+

Diamond Sponsors

+

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index ddd0b60e..5d116b61 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -98,7 +98,8 @@ ESLint Scope is licensed under a permissive BSD 2-clause license. The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) to get your logo on our READMEs and [website](https://eslint.org/sponsors). -

Platinum Sponsors

+

Diamond Sponsors

+

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index feb3c177..aee362d1 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -109,7 +109,8 @@ Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer- The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) to get your logo on our READMEs and [website](https://eslint.org/sponsors). -

Platinum Sponsors

+

Diamond Sponsors

+

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

diff --git a/packages/espree/README.md b/packages/espree/README.md index d256f719..137b40ca 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -252,7 +252,8 @@ In general, we do not support experimental JavaScript features. We may make exce The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) to get your logo on our READMEs and [website](https://eslint.org/sponsors). -

Platinum Sponsors

+

Diamond Sponsors

+

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

From 308e23976b03d5fa1370461b83112207345f9b66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A3=A8=EB=B0=80LuMir?= Date: Mon, 28 Apr 2025 23:15:06 +0900 Subject: [PATCH 07/19] chore: move CLI test tools to root level and update `package.json` files (#650) --- package.json | 2 ++ packages/eslint-scope/package.json | 9 ++++++--- packages/eslint-visitor-keys/package.json | 11 ++++++----- packages/espree/package.json | 10 ++++++---- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 5e715a54..9ab83203 100644 --- a/package.json +++ b/package.json @@ -22,12 +22,14 @@ ] }, "devDependencies": { + "c8": "^10.1.3", "eslint": "^9.11.1", "eslint-config-eslint": "^11.0.0", "eslint-plugin-chai-friendly": "^1.0.0", "globals": "^15.1.0", "got": "^14.4.1", "lint-staged": "^15.2.0", + "mocha": "^11.1.0", "yorkie": "^2.0.0" } } diff --git a/packages/eslint-scope/package.json b/packages/eslint-scope/package.json index 5d7a1977..9186bb8d 100644 --- a/packages/eslint-scope/package.json +++ b/packages/eslint-scope/package.json @@ -15,8 +15,13 @@ "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "repository": "eslint/js", + "repository": { + "type": "git", + "url": "https://github.com/eslint/js.git", + "directory": "packages/eslint-scope" + }, "funding": "https://opencollective.com/eslint", + "keywords": ["eslint"], "bugs": { "url": "https://github.com/eslint/js/issues" }, @@ -45,12 +50,10 @@ }, "devDependencies": { "@typescript-eslint/parser": "^8.7.0", - "c8": "^7.7.3", "chai": "^4.3.4", "eslint-release": "^3.2.0", "eslint-visitor-keys": "^4.2.0", "espree": "^10.3.0", - "mocha": "^9.0.1", "npm-license": "^0.3.3", "rollup": "^2.52.7", "shelljs": "^0.8.5", diff --git a/packages/eslint-visitor-keys/package.json b/packages/eslint-visitor-keys/package.json index 4dc2123d..46d373d8 100644 --- a/packages/eslint-visitor-keys/package.json +++ b/packages/eslint-visitor-keys/package.json @@ -29,12 +29,9 @@ "@types/estree": "^0.0.51", "@types/estree-jsx": "^0.0.1", "@typescript-eslint/parser": "^8.7.0", - "c8": "^7.11.0", - "chai": "^4.3.6", "eslint-release": "^3.2.0", "esquery": "^1.4.0", "json-diff": "^0.7.3", - "mocha": "^9.2.1", "opener": "^1.5.2", "rollup": "^4.22.4", "rollup-plugin-dts": "^6.1.1", @@ -55,9 +52,13 @@ "test:open-coverage": "c8 report --reporter lcov && opener coverage/lcov-report/index.html", "test:types": "tsd" }, - "repository": "eslint/js", + "repository": { + "type": "git", + "url": "https://github.com/eslint/js.git", + "directory": "packages/eslint-visitor-keys" + }, "funding": "https://opencollective.com/eslint", - "keywords": [], + "keywords": ["eslint"], "author": "Toru Nagashima (https://github.com/mysticatea)", "license": "Apache-2.0", "bugs": { diff --git a/packages/espree/package.json b/packages/espree/package.json index ca08d881..3fce9b53 100644 --- a/packages/espree/package.json +++ b/packages/espree/package.json @@ -25,7 +25,11 @@ "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "repository": "eslint/js", + "repository": { + "type": "git", + "url": "https://github.com/eslint/js.git", + "directory": "packages/espree" + }, "bugs": { "url": "https://github.com/eslint/js/issues" }, @@ -40,10 +44,8 @@ "@rollup/plugin-commonjs": "^28.0.0", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.3.0", - "c8": "^7.11.0", "eslint-release": "^3.2.0", "esprima-fb": "^8001.2001.0-dev-harmony-fb", - "mocha": "^9.2.2", "npm-run-all2": "^6.2.2", "rollup": "^2.79.1", "shelljs": "^0.8.5" @@ -70,6 +72,6 @@ "release:publish": "eslint-publish-release", "test": "npm-run-all -s test:*", "test:cjs": "mocha --color --reporter progress --timeout 30000 tests/lib/commonjs.cjs", - "test:esm": "c8 mocha --color --reporter progress --timeout 30000 'tests/lib/**/*.js'" + "test:esm": "c8 mocha --color --reporter progress --timeout 30000 tests/lib/**/*.js" } } From aac1fc214f7a5d3d6320b10137d15c46c0aaee91 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Wed, 30 Apr 2025 08:03:02 +0000 Subject: [PATCH 08/19] docs: Update README sponsors --- README.md | 2 +- packages/eslint-scope/README.md | 2 +- packages/eslint-visitor-keys/README.md | 2 +- packages/espree/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e51bd97a..755eebdf 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Vite Liftoff American Express

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index 5d116b61..f1355d3c 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -102,7 +102,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Vite Liftoff American Express

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index aee362d1..9bd06c5f 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -113,7 +113,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Vite Liftoff American Express

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. diff --git a/packages/espree/README.md b/packages/espree/README.md index 137b40ca..0010b0f0 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -256,7 +256,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Vite Liftoff American Express

Bronze Sponsors

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. From 15e69f68cc4966a195c38ccebd954be4bac70906 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Thu, 1 May 2025 08:02:39 +0000 Subject: [PATCH 09/19] docs: Update README sponsors --- README.md | 2 +- packages/eslint-scope/README.md | 2 +- packages/eslint-visitor-keys/README.md | 2 +- packages/espree/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 755eebdf..83d788d8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index f1355d3c..39aaf2b5 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -103,7 +103,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index 9bd06c5f..7da712e2 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -114,7 +114,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/espree/README.md b/packages/espree/README.md index 0010b0f0..01aa79b9 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -257,7 +257,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

From d615b41792c1517e9475f02b091ad03d9a9d1838 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Fri, 2 May 2025 08:02:47 +0000 Subject: [PATCH 10/19] docs: Update README sponsors --- README.md | 4 ++-- packages/eslint-scope/README.md | 4 ++-- packages/eslint-visitor-keys/README.md | 4 ++-- packages/espree/README.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 83d788d8..bdedafc7 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express

Bronze Sponsors

-

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index 39aaf2b5..e7b8d4b0 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -102,8 +102,8 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express

Bronze Sponsors

-

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index 7da712e2..3fd66fc6 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -113,8 +113,8 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express

Bronze Sponsors

-

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/espree/README.md b/packages/espree/README.md index 01aa79b9..8e5abd64 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -256,8 +256,8 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

-

Vite Liftoff American Express

Bronze Sponsors

-

Cybozu Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

From 5d2a5cae3865b733916d63119fbd0e38df2b4da6 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Sat, 3 May 2025 08:02:25 +0000 Subject: [PATCH 11/19] docs: Update README sponsors --- README.md | 2 +- packages/eslint-scope/README.md | 2 +- packages/eslint-visitor-keys/README.md | 2 +- packages/espree/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bdedafc7..e51bd97a 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index e7b8d4b0..5d116b61 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -103,7 +103,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index 3fd66fc6..aee362d1 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -114,7 +114,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/espree/README.md b/packages/espree/README.md index 8e5abd64..137b40ca 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -257,7 +257,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

From bbce987701639ddd35c5bb63c7ef4ca319673ab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=A3=A8=EB=B0=80LuMir?= Date: Wed, 7 May 2025 20:57:34 +0900 Subject: [PATCH 12/19] ci: run tests in Node.js 24 (#652) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3f3af69..121d264c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node: [23.x, 22.x, 21.x, 20.x, 18.x, "18.18.0"] + node: [24.x, 22.x, 20.x, 18.x, "18.18.0"] include: - os: windows-latest node: "lts/*" From eb0c9c90c318ee660a5e94246a07199c7751f674 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Sat, 10 May 2025 08:02:28 +0000 Subject: [PATCH 13/19] docs: Update README sponsors --- README.md | 2 +- packages/eslint-scope/README.md | 2 +- packages/eslint-visitor-keys/README.md | 2 +- packages/espree/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e51bd97a..6cb09840 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The following companies, organizations, and individuals support ESLint's ongoing to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Diamond Sponsors

-

AG Grid

Platinum Sponsors

+

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index 5d116b61..533583cf 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -99,7 +99,7 @@ The following companies, organizations, and individuals support ESLint's ongoing to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Diamond Sponsors

-

AG Grid

Platinum Sponsors

+

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index aee362d1..b68c824f 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -110,7 +110,7 @@ The following companies, organizations, and individuals support ESLint's ongoing to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Diamond Sponsors

-

AG Grid

Platinum Sponsors

+

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

diff --git a/packages/espree/README.md b/packages/espree/README.md index 137b40ca..e8ae4312 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -253,7 +253,7 @@ The following companies, organizations, and individuals support ESLint's ongoing to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Diamond Sponsors

-

AG Grid

Platinum Sponsors

+

AG Grid

Platinum Sponsors

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

From dd104eb3f9d8129be4c40a074e5108c944710438 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Fri, 23 May 2025 14:50:22 -0400 Subject: [PATCH 14/19] docs: Add API docs to README (#654) * docs: Add API docs to README fixes #653 * Update packages/eslint-scope/README.md Co-authored-by: Nitin Kumar * Update packages/eslint-scope/README.md Co-authored-by: Nitin Kumar * Apply suggestions * Update packages/eslint-scope/README.md Co-authored-by: Milos Djermanovic * Update packages/eslint-scope/README.md Co-authored-by: Milos Djermanovic * Update packages/eslint-scope/README.md Co-authored-by: Milos Djermanovic --------- Co-authored-by: Nitin Kumar Co-authored-by: Milos Djermanovic --- packages/eslint-scope/README.md | 89 +++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index 533583cf..c0ae4fe6 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -74,6 +74,95 @@ estraverse.traverse(ast, { }); ``` +## API + +The following section describes the API for this package. You can also read [the docs](https://eslint.org/docs/latest/extend/scope-manager-interface). + +### ScopeManager + +The `ScopeManager` class is at the core of eslint-scope and is returned when you call `eslintScope.analyze()`. It manages all scopes in a given AST. + +#### Properties + +- `scopes` - An array of all scopes. +- `globalScope` - Reference to the global scope. + +#### Methods + +- **`acquire(node, inner)`** + Acquires the appropriate scope for a given node. + - `node` - The AST node to acquire the scope from. + - `inner` - Optional boolean. When `true`, returns the innermost scope, otherwise returns the outermost scope. Default is `false`. + - Returns: The acquired scope or `null` if no scope is found. + +- **`acquireAll(node)`** + Acquires all scopes for a given node. + - `node` - The AST node to acquire scopes from. + - Returns: An array of scopes or `undefined` if none are found. + +- **`release(node, inner)`** + Returns the upper scope for a given node. + - `node` - The AST node to release. + - `inner` - Optional boolean. When `true`, returns the innermost upper scope, otherwise returns the outermost upper scope. Default is `false`. + - Returns: The upper scope or `null` if no upper scope exists. + +- **`getDeclaredVariables(node)`** + Get variables that are declared by the node. + - `node` - The AST node to get declarations from. + - Returns: An array of variable objects declared by the node. If the node doesn't declare any variables, it returns an empty array. + +- **`isGlobalReturn()`** + Determines if the global return statement should be allowed. + - Returns: `true` if the global return is enabled. + +- **`isModule()`** + Checks if the code should be handled as an ECMAScript module. + - Returns: `true` if the sourceType is "module". + +- **`isImpliedStrict()`** + Checks if implied strict mode is enabled. + - Returns: `true` if implied strict mode is enabled. + +- **`isStrictModeSupported()`** + Checks if strict mode is supported based on ECMAScript version. + - Returns: `true` if the ECMAScript version supports strict mode. + +### Scope Objects + +Scopes returned by the ScopeManager methods have the following properties: + +- `type` - The type of scope (e.g., "function", "block", "global"). +- `variables` - Array of variables declared in this scope. +- `set` - A Map of variable names to Variable objects for variables declared in this scope. +- `references` - Array of references in this scope. +- `through` - Array of references in this scope and its child scopes that aren't resolved in this scope or its child scopes. +- `variableScope` - Reference to the closest variable scope. +- `upper` - Reference to the parent scope. +- `childScopes` - Array of child scopes. +- `block` - The AST node that created this scope. + +### GlobalScope + +The `GlobalScope` class is a specialized scope representing the global execution context. It extends the base `Scope` class with additional functionality for handling implicitly defined global variables. + +#### Properties + +- **`implicit`** - Tracks implicitly defined global variables (those used without declaration). + - `set` - A Map of variable names to Variable objects for implicitly defined globals. + - `variables` - Array of implicit global Variable objects. + - `left` - Array of References that need to be linked to the variable they refer to. + +### Variable Objects + +Each variable object has the following properties: + +- `name` - The variable name. +- `identifiers` - Array of identifier nodes declaring this variable. +- `references` - Array of references to this variable. +- `defs` - Array of definition objects for this variable. +- `scope` - The scope object where this variable is defined. + + ## Contributing Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/js/issues). From b847f35787d4bf2ec68163f45f3e4dc2d209eee8 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Sat, 24 May 2025 08:02:30 +0000 Subject: [PATCH 15/19] docs: Update README sponsors --- packages/eslint-scope/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index c0ae4fe6..69ab25dd 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -162,7 +162,6 @@ Each variable object has the following properties: - `defs` - Array of definition objects for this variable. - `scope` - The scope object where this variable is defined. - ## Contributing Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/js/issues). From dbad7d8aeab3f24253ab846f1247a33b7ddd0f19 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Fri, 6 Jun 2025 20:09:42 +0100 Subject: [PATCH 16/19] fix: order visitor keys for `ExportSpecifier` in source code order (#656) --- packages/eslint-visitor-keys/lib/visitor-keys.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-visitor-keys/lib/visitor-keys.js b/packages/eslint-visitor-keys/lib/visitor-keys.js index 41feb4b2..c891e040 100644 --- a/packages/eslint-visitor-keys/lib/visitor-keys.js +++ b/packages/eslint-visitor-keys/lib/visitor-keys.js @@ -100,8 +100,8 @@ const KEYS = { "attributes" ], ExportSpecifier: [ - "exported", - "local" + "local", + "exported" ], ExpressionStatement: [ "expression" From 796a48c801b07bcad83ce2a76a212784d951dabd Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Mon, 9 Jun 2025 08:02:56 +0000 Subject: [PATCH 17/19] docs: Update README sponsors --- README.md | 2 +- packages/eslint-scope/README.md | 2 +- packages/eslint-visitor-keys/README.md | 2 +- packages/espree/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6cb09840..5308fa4a 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Sentry Syntax Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-scope/README.md b/packages/eslint-scope/README.md index 69ab25dd..e5b6a24a 100644 --- a/packages/eslint-scope/README.md +++ b/packages/eslint-scope/README.md @@ -191,7 +191,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Sentry Syntax Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/eslint-visitor-keys/README.md b/packages/eslint-visitor-keys/README.md index b68c824f..aa860ba5 100644 --- a/packages/eslint-visitor-keys/README.md +++ b/packages/eslint-visitor-keys/README.md @@ -114,7 +114,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Sentry Syntax Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

diff --git a/packages/espree/README.md b/packages/espree/README.md index e8ae4312..e131fa18 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -257,7 +257,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).

Automattic Airbnb

Gold Sponsors

Qlty Software trunk.io Shopify

Silver Sponsors

Vite Liftoff American Express StackBlitz

Bronze Sponsors

-

Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Sentry Syntax Cybozu Anagram Solver Icons8 Discord GitBook Neko Nx Mercedes-Benz Group HeroCoders LambdaTest

Technology Sponsors

Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Netlify Algolia 1Password

From 39e086509a0164dcea960719fb9673c73452f36e Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Tue, 10 Jun 2025 00:39:01 +0900 Subject: [PATCH 18/19] feat: Add support for ES2026 `using` and `await using` declarations (#658) * feat: Add support for ES2026 `using` and `await using` declarations * Update packages/espree/README.md Co-authored-by: Milos Djermanovic * docs: update --------- Co-authored-by: Milos Djermanovic --- packages/eslint-scope/tests/using-scope.js | 69 + packages/espree/README.md | 12 +- packages/espree/docs/README.md | 12 +- packages/espree/lib/options.js | 3 +- packages/espree/package.json | 2 +- .../ecma-version/11/bigint/binary.result.js | 2 +- .../ecma-version/11/bigint/hex.result.js | 2 +- .../ecma-version/11/bigint/octal.result.js | 2 +- .../invalid-export-using.module-result.js | 6 + .../invalid-export-using.result.js | 6 + .../invalid-export-using.src.js | 1 + .../invalid-using-let.module-result.js | 6 + .../invalid-using-let.result.js | 6 + .../invalid-using-let.src.js | 1 + ...nvalid-using-with-object-pattern.result.js | 6 + .../invalid-using-with-object-pattern.src.js | 1 + ...invalid-using-without-init-multi.result.js | 6 + .../invalid-using-without-init-multi.src.js | 1 + .../invalid-using-without-init.result.js | 6 + .../invalid-using-without-init.src.js | 1 + .../valid-not-using.result.js | 1630 ++++++++++++ .../valid-not-using.src.js | 12 + ...lid-top-level-await-using.module-result.js | 258 ++ .../valid-top-level-await-using.result.js | 6 + .../valid-top-level-await-using.src.js | 1 + .../valid-top-level-using.module-result.js | 240 ++ .../valid-top-level-using.result.js | 6 + .../valid-top-level-using.src.js | 1 + .../valid-using.result.js | 2201 +++++++++++++++++ .../valid-using.src.js | 10 + .../tests/lib/supported-ecmaversions.js | 4 +- 31 files changed, 4499 insertions(+), 21 deletions(-) create mode 100644 packages/eslint-scope/tests/using-scope.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.module-result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.src.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.module-result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.src.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.src.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.src.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.src.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.src.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.module-result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.src.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.module-result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.src.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.result.js create mode 100644 packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.src.js diff --git a/packages/eslint-scope/tests/using-scope.js b/packages/eslint-scope/tests/using-scope.js new file mode 100644 index 00000000..0a6c7882 --- /dev/null +++ b/packages/eslint-scope/tests/using-scope.js @@ -0,0 +1,69 @@ +/** + * @fileoverview Tests for ES2026 `using` and `await using`. + * @author Yosuke Ota + */ + +import { expect } from "chai"; +import * as espree from "espree"; +import { analyze } from "../lib/index.js"; + +describe("`using` and `await using` block scope", () => { + it("`using` in block scope", () => { + const ast = espree.parse(` + { + using i = 42; + i; + } + `, { ecmaVersion: 2026 }); + + const scopeManager = analyze(ast, { ecmaVersion: 2026 }); + + expect(scopeManager.scopes).to.have.length(2); // Program and BlockStatement scope. + + let scope = scopeManager.scopes[0]; + + expect(scope.type).to.be.equal("global"); + expect(scope.variables).to.have.length(0); + + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal("block"); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal("i"); + expect(scope.references).to.have.length(2); + expect(scope.references[0].identifier.name).to.be.equal("i"); + expect(scope.references[1].identifier.name).to.be.equal("i"); + }); + it("`await using` in block scope", () => { + const ast = espree.parse(` + async function fn() { + { + await using i = 42; + i; + } + } + `, { ecmaVersion: 2026 }); + + const scopeManager = analyze(ast, { ecmaVersion: 2026 }); + + expect(scopeManager.scopes).to.have.length(3); // Program, Function, and BlockStatement scope. + + let scope = scopeManager.scopes[0]; + + expect(scope.type).to.be.equal("global"); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal("fn"); + + scope = scopeManager.scopes[1]; + expect(scope.type).to.be.equal("function"); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal("arguments"); + + scope = scopeManager.scopes[2]; + expect(scope.type).to.be.equal("block"); + expect(scope.variables).to.have.length(1); + expect(scope.variables[0].name).to.be.equal("i"); + expect(scope.references).to.have.length(2); + expect(scope.references[0].identifier.name).to.be.equal("i"); + expect(scope.references[1].identifier.name).to.be.equal("i"); + }); +}); diff --git a/packages/espree/README.md b/packages/espree/README.md index e131fa18..e8e73ee5 100644 --- a/packages/espree/README.md +++ b/packages/espree/README.md @@ -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, 14, 15 or 16 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), 2024 (same as 15) or 2025 (same as 16) to use the year-based naming. + // Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 or 17 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), 2024 (same as 15), 2025 (same as 16) or 2026 (same as 17) to use the year-based naming. // You can also set "latest" to use the most recently supported version. ecmaVersion: 3, @@ -231,13 +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 2024 features and partially supports ECMAScript 2025 features. +Espree supports all ECMAScript 2025 features and partially supports ECMAScript 2026 features. -Because ECMAScript 2025 is still under development, we are implementing features as they are finalized. Currently, Espree supports: +Because ECMAScript 2026 is still under development, we are implementing features as they are finalized. Currently, Espree supports: -* [RegExp Duplicate named capturing groups](https://github.com/tc39/proposal-duplicate-named-capturing-groups) -* [RegExp Pattern modifiers](https://github.com/tc39/proposal-regexp-modifiers) -* [Import Attributes](https://github.com/tc39/proposal-import-attributes) +* [Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management) See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized. diff --git a/packages/espree/docs/README.md b/packages/espree/docs/README.md index cacb72e3..550a4975 100644 --- a/packages/espree/docs/README.md +++ b/packages/espree/docs/README.md @@ -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, 14, 15 or 16 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), 2024 (same as 15) or 2025 (same as 16) to use the year-based naming. + // Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 or 17 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), 2024 (same as 15), 2025 (same as 16) or 2026 (same as 17) to use the year-based naming. // You can also set "latest" to use the most recently supported version. ecmaVersion: 3, @@ -231,13 +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 2024 features and partially supports ECMAScript 2025 features. +Espree supports all ECMAScript 2025 features and partially supports ECMAScript 2026 features. -Because ECMAScript 2025 is still under development, we are implementing features as they are finalized. Currently, Espree supports: +Because ECMAScript 2026 is still under development, we are implementing features as they are finalized. Currently, Espree supports: -* [RegExp Duplicate named capturing groups](https://github.com/tc39/proposal-duplicate-named-capturing-groups) -* [RegExp Pattern modifiers](https://github.com/tc39/proposal-regexp-modifiers) -* [Import Attributes](https://github.com/tc39/proposal-import-attributes) +* [Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management) See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized. diff --git a/packages/espree/lib/options.js b/packages/espree/lib/options.js index 2cdfb689..85bb9029 100644 --- a/packages/espree/lib/options.js +++ b/packages/espree/lib/options.js @@ -20,7 +20,8 @@ const SUPPORTED_VERSIONS = [ 13, // 2022 14, // 2023 15, // 2024 - 16 // 2025 + 16, // 2025 + 17 // 2026 ]; /** diff --git a/packages/espree/package.json b/packages/espree/package.json index 3fce9b53..24563b1d 100644 --- a/packages/espree/package.json +++ b/packages/espree/package.json @@ -36,7 +36,7 @@ "funding": "https://opencollective.com/eslint", "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.14.0", + "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^4.2.0" }, diff --git a/packages/espree/tests/fixtures/ecma-version/11/bigint/binary.result.js b/packages/espree/tests/fixtures/ecma-version/11/bigint/binary.result.js index 28ceccf8..ad06c8b8 100644 --- a/packages/espree/tests/fixtures/ecma-version/11/bigint/binary.result.js +++ b/packages/espree/tests/fixtures/ecma-version/11/bigint/binary.result.js @@ -49,7 +49,7 @@ export default { ], "value": 0b0101n, "raw": "0b0101n", - "bigint": "0b0101" + "bigint": "5" } } ], diff --git a/packages/espree/tests/fixtures/ecma-version/11/bigint/hex.result.js b/packages/espree/tests/fixtures/ecma-version/11/bigint/hex.result.js index f491018f..c483025b 100644 --- a/packages/espree/tests/fixtures/ecma-version/11/bigint/hex.result.js +++ b/packages/espree/tests/fixtures/ecma-version/11/bigint/hex.result.js @@ -49,7 +49,7 @@ export default { ], "value": 0x80n, "raw": "0x80n", - "bigint": "0x80" + "bigint": "128" } } ], diff --git a/packages/espree/tests/fixtures/ecma-version/11/bigint/octal.result.js b/packages/espree/tests/fixtures/ecma-version/11/bigint/octal.result.js index 73ccb7ee..36bc8307 100644 --- a/packages/espree/tests/fixtures/ecma-version/11/bigint/octal.result.js +++ b/packages/espree/tests/fixtures/ecma-version/11/bigint/octal.result.js @@ -49,7 +49,7 @@ export default { ], "value": 0o755n, "raw": "0o755n", - "bigint": "0o755" + "bigint": "493" } } ], diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.module-result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.module-result.js new file mode 100644 index 00000000..814cccb6 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 7, + "lineNumber": 1, + "column": 8, + "message": "Unexpected token using" +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.result.js new file mode 100644 index 00000000..521323ed --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.result.js @@ -0,0 +1,6 @@ +export default { + "index": 0, + "lineNumber": 1, + "column": 1, + "message": "'import' and 'export' may appear only with 'sourceType: module'" +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.src.js new file mode 100644 index 00000000..f84b83dc --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-export-using.src.js @@ -0,0 +1 @@ +export using x = foo(); diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.module-result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.module-result.js new file mode 100644 index 00000000..a47cb2f1 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.module-result.js @@ -0,0 +1,6 @@ +export default { + "index": 8, + "lineNumber": 1, + "column": 9, + "message": "The keyword 'let' is reserved" +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.result.js new file mode 100644 index 00000000..638bbacf --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.result.js @@ -0,0 +1,6 @@ +export default { + "index": 8, + "lineNumber": 1, + "column": 9, + "message": "let is disallowed as a lexically bound name" +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.src.js new file mode 100644 index 00000000..09f110a6 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-let.src.js @@ -0,0 +1 @@ +{ using let = x; } diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.result.js new file mode 100644 index 00000000..946c71cf --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.result.js @@ -0,0 +1,6 @@ +export default { + "index": 8, + "lineNumber": 1, + "column": 9, + "message": "Unexpected token {" +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.src.js new file mode 100644 index 00000000..20aa7ac0 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-with-object-pattern.src.js @@ -0,0 +1 @@ +{ using {x} = obj; } diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.result.js new file mode 100644 index 00000000..3629d2bf --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.result.js @@ -0,0 +1,6 @@ +export default { + "index": 20, + "lineNumber": 1, + "column": 21, + "message": "Missing initializer in using declaration" +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.src.js new file mode 100644 index 00000000..7c9c3325 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init-multi.src.js @@ -0,0 +1 @@ +{ using x = foo(), y; } diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.result.js new file mode 100644 index 00000000..9043beaf --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.result.js @@ -0,0 +1,6 @@ +export default { + "index": 9, + "lineNumber": 1, + "column": 10, + "message": "Missing initializer in using declaration" +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.src.js new file mode 100644 index 00000000..80ea3570 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/invalid-using-without-init.src.js @@ -0,0 +1 @@ +{ using x; } diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.result.js new file mode 100644 index 00000000..133ef4da --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.result.js @@ -0,0 +1,1630 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 12, + "column": 10 + } + }, + "range": [ + 73, + 324 + ], + "body": [ + { + "type": "BlockStatement", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "range": [ + 73, + 96 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "range": [ + 75, + 94 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "range": [ + 75, + 93 + ], + "operator": "=", + "left": { + "type": "MemberExpression", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 75, + 87 + ], + "object": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 75, + 80 + ], + "name": "using" + }, + "property": { + "type": "SequenceExpression", + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 82, + 86 + ], + "expressions": [ + { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 82, + 83 + ], + "name": "a" + }, + { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 85, + 86 + ], + "name": "b" + } + ] + }, + "computed": true, + "optional": false + }, + "right": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "range": [ + 90, + 93 + ], + "name": "arr" + } + } + } + ] + }, + { + "type": "BlockStatement", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 125, + 149 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 127, + 132 + ], + "expression": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 127, + 132 + ], + "name": "using" + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 137, + 147 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 137, + 146 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 137, + 138 + ], + "name": "x" + }, + "right": { + "type": "CallExpression", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 141, + 146 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 141, + 144 + ], + "name": "foo" + }, + "arguments": [], + "optional": false + } + } + } + ] + }, + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 175, + 264 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 17 + } + }, + "range": [ + 190, + 192 + ], + "name": "fn" + }, + "expression": false, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 195, + 264 + ], + "body": [ + { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 7, + "column": 20 + } + }, + "range": [ + 201, + 235 + ], + "body": [ + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 203, + 214 + ], + "expression": { + "type": "AwaitExpression", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 203, + 214 + ], + "argument": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 209, + 214 + ], + "name": "using" + } + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 18 + } + }, + "range": [ + 223, + 233 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 223, + 232 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 223, + 224 + ], + "name": "x" + }, + "right": { + "type": "CallExpression", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 227, + 232 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 227, + 230 + ], + "name": "foo" + }, + "arguments": [], + "optional": false + } + } + } + ] + } + ] + } + }, + { + "type": "ForOfStatement", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 23 + } + }, + "range": [ + 290, + 313 + ], + "await": false, + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 5 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 295, + 300 + ], + "name": "using" + }, + "right": { + "type": "CallExpression", + "loc": { + "start": { + "line": 11, + "column": 14 + }, + "end": { + "line": 11, + "column": 19 + } + }, + "range": [ + 304, + 309 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 11, + "column": 14 + }, + "end": { + "line": 11, + "column": 17 + } + }, + "range": [ + 304, + 307 + ], + "name": "foo" + }, + "arguments": [], + "optional": false + }, + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 11, + "column": 21 + }, + "end": { + "line": 11, + "column": 23 + } + }, + "range": [ + 311, + 313 + ], + "body": [] + } + }, + { + "type": "ExpressionStatement", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 10 + } + }, + "range": [ + 314, + 324 + ], + "expression": { + "type": "AssignmentExpression", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 9 + } + }, + "range": [ + 314, + 323 + ], + "operator": "=", + "left": { + "type": "Identifier", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 314, + 319 + ], + "name": "using" + }, + "right": { + "type": "Literal", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 9 + } + }, + "range": [ + 322, + 323 + ], + "value": 5, + "raw": "5" + } + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "range": [ + 73, + 74 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "range": [ + 75, + 80 + ] + }, + { + "type": "Punctuator", + "value": "[", + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 81, + 82 + ] + }, + { + "type": "Identifier", + "value": "a", + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "range": [ + 82, + 83 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 83, + 84 + ] + }, + { + "type": "Identifier", + "value": "b", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 85, + 86 + ] + }, + { + "type": "Punctuator", + "value": "]", + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "range": [ + 86, + 87 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "range": [ + 88, + 89 + ] + }, + { + "type": "Identifier", + "value": "arr", + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "range": [ + 90, + 93 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "range": [ + 93, + 94 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "range": [ + 95, + 96 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "range": [ + 125, + 126 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "range": [ + 127, + 132 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "range": [ + 137, + 138 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "range": [ + 139, + 140 + ] + }, + { + "type": "Identifier", + "value": "foo", + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 11 + } + }, + "range": [ + 141, + 144 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + } + }, + "range": [ + 144, + 145 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "range": [ + 145, + 146 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "range": [ + 146, + 147 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "range": [ + 148, + 149 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 175, + 180 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 14 + } + }, + "range": [ + 181, + 189 + ] + }, + { + "type": "Identifier", + "value": "fn", + "loc": { + "start": { + "line": 5, + "column": 15 + }, + "end": { + "line": 5, + "column": 17 + } + }, + "range": [ + 190, + 192 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 17 + }, + "end": { + "line": 5, + "column": 18 + } + }, + "range": [ + 192, + 193 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 193, + 194 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 195, + 196 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 11 + } + }, + "range": [ + 203, + 208 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 6, + "column": 12 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 209, + 214 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 223, + 224 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 11 + } + }, + "range": [ + 225, + 226 + ] + }, + { + "type": "Identifier", + "value": "foo", + "loc": { + "start": { + "line": 7, + "column": 12 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 227, + 230 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 7, + "column": 15 + }, + "end": { + "line": 7, + "column": 16 + } + }, + "range": [ + 230, + 231 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 231, + 232 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 18 + } + }, + "range": [ + 232, + 233 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 7, + "column": 19 + }, + "end": { + "line": 7, + "column": 20 + } + }, + "range": [ + 234, + 235 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 1 + } + }, + "range": [ + 263, + 264 + ] + }, + { + "type": "Keyword", + "value": "for", + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 3 + } + }, + "range": [ + 290, + 293 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 11, + "column": 5 + } + }, + "range": [ + 294, + 295 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 11, + "column": 5 + }, + "end": { + "line": 11, + "column": 10 + } + }, + "range": [ + 295, + 300 + ] + }, + { + "type": "Identifier", + "value": "of", + "loc": { + "start": { + "line": 11, + "column": 11 + }, + "end": { + "line": 11, + "column": 13 + } + }, + "range": [ + 301, + 303 + ] + }, + { + "type": "Identifier", + "value": "foo", + "loc": { + "start": { + "line": 11, + "column": 14 + }, + "end": { + "line": 11, + "column": 17 + } + }, + "range": [ + 304, + 307 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 11, + "column": 17 + }, + "end": { + "line": 11, + "column": 18 + } + }, + "range": [ + 307, + 308 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 18 + }, + "end": { + "line": 11, + "column": 19 + } + }, + "range": [ + 308, + 309 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 11, + "column": 19 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "range": [ + 309, + 310 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 11, + "column": 21 + }, + "end": { + "line": 11, + "column": 22 + } + }, + "range": [ + 311, + 312 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 11, + "column": 22 + }, + "end": { + "line": 11, + "column": 23 + } + }, + "range": [ + 312, + 313 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "range": [ + 314, + 319 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 7 + } + }, + "range": [ + 320, + 321 + ] + }, + { + "type": "Numeric", + "value": "5", + "loc": { + "start": { + "line": 12, + "column": 8 + }, + "end": { + "line": 12, + "column": 9 + } + }, + "range": [ + 322, + 323 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 10 + } + }, + "range": [ + 323, + 324 + ] + } + ] +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.src.js new file mode 100644 index 00000000..51d65ca3 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-not-using.src.js @@ -0,0 +1,12 @@ +// For compatibility, syntax that looks like `using` but is not `using`. +{ using [a, b] = arr; } // { using[(a, b)] = arr; } +{ using + x = foo(); } // { using; x = foo(); } +async function fn() { + { await using + x = foo(); } // await using; x = foo(); +} + +// `using` identifiers. +for (using of foo()) {} +using = 5; diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.module-result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.module-result.js new file mode 100644 index 00000000..e1a0d273 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.module-result.js @@ -0,0 +1,258 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 0, + 22 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 12, + 21 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ], + "name": "y" + }, + "init": { + "type": "CallExpression", + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 16, + 21 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 16, + 19 + ], + "name": "bar" + }, + "arguments": [], + "optional": false + } + } + ], + "kind": "await using" + } + ], + "sourceType": "module", + "tokens": [ + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Identifier", + "value": "y", + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 12, + 13 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Identifier", + "value": "bar", + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 16, + 19 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "range": [ + 19, + 20 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "range": [ + 21, + 22 + ] + } + ] +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.result.js new file mode 100644 index 00000000..6d5080ee --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.result.js @@ -0,0 +1,6 @@ +export default { + "index": 0, + "lineNumber": 1, + "column": 1, + "message": "Using declaration cannot appear in the top level when source type is `script`" +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.src.js new file mode 100644 index 00000000..8256f5b0 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-await-using.src.js @@ -0,0 +1 @@ +await using y = bar(); diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.module-result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.module-result.js new file mode 100644 index 00000000..eaa34a66 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.module-result.js @@ -0,0 +1,240 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 0, + 16 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 6, + 15 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ], + "name": "x" + }, + "init": { + "type": "CallExpression", + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 10, + 15 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ], + "name": "foo" + }, + "arguments": [], + "optional": false + } + } + ], + "kind": "using" + } + ], + "sourceType": "module", + "tokens": [ + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 0, + 5 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "range": [ + 6, + 7 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 8, + 9 + ] + }, + { + "type": "Identifier", + "value": "foo", + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "range": [ + 10, + 13 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "range": [ + 13, + 14 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 15, + 16 + ] + } + ] +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.result.js new file mode 100644 index 00000000..6d5080ee --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.result.js @@ -0,0 +1,6 @@ +export default { + "index": 0, + "lineNumber": 1, + "column": 1, + "message": "Using declaration cannot appear in the top level when source type is `script`" +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.src.js new file mode 100644 index 00000000..503dc7e6 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-top-level-using.src.js @@ -0,0 +1 @@ +using x = foo(); diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.result.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.result.js new file mode 100644 index 00000000..b7b172e3 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.result.js @@ -0,0 +1,2201 @@ +export default { + "type": "Program", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 0, + 207 + ], + "body": [ + { + "type": "BlockStatement", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "range": [ + 0, + 56 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "range": [ + 6, + 22 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "range": [ + 12, + 21 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 12, + 13 + ], + "name": "x" + }, + "init": { + "type": "CallExpression", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "range": [ + 16, + 21 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "range": [ + 16, + 19 + ], + "name": "foo" + }, + "arguments": [], + "optional": false + } + } + ], + "kind": "using" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 31 + } + }, + "range": [ + 27, + 54 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "range": [ + 33, + 42 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 33, + 34 + ], + "name": "a" + }, + "init": { + "type": "CallExpression", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "range": [ + 37, + 42 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 37, + 40 + ], + "name": "foo" + }, + "arguments": [], + "optional": false + } + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 30 + } + }, + "range": [ + 44, + 53 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "range": [ + 44, + 45 + ], + "name": "b" + }, + "init": { + "type": "CallExpression", + "loc": { + "start": { + "line": 3, + "column": 25 + }, + "end": { + "line": 3, + "column": 30 + } + }, + "range": [ + 48, + 53 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 3, + "column": 25 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 48, + 51 + ], + "name": "bar" + }, + "arguments": [], + "optional": false + } + } + ], + "kind": "using" + } + ] + }, + { + "type": "ForOfStatement", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 57, + 82 + ], + "await": false, + "left": { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 62, + 69 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 68, + 69 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 68, + 69 + ], + "name": "x" + }, + "init": null + } + ], + "kind": "using" + }, + "right": { + "type": "CallExpression", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 73, + 78 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 73, + 76 + ], + "name": "foo" + }, + "arguments": [], + "optional": false + }, + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 80, + 82 + ], + "body": [] + } + }, + { + "type": "FunctionDeclaration", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 83, + 207 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 98, + 100 + ], + "name": "fn" + }, + "expression": false, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 103, + 207 + ], + "body": [ + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 26 + } + }, + "range": [ + 109, + 131 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 25 + } + }, + "range": [ + 121, + 130 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 121, + 122 + ], + "name": "x" + }, + "init": { + "type": "CallExpression", + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 25 + } + }, + "range": [ + 125, + 130 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "range": [ + 125, + 128 + ], + "name": "foo" + }, + "arguments": [], + "optional": false + } + } + ], + "kind": "await using" + }, + { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 37 + } + }, + "range": [ + 136, + 169 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 148, + 157 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 148, + 149 + ], + "name": "a" + }, + "init": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 20 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 152, + 157 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 20 + }, + "end": { + "line": 8, + "column": 23 + } + }, + "range": [ + 152, + 155 + ], + "name": "foo" + }, + "arguments": [], + "optional": false + } + }, + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 36 + } + }, + "range": [ + 159, + 168 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 28 + } + }, + "range": [ + 159, + 160 + ], + "name": "b" + }, + "init": { + "type": "CallExpression", + "loc": { + "start": { + "line": 8, + "column": 31 + }, + "end": { + "line": 8, + "column": 36 + } + }, + "range": [ + 163, + 168 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 8, + "column": 31 + }, + "end": { + "line": 8, + "column": 34 + } + }, + "range": [ + 163, + 166 + ], + "name": "bar" + }, + "arguments": [], + "optional": false + } + } + ], + "kind": "await using" + }, + { + "type": "ForOfStatement", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 35 + } + }, + "range": [ + 174, + 205 + ], + "await": false, + "left": { + "type": "VariableDeclaration", + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 179, + 192 + ], + "declarations": [ + { + "type": "VariableDeclarator", + "loc": { + "start": { + "line": 9, + "column": 21 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 191, + 192 + ], + "id": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 21 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 191, + 192 + ], + "name": "x" + }, + "init": null + } + ], + "kind": "await using" + }, + "right": { + "type": "CallExpression", + "loc": { + "start": { + "line": 9, + "column": 26 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 196, + 201 + ], + "callee": { + "type": "Identifier", + "loc": { + "start": { + "line": 9, + "column": 26 + }, + "end": { + "line": 9, + "column": 29 + } + }, + "range": [ + 196, + 199 + ], + "name": "foo" + }, + "arguments": [], + "optional": false + }, + "body": { + "type": "BlockStatement", + "loc": { + "start": { + "line": 9, + "column": 33 + }, + "end": { + "line": 9, + "column": 35 + } + }, + "range": [ + 203, + 205 + ], + "body": [] + } + } + ] + } + } + ], + "sourceType": "script", + "tokens": [ + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "range": [ + 0, + 1 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "range": [ + 6, + 11 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "range": [ + 12, + 13 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "range": [ + 14, + 15 + ] + }, + { + "type": "Identifier", + "value": "foo", + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "range": [ + 16, + 19 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "range": [ + 19, + 20 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "range": [ + 20, + 21 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "range": [ + 21, + 22 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "range": [ + 27, + 32 + ] + }, + { + "type": "Identifier", + "value": "a", + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "range": [ + 33, + 34 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "range": [ + 35, + 36 + ] + }, + { + "type": "Identifier", + "value": "foo", + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "range": [ + 37, + 40 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "range": [ + 40, + 41 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "range": [ + 41, + 42 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "range": [ + 42, + 43 + ] + }, + { + "type": "Identifier", + "value": "b", + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "range": [ + 44, + 45 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 3, + "column": 23 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "range": [ + 46, + 47 + ] + }, + { + "type": "Identifier", + "value": "bar", + "loc": { + "start": { + "line": 3, + "column": 25 + }, + "end": { + "line": 3, + "column": 28 + } + }, + "range": [ + 48, + 51 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 3, + "column": 28 + }, + "end": { + "line": 3, + "column": 29 + } + }, + "range": [ + 51, + 52 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 3, + "column": 29 + }, + "end": { + "line": 3, + "column": 30 + } + }, + "range": [ + 52, + 53 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 31 + } + }, + "range": [ + 53, + 54 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "range": [ + 55, + 56 + ] + }, + { + "type": "Keyword", + "value": "for", + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "range": [ + 57, + 60 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "range": [ + 61, + 62 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 5, + "column": 5 + }, + "end": { + "line": 5, + "column": 10 + } + }, + "range": [ + 62, + 67 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "range": [ + 68, + 69 + ] + }, + { + "type": "Identifier", + "value": "of", + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 15 + } + }, + "range": [ + 70, + 72 + ] + }, + { + "type": "Identifier", + "value": "foo", + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "range": [ + 73, + 76 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 20 + } + }, + "range": [ + 76, + 77 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 20 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "range": [ + 77, + 78 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "range": [ + 78, + 79 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 5, + "column": 23 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "range": [ + 80, + 81 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 5, + "column": 24 + }, + "end": { + "line": 5, + "column": 25 + } + }, + "range": [ + 81, + 82 + ] + }, + { + "type": "Identifier", + "value": "async", + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 5 + } + }, + "range": [ + 83, + 88 + ] + }, + { + "type": "Keyword", + "value": "function", + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 14 + } + }, + "range": [ + 89, + 97 + ] + }, + { + "type": "Identifier", + "value": "fn", + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "range": [ + 98, + 100 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 6, + "column": 17 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "range": [ + 100, + 101 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 6, + "column": 18 + }, + "end": { + "line": 6, + "column": 19 + } + }, + "range": [ + 101, + 102 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 6, + "column": 20 + }, + "end": { + "line": 6, + "column": 21 + } + }, + "range": [ + 103, + 104 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 9 + } + }, + "range": [ + 109, + 114 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 7, + "column": 10 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "range": [ + 115, + 120 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 17 + } + }, + "range": [ + 121, + 122 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 7, + "column": 18 + }, + "end": { + "line": 7, + "column": 19 + } + }, + "range": [ + 123, + 124 + ] + }, + { + "type": "Identifier", + "value": "foo", + "loc": { + "start": { + "line": 7, + "column": 20 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "range": [ + 125, + 128 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 7, + "column": 23 + }, + "end": { + "line": 7, + "column": 24 + } + }, + "range": [ + 128, + 129 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 7, + "column": 24 + }, + "end": { + "line": 7, + "column": 25 + } + }, + "range": [ + 129, + 130 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 26 + } + }, + "range": [ + 130, + 131 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 8, + "column": 4 + }, + "end": { + "line": 8, + "column": 9 + } + }, + "range": [ + 136, + 141 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 8, + "column": 10 + }, + "end": { + "line": 8, + "column": 15 + } + }, + "range": [ + 142, + 147 + ] + }, + { + "type": "Identifier", + "value": "a", + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 17 + } + }, + "range": [ + 148, + 149 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 19 + } + }, + "range": [ + 150, + 151 + ] + }, + { + "type": "Identifier", + "value": "foo", + "loc": { + "start": { + "line": 8, + "column": 20 + }, + "end": { + "line": 8, + "column": 23 + } + }, + "range": [ + 152, + 155 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 23 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "range": [ + 155, + 156 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 25 + } + }, + "range": [ + 156, + 157 + ] + }, + { + "type": "Punctuator", + "value": ",", + "loc": { + "start": { + "line": 8, + "column": 25 + }, + "end": { + "line": 8, + "column": 26 + } + }, + "range": [ + 157, + 158 + ] + }, + { + "type": "Identifier", + "value": "b", + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 8, + "column": 28 + } + }, + "range": [ + 159, + 160 + ] + }, + { + "type": "Punctuator", + "value": "=", + "loc": { + "start": { + "line": 8, + "column": 29 + }, + "end": { + "line": 8, + "column": 30 + } + }, + "range": [ + 161, + 162 + ] + }, + { + "type": "Identifier", + "value": "bar", + "loc": { + "start": { + "line": 8, + "column": 31 + }, + "end": { + "line": 8, + "column": 34 + } + }, + "range": [ + 163, + 166 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 8, + "column": 34 + }, + "end": { + "line": 8, + "column": 35 + } + }, + "range": [ + 166, + 167 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 8, + "column": 35 + }, + "end": { + "line": 8, + "column": 36 + } + }, + "range": [ + 167, + 168 + ] + }, + { + "type": "Punctuator", + "value": ";", + "loc": { + "start": { + "line": 8, + "column": 36 + }, + "end": { + "line": 8, + "column": 37 + } + }, + "range": [ + 168, + 169 + ] + }, + { + "type": "Keyword", + "value": "for", + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "range": [ + 174, + 177 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 8 + }, + "end": { + "line": 9, + "column": 9 + } + }, + "range": [ + 178, + 179 + ] + }, + { + "type": "Identifier", + "value": "await", + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 14 + } + }, + "range": [ + 179, + 184 + ] + }, + { + "type": "Identifier", + "value": "using", + "loc": { + "start": { + "line": 9, + "column": 15 + }, + "end": { + "line": 9, + "column": 20 + } + }, + "range": [ + 185, + 190 + ] + }, + { + "type": "Identifier", + "value": "x", + "loc": { + "start": { + "line": 9, + "column": 21 + }, + "end": { + "line": 9, + "column": 22 + } + }, + "range": [ + 191, + 192 + ] + }, + { + "type": "Identifier", + "value": "of", + "loc": { + "start": { + "line": 9, + "column": 23 + }, + "end": { + "line": 9, + "column": 25 + } + }, + "range": [ + 193, + 195 + ] + }, + { + "type": "Identifier", + "value": "foo", + "loc": { + "start": { + "line": 9, + "column": 26 + }, + "end": { + "line": 9, + "column": 29 + } + }, + "range": [ + 196, + 199 + ] + }, + { + "type": "Punctuator", + "value": "(", + "loc": { + "start": { + "line": 9, + "column": 29 + }, + "end": { + "line": 9, + "column": 30 + } + }, + "range": [ + 199, + 200 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 30 + }, + "end": { + "line": 9, + "column": 31 + } + }, + "range": [ + 200, + 201 + ] + }, + { + "type": "Punctuator", + "value": ")", + "loc": { + "start": { + "line": 9, + "column": 31 + }, + "end": { + "line": 9, + "column": 32 + } + }, + "range": [ + 201, + 202 + ] + }, + { + "type": "Punctuator", + "value": "{", + "loc": { + "start": { + "line": 9, + "column": 33 + }, + "end": { + "line": 9, + "column": 34 + } + }, + "range": [ + 203, + 204 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 9, + "column": 34 + }, + "end": { + "line": 9, + "column": 35 + } + }, + "range": [ + 204, + 205 + ] + }, + { + "type": "Punctuator", + "value": "}", + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 1 + } + }, + "range": [ + 206, + 207 + ] + } + ] +}; \ No newline at end of file diff --git a/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.src.js b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.src.js new file mode 100644 index 00000000..0cf5b108 --- /dev/null +++ b/packages/espree/tests/fixtures/ecma-version/17/explicit-resource-management/valid-using.src.js @@ -0,0 +1,10 @@ +{ + using x = foo(); + using a = foo(), b = bar(); +} +for (using x of foo()) {} +async function fn() { + await using x = foo(); + await using a = foo(), b = bar(); + for (await using x of foo()) {} +} diff --git a/packages/espree/tests/lib/supported-ecmaversions.js b/packages/espree/tests/lib/supported-ecmaversions.js index 107eb993..75e3f6c6 100644 --- a/packages/espree/tests/lib/supported-ecmaversions.js +++ b/packages/espree/tests/lib/supported-ecmaversions.js @@ -17,7 +17,7 @@ import * as espree from "../../espree.js"; describe("latestEcmaVersion", () => { it("should return the latest supported ecmaVersion", () => { - assert.strictEqual(espree.latestEcmaVersion, 16); + assert.strictEqual(espree.latestEcmaVersion, 17); }); }); @@ -25,7 +25,7 @@ describe("supportedEcmaVersions", () => { it("should return an array of all supported versions", () => { assert.deepStrictEqual( espree.supportedEcmaVersions, - [3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] + [3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] ); }); }); From ab3d59382b03d03a4e57def3742f94da16d88738 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 11:45:03 -0400 Subject: [PATCH 19/19] chore: release main (#657) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .release-please-manifest.json | 6 +++--- packages/eslint-scope/CHANGELOG.md | 15 +++++++++++++++ packages/eslint-scope/package.json | 10 ++++++---- packages/eslint-visitor-keys/CHANGELOG.md | 7 +++++++ packages/eslint-visitor-keys/package.json | 6 ++++-- packages/espree/CHANGELOG.md | 14 ++++++++++++++ packages/espree/package.json | 4 ++-- 7 files changed, 51 insertions(+), 11 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8fc408ad..6a296d6a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,5 +1,5 @@ { - "packages/espree": "10.3.0", - "packages/eslint-scope": "8.3.0", - "packages/eslint-visitor-keys": "4.2.0" + "packages/espree": "10.4.0", + "packages/eslint-scope": "8.4.0", + "packages/eslint-visitor-keys": "4.2.1" } diff --git a/packages/eslint-scope/CHANGELOG.md b/packages/eslint-scope/CHANGELOG.md index fc5f1f85..c8c5b258 100644 --- a/packages/eslint-scope/CHANGELOG.md +++ b/packages/eslint-scope/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## [8.4.0](https://github.com/eslint/js/compare/eslint-scope-v8.3.0...eslint-scope-v8.4.0) (2025-06-09) + + +### Features + +* Add support for ES2026 `using` and `await using` declarations ([#658](https://github.com/eslint/js/issues/658)) ([39e0865](https://github.com/eslint/js/commit/39e086509a0164dcea960719fb9673c73452f36e)) + + +### Dependencies + +* The following workspace dependencies were updated + * devDependencies + * eslint-visitor-keys bumped from ^4.2.0 to ^4.2.1 + * espree bumped from ^10.3.0 to ^10.4.0 + ## [8.3.0](https://github.com/eslint/js/compare/eslint-scope-v8.2.0...eslint-scope-v8.3.0) (2025-03-07) diff --git a/packages/eslint-scope/package.json b/packages/eslint-scope/package.json index 9186bb8d..e634e45b 100644 --- a/packages/eslint-scope/package.json +++ b/packages/eslint-scope/package.json @@ -11,7 +11,7 @@ }, "./package.json": "./package.json" }, - "version": "8.3.0", + "version": "8.4.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -21,7 +21,9 @@ "directory": "packages/eslint-scope" }, "funding": "https://opencollective.com/eslint", - "keywords": ["eslint"], + "keywords": [ + "eslint" + ], "bugs": { "url": "https://github.com/eslint/js/issues" }, @@ -52,8 +54,8 @@ "@typescript-eslint/parser": "^8.7.0", "chai": "^4.3.4", "eslint-release": "^3.2.0", - "eslint-visitor-keys": "^4.2.0", - "espree": "^10.3.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", "npm-license": "^0.3.3", "rollup": "^2.52.7", "shelljs": "^0.8.5", diff --git a/packages/eslint-visitor-keys/CHANGELOG.md b/packages/eslint-visitor-keys/CHANGELOG.md index ac62fe31..8647806e 100644 --- a/packages/eslint-visitor-keys/CHANGELOG.md +++ b/packages/eslint-visitor-keys/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [4.2.1](https://github.com/eslint/js/compare/eslint-visitor-keys-v4.2.0...eslint-visitor-keys-v4.2.1) (2025-06-09) + + +### Bug Fixes + +* order visitor keys for `ExportSpecifier` in source code order ([#656](https://github.com/eslint/js/issues/656)) ([dbad7d8](https://github.com/eslint/js/commit/dbad7d8aeab3f24253ab846f1247a33b7ddd0f19)) + ## [4.2.0](https://github.com/eslint/js/compare/eslint-visitor-keys-v4.1.0...eslint-visitor-keys-v4.2.0) (2024-10-29) diff --git a/packages/eslint-visitor-keys/package.json b/packages/eslint-visitor-keys/package.json index 46d373d8..852e4ddb 100644 --- a/packages/eslint-visitor-keys/package.json +++ b/packages/eslint-visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "eslint-visitor-keys", - "version": "4.2.0", + "version": "4.2.1", "description": "Constants and utilities about visitor keys to traverse AST.", "type": "module", "main": "dist/eslint-visitor-keys.cjs", @@ -58,7 +58,9 @@ "directory": "packages/eslint-visitor-keys" }, "funding": "https://opencollective.com/eslint", - "keywords": ["eslint"], + "keywords": [ + "eslint" + ], "author": "Toru Nagashima (https://github.com/mysticatea)", "license": "Apache-2.0", "bugs": { diff --git a/packages/espree/CHANGELOG.md b/packages/espree/CHANGELOG.md index dc5b5738..37db6833 100644 --- a/packages/espree/CHANGELOG.md +++ b/packages/espree/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [10.4.0](https://github.com/eslint/js/compare/espree-v10.3.0...espree-v10.4.0) (2025-06-09) + + +### Features + +* Add support for ES2026 `using` and `await using` declarations ([#658](https://github.com/eslint/js/issues/658)) ([39e0865](https://github.com/eslint/js/commit/39e086509a0164dcea960719fb9673c73452f36e)) + + +### Dependencies + +* The following workspace dependencies were updated + * dependencies + * eslint-visitor-keys bumped from ^4.2.0 to ^4.2.1 + ## [10.3.0](https://github.com/eslint/js/compare/espree-v10.2.0...espree-v10.3.0) (2024-10-29) diff --git a/packages/espree/package.json b/packages/espree/package.json index 24563b1d..20b6dc6f 100644 --- a/packages/espree/package.json +++ b/packages/espree/package.json @@ -16,7 +16,7 @@ ], "./package.json": "./package.json" }, - "version": "10.3.0", + "version": "10.4.0", "files": [ "lib", "dist/espree.cjs", @@ -38,7 +38,7 @@ "dependencies": { "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.0" + "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { "@rollup/plugin-commonjs": "^28.0.0", pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy