From 7e93b286667fe3b86a3baac973d402414228c7a3 Mon Sep 17 00:00:00 2001 From: "typescript-eslint[bot]" Date: Mon, 3 Jun 2024 17:16:38 +0000 Subject: [PATCH 01/23] chore(release): publish 7.12.0 --- CHANGELOG.md | 33 +++++ packages/ast-spec/CHANGELOG.md | 6 + packages/ast-spec/package.json | 2 +- packages/eslint-plugin-internal/CHANGELOG.md | 6 + packages/eslint-plugin-internal/package.json | 10 +- packages/eslint-plugin/CHANGELOG.md | 44 ++++++ packages/eslint-plugin/package.json | 14 +- packages/integration-tests/CHANGELOG.md | 6 + packages/integration-tests/package.json | 2 +- packages/parser/CHANGELOG.md | 19 +++ packages/parser/package.json | 10 +- packages/repo-tools/CHANGELOG.md | 6 + packages/repo-tools/package.json | 12 +- .../CHANGELOG.md | 6 + .../package.json | 6 +- packages/rule-tester/CHANGELOG.md | 21 +++ packages/rule-tester/package.json | 8 +- packages/scope-manager/CHANGELOG.md | 6 + packages/scope-manager/package.json | 8 +- packages/type-utils/CHANGELOG.md | 19 +++ packages/type-utils/package.json | 8 +- packages/types/CHANGELOG.md | 19 +++ packages/types/package.json | 2 +- packages/typescript-eslint/CHANGELOG.md | 24 ++++ packages/typescript-eslint/package.json | 8 +- packages/typescript-estree/CHANGELOG.md | 6 + packages/typescript-estree/package.json | 6 +- packages/utils/CHANGELOG.md | 6 + packages/utils/package.json | 8 +- packages/visitor-keys/CHANGELOG.md | 6 + packages/visitor-keys/package.json | 4 +- packages/website-eslint/CHANGELOG.md | 6 + packages/website-eslint/package.json | 12 +- packages/website/CHANGELOG.md | 19 +++ packages/website/package.json | 18 +-- yarn.lock | 126 +++++++++--------- 36 files changed, 390 insertions(+), 132 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e01fdba81..3df5919aff6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,36 @@ +## 7.12.0 (2024-06-03) + + +### 🚀 Features + +- **eslint-plugin:** [no-useless-template-literals] rename to `no-useless-template-expression` (deprecate `no-useless-template-literals`) ([#8821](https://github.com/typescript-eslint/typescript-eslint/pull/8821)) +- **eslint-plugin:** [no-floating-promises] add option 'allowForKnownSafePromises' ([#9186](https://github.com/typescript-eslint/typescript-eslint/pull/9186)) +- **rule-tester:** check for parsing errors in suggestion fixes ([#9052](https://github.com/typescript-eslint/typescript-eslint/pull/9052)) +- **rule-tester:** port `checkDuplicateTestCases` from ESLint ([#9026](https://github.com/typescript-eslint/typescript-eslint/pull/9026)) + +### 🩹 Fixes + +- no-useless-template-expression -> no-unnecessary-template-expression ([#9174](https://github.com/typescript-eslint/typescript-eslint/pull/9174)) +- **eslint-plugin:** [no-unnecessary-type-assertion] combine template literal check with `const` variable check ([#8820](https://github.com/typescript-eslint/typescript-eslint/pull/8820)) +- **eslint-plugin:** [dot-notation] fix false positive when accessing private/protected property with optional chaining ([#8851](https://github.com/typescript-eslint/typescript-eslint/pull/8851)) +- **eslint-plugin:** [explicit-member-accessibility] refine report locations ([#8869](https://github.com/typescript-eslint/typescript-eslint/pull/8869)) +- **eslint-plugin:** [no-unnecessary-type-assertion] declares are always defined, so always check `declare`s ([#8901](https://github.com/typescript-eslint/typescript-eslint/pull/8901)) +- **eslint-plugin:** [prefer-literal-enum-member] allow using member it self on allowBitwiseExpressions ([#9114](https://github.com/typescript-eslint/typescript-eslint/pull/9114)) +- **eslint-plugin:** [return-await] clean up in-try-catch detection and make autofixes safe ([#9031](https://github.com/typescript-eslint/typescript-eslint/pull/9031)) +- **eslint-plugin:** [member-ordering] also TSMethodSignature can be get/set ([#9193](https://github.com/typescript-eslint/typescript-eslint/pull/9193)) +- **types:** correct typing ParserOptions ([#9202](https://github.com/typescript-eslint/typescript-eslint/pull/9202)) + +### ❤️ Thank You + +- Abraham Guo +- Han Yeong-woo @nix6839 +- Joshua Chen +- Kim Sang Du @developer-bandi +- Kirk Waiblinger +- YeonJuan @yeonjuan + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 020eb19247c..65da4a57e52 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.12.0 (2024-06-03) + +This was a version bump only for ast-spec to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 49cfcf39bae..1c304c93981 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "7.11.0", + "version": "7.12.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index c4ba9b251b4..bf0d09df6a6 100644 --- a/packages/eslint-plugin-internal/CHANGELOG.md +++ b/packages/eslint-plugin-internal/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.12.0 (2024-06-03) + +This was a version bump only for eslint-plugin-internal to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for eslint-plugin-internal to align it with other projects, there were no code changes. diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 8e787cb8719..2745f488f42 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-internal", - "version": "7.11.0", + "version": "7.12.0", "private": true, "main": "dist/index.js", "types": "index.d.ts", @@ -15,10 +15,10 @@ }, "dependencies": { "@prettier/sync": "^0.5.1", - "@typescript-eslint/rule-tester": "7.11.0", - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/type-utils": "7.11.0", - "@typescript-eslint/utils": "7.11.0", + "@typescript-eslint/rule-tester": "7.12.0", + "@typescript-eslint/scope-manager": "7.12.0", + "@typescript-eslint/type-utils": "7.12.0", + "@typescript-eslint/utils": "7.12.0", "prettier": "^3.2.5" }, "devDependencies": { diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 6c65e67d996..63eee80759e 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,47 @@ +## 7.12.0 (2024-06-03) + + +### 🚀 Features + +- **eslint-plugin:** [no-useless-template-literals] rename to `no-useless-template-expression` (deprecate `no-useless-template-literals`) + +- **rule-tester:** check for parsing errors in suggestion fixes + +- **rule-tester:** port `checkDuplicateTestCases` from ESLint + +- **eslint-plugin:** [no-floating-promises] add option 'allowForKnownSafePromises' + + +### 🩹 Fixes + +- no-useless-template-expression -> no-unnecessary-template-expression + +- **eslint-plugin:** [no-unnecessary-type-assertion] combine template literal check with `const` variable check + +- **eslint-plugin:** [dot-notation] fix false positive when accessing private/protected property with optional chaining + +- **eslint-plugin:** [explicit-member-accessibility] refine report locations + +- **eslint-plugin:** [no-unnecessary-type-assertion] declares are always defined, so always check `declare`s + +- **eslint-plugin:** [prefer-literal-enum-member] allow using member it self on allowBitwiseExpressions + +- **eslint-plugin:** [return-await] clean up in-try-catch detection and make autofixes safe + +- **eslint-plugin:** [member-ordering] also TSMethodSignature can be get/set + + +### ❤️ Thank You + +- Abraham Guo +- Han Yeong-woo +- Joshua Chen +- Kim Sang Du +- Kirk Waiblinger +- YeonJuan + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index c173d9d653d..8bfee8c370b 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "7.11.0", + "version": "7.12.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -62,10 +62,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/type-utils": "7.11.0", - "@typescript-eslint/utils": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/scope-manager": "7.12.0", + "@typescript-eslint/type-utils": "7.12.0", + "@typescript-eslint/utils": "7.12.0", + "@typescript-eslint/visitor-keys": "7.12.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -76,8 +76,8 @@ "@types/marked": "^5.0.2", "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "7.11.0", - "@typescript-eslint/rule-tester": "7.11.0", + "@typescript-eslint/rule-schema-to-typescript-types": "7.12.0", + "@typescript-eslint/rule-tester": "7.12.0", "ajv": "^6.12.6", "cross-env": "^7.0.3", "cross-fetch": "*", diff --git a/packages/integration-tests/CHANGELOG.md b/packages/integration-tests/CHANGELOG.md index aa81dfe8a09..aeb991866e7 100644 --- a/packages/integration-tests/CHANGELOG.md +++ b/packages/integration-tests/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.12.0 (2024-06-03) + +This was a version bump only for integration-tests to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for integration-tests to align it with other projects, there were no code changes. diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index f25227eacdf..266414ccc2d 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/integration-tests", - "version": "7.11.0", + "version": "7.12.0", "private": true, "scripts": { "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 7e2bb33ed1c..3bbfd8511c8 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,22 @@ +## 7.12.0 (2024-06-03) + + +### 🩹 Fixes + +- **types:** correct typing ParserOptions + + +### ❤️ Thank You + +- Abraham Guo +- Han Yeong-woo +- Joshua Chen +- Kim Sang Du +- Kirk Waiblinger +- YeonJuan + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 7c72a1d0ce7..315b2521ce2 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "7.11.0", + "version": "7.12.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -52,10 +52,10 @@ "eslint": "^8.56.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/typescript-estree": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/scope-manager": "7.12.0", + "@typescript-eslint/types": "7.12.0", + "@typescript-eslint/typescript-estree": "7.12.0", + "@typescript-eslint/visitor-keys": "7.12.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/repo-tools/CHANGELOG.md b/packages/repo-tools/CHANGELOG.md index 3381b3f40e1..6e50941f430 100644 --- a/packages/repo-tools/CHANGELOG.md +++ b/packages/repo-tools/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.12.0 (2024-06-03) + +This was a version bump only for repo-tools to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for repo-tools to align it with other projects, there were no code changes. diff --git a/packages/repo-tools/package.json b/packages/repo-tools/package.json index 59932d66d58..d1155a5dc1b 100644 --- a/packages/repo-tools/package.json +++ b/packages/repo-tools/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/repo-tools", - "version": "7.11.0", + "version": "7.12.0", "private": true, "//": "NOTE: intentionally no build step in this package", "scripts": { @@ -18,11 +18,11 @@ "devDependencies": { "@jest/types": "29.6.3", "@nx/devkit": "*", - "@typescript-eslint/eslint-plugin": "7.11.0", - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/typescript-estree": "7.11.0", - "@typescript-eslint/utils": "7.11.0", + "@typescript-eslint/eslint-plugin": "7.12.0", + "@typescript-eslint/scope-manager": "7.12.0", + "@typescript-eslint/types": "7.12.0", + "@typescript-eslint/typescript-estree": "7.12.0", + "@typescript-eslint/utils": "7.12.0", "cross-fetch": "*", "execa": "*", "prettier": "^3.2.5", diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index d3353278b7d..3efe089ac8f 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.12.0 (2024-06-03) + +This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index d116a7cef0d..c4ebd736f08 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "7.11.0", + "version": "7.12.0", "private": true, "type": "commonjs", "exports": { @@ -34,8 +34,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@typescript-eslint/type-utils": "7.11.0", - "@typescript-eslint/utils": "7.11.0", + "@typescript-eslint/type-utils": "7.12.0", + "@typescript-eslint/utils": "7.12.0", "natural-compare": "^1.4.0", "prettier": "^3.2.5" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index e3267893489..be6f45e9b9d 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,24 @@ +## 7.12.0 (2024-06-03) + + +### 🚀 Features + +- **rule-tester:** check for parsing errors in suggestion fixes + +- **rule-tester:** port `checkDuplicateTestCases` from ESLint + + +### ❤️ Thank You + +- Abraham Guo +- Han Yeong-woo +- Joshua Chen +- Kim Sang Du +- Kirk Waiblinger +- YeonJuan + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 76c51382d89..6c74f3a2079 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "7.11.0", + "version": "7.12.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -48,8 +48,8 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/typescript-estree": "7.11.0", - "@typescript-eslint/utils": "7.11.0", + "@typescript-eslint/typescript-estree": "7.12.0", + "@typescript-eslint/utils": "7.12.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", @@ -63,7 +63,7 @@ "@jest/types": "29.6.3", "@types/json-stable-stringify-without-jsonify": "^1.0.2", "@types/lodash.merge": "4.6.9", - "@typescript-eslint/parser": "7.11.0", + "@typescript-eslint/parser": "7.12.0", "chai": "^4.4.1", "eslint-visitor-keys": "^4.0.0", "espree": "^10.0.1", diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 8a5ca9398c2..54ddaa579e3 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.12.0 (2024-06-03) + +This was a version bump only for scope-manager to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 466f183f8b6..edf542e4013 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "7.11.0", + "version": "7.12.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -46,13 +46,13 @@ "typecheck": "npx nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0" + "@typescript-eslint/types": "7.12.0", + "@typescript-eslint/visitor-keys": "7.12.0" }, "devDependencies": { "@jest/types": "29.6.3", "@types/glob": "*", - "@typescript-eslint/typescript-estree": "7.11.0", + "@typescript-eslint/typescript-estree": "7.12.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 9215f93324f..9aa65def32e 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,22 @@ +## 7.12.0 (2024-06-03) + + +### 🚀 Features + +- **eslint-plugin:** [no-floating-promises] add option 'allowForKnownSafePromises' + + +### ❤️ Thank You + +- Abraham Guo +- Han Yeong-woo +- Joshua Chen +- Kim Sang Du +- Kirk Waiblinger +- YeonJuan + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index e3663697b57..b6990c73cc4 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "7.11.0", + "version": "7.12.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -46,14 +46,14 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@typescript-eslint/typescript-estree": "7.11.0", - "@typescript-eslint/utils": "7.11.0", + "@typescript-eslint/typescript-estree": "7.12.0", + "@typescript-eslint/utils": "7.12.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, "devDependencies": { "@jest/types": "29.6.3", - "@typescript-eslint/parser": "7.11.0", + "@typescript-eslint/parser": "7.12.0", "ajv": "^6.12.6", "downlevel-dts": "*", "jest": "29.7.0", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index eb16e586433..ee61d8e0315 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,22 @@ +## 7.12.0 (2024-06-03) + + +### 🩹 Fixes + +- **types:** correct typing ParserOptions + + +### ❤️ Thank You + +- Abraham Guo +- Han Yeong-woo +- Joshua Chen +- Kim Sang Du +- Kirk Waiblinger +- YeonJuan + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 10d1ba677c1..ea7d093fb57 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "7.11.0", + "version": "7.12.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index f9dbda27dde..1c6cc5c0b95 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,27 @@ +## 7.12.0 (2024-06-03) + + +### 🚀 Features + +- **eslint-plugin:** [no-useless-template-literals] rename to `no-useless-template-expression` (deprecate `no-useless-template-literals`) + + +### 🩹 Fixes + +- no-useless-template-expression -> no-unnecessary-template-expression + + +### ❤️ Thank You + +- Abraham Guo +- Han Yeong-woo +- Joshua Chen +- Kim Sang Du +- Kirk Waiblinger +- YeonJuan + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index 1e17ee07bc1..32ad3cda381 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "7.11.0", + "version": "7.12.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -55,9 +55,9 @@ "eslint": "^8.56.0" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "7.11.0", - "@typescript-eslint/parser": "7.11.0", - "@typescript-eslint/utils": "7.11.0" + "@typescript-eslint/eslint-plugin": "7.12.0", + "@typescript-eslint/parser": "7.12.0", + "@typescript-eslint/utils": "7.12.0" }, "devDependencies": { "@jest/types": "29.6.3", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 6a8e28c0e27..3658f869e8d 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.12.0 (2024-06-03) + +This was a version bump only for typescript-estree to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 2a19bfc5bc3..6384bd898ce 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "7.11.0", + "version": "7.12.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -54,8 +54,8 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/types": "7.12.0", + "@typescript-eslint/visitor-keys": "7.12.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 7ee741f15cb..e57bd8e2a1c 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.12.0 (2024-06-03) + +This was a version bump only for utils to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 85853f7236b..333604db563 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "7.11.0", + "version": "7.12.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -68,9 +68,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/typescript-estree": "7.11.0" + "@typescript-eslint/scope-manager": "7.12.0", + "@typescript-eslint/types": "7.12.0", + "@typescript-eslint/typescript-estree": "7.12.0" }, "peerDependencies": { "eslint": "^8.56.0" diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 9dc56094f38..a657fdc03af 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.12.0 (2024-06-03) + +This was a version bump only for visitor-keys to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 26bf496b947..f8fbb8670ee 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "7.11.0", + "version": "7.12.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -47,7 +47,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@typescript-eslint/types": "7.11.0", + "@typescript-eslint/types": "7.12.0", "eslint-visitor-keys": "^3.4.3" }, "devDependencies": { diff --git a/packages/website-eslint/CHANGELOG.md b/packages/website-eslint/CHANGELOG.md index 1e87869a5f1..06585a2e0fc 100644 --- a/packages/website-eslint/CHANGELOG.md +++ b/packages/website-eslint/CHANGELOG.md @@ -1,3 +1,9 @@ +## 7.12.0 (2024-06-03) + +This was a version bump only for website-eslint to align it with other projects, there were no code changes. + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for website-eslint to align it with other projects, there were no code changes. diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 4eee27c03c2..2d3eeb77e89 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/website-eslint", - "version": "7.11.0", + "version": "7.12.0", "private": true, "description": "ESLint which works in browsers.", "files": [ @@ -24,11 +24,11 @@ }, "devDependencies": { "@eslint/js": "*", - "@typescript-eslint/eslint-plugin": "7.11.0", - "@typescript-eslint/parser": "7.11.0", - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/typescript-estree": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/eslint-plugin": "7.12.0", + "@typescript-eslint/parser": "7.12.0", + "@typescript-eslint/scope-manager": "7.12.0", + "@typescript-eslint/typescript-estree": "7.12.0", + "@typescript-eslint/visitor-keys": "7.12.0", "esbuild": "~0.21.0", "eslint": "*", "esquery": "*", diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md index d6ee560e547..55f5433f65e 100644 --- a/packages/website/CHANGELOG.md +++ b/packages/website/CHANGELOG.md @@ -1,3 +1,22 @@ +## 7.12.0 (2024-06-03) + + +### 🩹 Fixes + +- no-useless-template-expression -> no-unnecessary-template-expression + + +### ❤️ Thank You + +- Abraham Guo +- Han Yeong-woo +- Joshua Chen +- Kim Sang Du +- Kirk Waiblinger +- YeonJuan + +You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. + ## 7.11.0 (2024-05-27) This was a version bump only for website to align it with other projects, there were no code changes. diff --git a/packages/website/package.json b/packages/website/package.json index 6f548b4703f..7222cad68a7 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "7.11.0", + "version": "7.12.0", "private": true, "scripts": { "build": "docusaurus build", @@ -23,8 +23,8 @@ "@docusaurus/preset-classic": "^3.2.1", "@docusaurus/remark-plugin-npm2yarn": "^3.2.1", "@docusaurus/theme-common": "^3.2.1", - "@typescript-eslint/parser": "7.11.0", - "@typescript-eslint/website-eslint": "7.11.0", + "@typescript-eslint/parser": "7.12.0", + "@typescript-eslint/website-eslint": "7.12.0", "clsx": "^2.1.0", "eslint": "*", "json5": "^2.2.3", @@ -46,12 +46,12 @@ "@types/mdast": "^4.0.3", "@types/react": "*", "@types/unist": "^3.0.2", - "@typescript-eslint/eslint-plugin": "7.11.0", - "@typescript-eslint/rule-schema-to-typescript-types": "7.11.0", - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/typescript-estree": "7.11.0", - "@typescript-eslint/utils": "7.11.0", + "@typescript-eslint/eslint-plugin": "7.12.0", + "@typescript-eslint/rule-schema-to-typescript-types": "7.12.0", + "@typescript-eslint/scope-manager": "7.12.0", + "@typescript-eslint/types": "7.12.0", + "@typescript-eslint/typescript-estree": "7.12.0", + "@typescript-eslint/utils": "7.12.0", "copy-webpack-plugin": "^12.0.0", "cross-fetch": "*", "history": "^4.9.0", diff --git a/yarn.lock b/yarn.lock index 8eeed73a41b..67c19cfcd36 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5563,17 +5563,17 @@ __metadata: dependencies: "@jest/types": 29.6.3 "@prettier/sync": ^0.5.1 - "@typescript-eslint/rule-tester": 7.11.0 - "@typescript-eslint/scope-manager": 7.11.0 - "@typescript-eslint/type-utils": 7.11.0 - "@typescript-eslint/utils": 7.11.0 + "@typescript-eslint/rule-tester": 7.12.0 + "@typescript-eslint/scope-manager": 7.12.0 + "@typescript-eslint/type-utils": 7.12.0 + "@typescript-eslint/utils": 7.12.0 jest: 29.7.0 prettier: ^3.2.5 rimraf: "*" languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@7.11.0, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@7.12.0, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: @@ -5582,12 +5582,12 @@ __metadata: "@types/marked": ^5.0.2 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 7.11.0 - "@typescript-eslint/rule-tester": 7.11.0 - "@typescript-eslint/scope-manager": 7.11.0 - "@typescript-eslint/type-utils": 7.11.0 - "@typescript-eslint/utils": 7.11.0 - "@typescript-eslint/visitor-keys": 7.11.0 + "@typescript-eslint/rule-schema-to-typescript-types": 7.12.0 + "@typescript-eslint/rule-tester": 7.12.0 + "@typescript-eslint/scope-manager": 7.12.0 + "@typescript-eslint/type-utils": 7.12.0 + "@typescript-eslint/utils": 7.12.0 + "@typescript-eslint/visitor-keys": 7.12.0 ajv: ^6.12.6 cross-env: ^7.0.3 cross-fetch: "*" @@ -5632,16 +5632,16 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@7.11.0, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@7.12.0, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: "@jest/types": 29.6.3 "@types/glob": "*" - "@typescript-eslint/scope-manager": 7.11.0 - "@typescript-eslint/types": 7.11.0 - "@typescript-eslint/typescript-estree": 7.11.0 - "@typescript-eslint/visitor-keys": 7.11.0 + "@typescript-eslint/scope-manager": 7.12.0 + "@typescript-eslint/types": 7.12.0 + "@typescript-eslint/typescript-estree": 7.12.0 + "@typescript-eslint/visitor-keys": 7.12.0 debug: ^4.3.4 downlevel-dts: "*" glob: "*" @@ -5663,11 +5663,11 @@ __metadata: dependencies: "@jest/types": 29.6.3 "@nx/devkit": "*" - "@typescript-eslint/eslint-plugin": 7.11.0 - "@typescript-eslint/scope-manager": 7.11.0 - "@typescript-eslint/types": 7.11.0 - "@typescript-eslint/typescript-estree": 7.11.0 - "@typescript-eslint/utils": 7.11.0 + "@typescript-eslint/eslint-plugin": 7.12.0 + "@typescript-eslint/scope-manager": 7.12.0 + "@typescript-eslint/types": 7.12.0 + "@typescript-eslint/typescript-estree": 7.12.0 + "@typescript-eslint/utils": 7.12.0 cross-fetch: "*" execa: "*" prettier: ^3.2.5 @@ -5677,28 +5677,28 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@7.11.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@7.12.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: "@jest/types": 29.6.3 - "@typescript-eslint/type-utils": 7.11.0 - "@typescript-eslint/utils": 7.11.0 + "@typescript-eslint/type-utils": 7.12.0 + "@typescript-eslint/utils": 7.12.0 natural-compare: ^1.4.0 prettier: ^3.2.5 languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@7.11.0, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@7.12.0, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@jest/types": 29.6.3 "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 7.11.0 - "@typescript-eslint/typescript-estree": 7.11.0 - "@typescript-eslint/utils": 7.11.0 + "@typescript-eslint/parser": 7.12.0 + "@typescript-eslint/typescript-estree": 7.12.0 + "@typescript-eslint/utils": 7.12.0 ajv: ^6.12.6 chai: ^4.4.1 eslint-visitor-keys: ^4.0.0 @@ -5717,15 +5717,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@7.11.0, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@7.12.0, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: "@jest/types": 29.6.3 "@types/glob": "*" - "@typescript-eslint/types": 7.11.0 - "@typescript-eslint/typescript-estree": 7.11.0 - "@typescript-eslint/visitor-keys": 7.11.0 + "@typescript-eslint/types": 7.12.0 + "@typescript-eslint/typescript-estree": 7.12.0 + "@typescript-eslint/visitor-keys": 7.12.0 glob: "*" jest-specific-snapshot: "*" make-dir: "*" @@ -5754,14 +5754,14 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/type-utils@7.11.0, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@7.12.0, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: "@jest/types": 29.6.3 - "@typescript-eslint/parser": 7.11.0 - "@typescript-eslint/typescript-estree": 7.11.0 - "@typescript-eslint/utils": 7.11.0 + "@typescript-eslint/parser": 7.12.0 + "@typescript-eslint/typescript-estree": 7.12.0 + "@typescript-eslint/utils": 7.12.0 ajv: ^6.12.6 debug: ^4.3.4 downlevel-dts: "*" @@ -5778,7 +5778,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@7.11.0, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@7.12.0, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -5877,13 +5877,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@7.11.0, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@7.12.0, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@jest/types": 29.6.3 - "@typescript-eslint/types": 7.11.0 - "@typescript-eslint/visitor-keys": 7.11.0 + "@typescript-eslint/types": 7.12.0 + "@typescript-eslint/visitor-keys": 7.12.0 debug: ^4.3.4 glob: "*" globby: ^11.1.0 @@ -5939,14 +5939,14 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@7.11.0, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@7.12.0, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.4.0 - "@typescript-eslint/scope-manager": 7.11.0 - "@typescript-eslint/types": 7.11.0 - "@typescript-eslint/typescript-estree": 7.11.0 + "@typescript-eslint/scope-manager": 7.12.0 + "@typescript-eslint/types": 7.12.0 + "@typescript-eslint/typescript-estree": 7.12.0 downlevel-dts: "*" jest: 29.7.0 prettier: ^3.2.5 @@ -5992,13 +5992,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@7.11.0, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@7.12.0, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: "@jest/types": 29.6.3 "@types/eslint-visitor-keys": "*" - "@typescript-eslint/types": 7.11.0 + "@typescript-eslint/types": 7.12.0 downlevel-dts: "*" eslint-visitor-keys: ^3.4.3 jest: 29.7.0 @@ -6028,16 +6028,16 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/website-eslint@7.11.0, @typescript-eslint/website-eslint@workspace:packages/website-eslint": +"@typescript-eslint/website-eslint@7.12.0, @typescript-eslint/website-eslint@workspace:packages/website-eslint": version: 0.0.0-use.local resolution: "@typescript-eslint/website-eslint@workspace:packages/website-eslint" dependencies: "@eslint/js": "*" - "@typescript-eslint/eslint-plugin": 7.11.0 - "@typescript-eslint/parser": 7.11.0 - "@typescript-eslint/scope-manager": 7.11.0 - "@typescript-eslint/typescript-estree": 7.11.0 - "@typescript-eslint/visitor-keys": 7.11.0 + "@typescript-eslint/eslint-plugin": 7.12.0 + "@typescript-eslint/parser": 7.12.0 + "@typescript-eslint/scope-manager": 7.12.0 + "@typescript-eslint/typescript-estree": 7.12.0 + "@typescript-eslint/visitor-keys": 7.12.0 esbuild: ~0.21.0 eslint: "*" esquery: "*" @@ -19690,9 +19690,9 @@ __metadata: resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: "@jest/types": 29.6.3 - "@typescript-eslint/eslint-plugin": 7.11.0 - "@typescript-eslint/parser": 7.11.0 - "@typescript-eslint/utils": 7.11.0 + "@typescript-eslint/eslint-plugin": 7.12.0 + "@typescript-eslint/parser": 7.12.0 + "@typescript-eslint/utils": 7.12.0 downlevel-dts: "*" jest: 29.7.0 prettier: ^3.2.5 @@ -20404,14 +20404,14 @@ __metadata: "@types/mdast": ^4.0.3 "@types/react": "*" "@types/unist": ^3.0.2 - "@typescript-eslint/eslint-plugin": 7.11.0 - "@typescript-eslint/parser": 7.11.0 - "@typescript-eslint/rule-schema-to-typescript-types": 7.11.0 - "@typescript-eslint/scope-manager": 7.11.0 - "@typescript-eslint/types": 7.11.0 - "@typescript-eslint/typescript-estree": 7.11.0 - "@typescript-eslint/utils": 7.11.0 - "@typescript-eslint/website-eslint": 7.11.0 + "@typescript-eslint/eslint-plugin": 7.12.0 + "@typescript-eslint/parser": 7.12.0 + "@typescript-eslint/rule-schema-to-typescript-types": 7.12.0 + "@typescript-eslint/scope-manager": 7.12.0 + "@typescript-eslint/types": 7.12.0 + "@typescript-eslint/typescript-estree": 7.12.0 + "@typescript-eslint/utils": 7.12.0 + "@typescript-eslint/website-eslint": 7.12.0 clsx: ^2.1.0 copy-webpack-plugin: ^12.0.0 cross-fetch: "*" From 5b78f2240b0f18e1fb745532b8cdd36cc4c7d6ae Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 15:14:20 -0400 Subject: [PATCH 02/23] chore(deps): update dependency debug to v4.3.5 (#9227) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 67c19cfcd36..d0bfed75ece 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8728,7 +8728,19 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:4.3.4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:~4.3.4": +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:~4.3.4": + version: 4.3.5 + resolution: "debug@npm:4.3.5" + dependencies: + ms: 2.1.2 + peerDependenciesMeta: + supports-color: + optional: true + checksum: 7c002b51e256257f936dda09eb37167df952758c57badf6bf44bdc40b89a4bcb8e5a0a2e4c7b53f97c69e2970dd5272d33a757378a12c8f8e64ea7bf99e8e86e + languageName: node + linkType: hard + +"debug@npm:4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: From d8192f6575ea6c56b1a265904db2a3e5baad5f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Tue, 4 Jun 2024 00:10:44 -0400 Subject: [PATCH 03/23] docs: mention needing an isolated repro in bug-report-other.yaml (#9240) --- .github/ISSUE_TEMPLATE/06-bug-report-other.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml index ee44e376f65..3eb5e066206 100644 --- a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml +++ b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml @@ -20,7 +20,11 @@ body: - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed. required: true - type: markdown - id: complexity-note + attributes: + value: | + **All typescript-eslint bug reports need an isolated reproduction** we can clone locally and get running without other projects or existing knowledge of your project. + If you can't provide one, your report will likely be closed without action. + - type: markdown attributes: value: | ### Note For Complex Issues From 550157a9070107c01e2f93d17e18982ac59ef9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Tue, 4 Jun 2024 00:27:37 -0400 Subject: [PATCH 04/23] docs: expand rule deprecation docs to also include renames (#9237) * docs: expand rule deprecation docs to also include renames * Update docs/maintenance/issues/Rule_Deprecations_And_Deletions.mdx Co-authored-by: Kirk Waiblinger --------- Co-authored-by: Kirk Waiblinger Co-authored-by: Joshua Chen --- ...ns.mdx => Rule_Deprecations_And_Deletions.mdx} | 15 +++++++++------ packages/website/docusaurus.config.mts | 4 ++++ packages/website/sidebars/sidebar.base.js | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) rename docs/maintenance/issues/{Rule_Deprecations.mdx => Rule_Deprecations_And_Deletions.mdx} (59%) diff --git a/docs/maintenance/issues/Rule_Deprecations.mdx b/docs/maintenance/issues/Rule_Deprecations_And_Deletions.mdx similarity index 59% rename from docs/maintenance/issues/Rule_Deprecations.mdx rename to docs/maintenance/issues/Rule_Deprecations_And_Deletions.mdx index 1e89880390b..34715e9e73c 100644 --- a/docs/maintenance/issues/Rule_Deprecations.mdx +++ b/docs/maintenance/issues/Rule_Deprecations_And_Deletions.mdx @@ -1,6 +1,6 @@ --- -id: rule-deprecations -title: Rule Deprecations +id: rule-deprecations-and-deletions +title: Rule Deprecations, Renames, And Deletions --- Sometimes a rule that used to be 👍 does not age well and becomes 👎. @@ -14,12 +14,12 @@ In these cases, we aim to remove the old rule with minimal user disruption. ## Filing the Issue -Rule deprecations can be filed as a [new issue bypassing templates](https://github.com/typescript-eslint/typescript-eslint/issues/new). +Rule deprecations and renames can be filed as a [new issue bypassing templates](https://github.com/typescript-eslint/typescript-eslint/issues/new). Provide it an `## Overview` containing: - The rule name & link to its documentation page -- A clear explanation of why you believe it should be deprecated +- A clear explanation of why you believe it should be deprecated and/or renamed - Whether it exists in popular configs such as `eslint-config-airbnb-typescript` and `eslint-config-standard-with-typescript` - Sourcegraph queries showing how often it appears in user configs @@ -30,5 +30,8 @@ Provide it an `## Overview` containing: 1. In any minor/patch version, add [rule `meta` properties](https://eslint.org/docs/latest/developer-guide/working-with-rules#rule-basics): - `deprecated: true` - `replacedBy`, if applicable -2. In the next major version, you may delete the rule - - If the rule is relatively popular with users, consider leaving a documentation page as a tombstone pointing to the new relevant rule or docs (see [`camelcase`](/rules/camelcase/) as an example) +2. Search through open issues and PRs, and update the name in them accordingly: + - Deletions: close them with a link to the issue and deprecation PR + - Renames: update their title and explicitly mention in a comment that the rule has been renamed +3. In the next major version, you may delete the deprecated rule + - Leave a documentation page as a tombstone pointing to the new relevant rule or docs (see [`camelcase`](/rules/camelcase) as an example) diff --git a/packages/website/docusaurus.config.mts b/packages/website/docusaurus.config.mts index 9e23f2b6532..edb6e58484a 100644 --- a/packages/website/docusaurus.config.mts +++ b/packages/website/docusaurus.config.mts @@ -287,6 +287,10 @@ const redirects: PluginRedirectOptions = { from: '/linting/typed-linting/monorepos', to: '/getting-started/typed-linting/monorepos', }, + { + from: '/maintenance/issues/rule-deprecations', + to: '/maintenance/issues/rule-deprecations-and-deletions', + }, ], }; diff --git a/packages/website/sidebars/sidebar.base.js b/packages/website/sidebars/sidebar.base.js index 71c1637093c..4676e1e4361 100644 --- a/packages/website/sidebars/sidebar.base.js +++ b/packages/website/sidebars/sidebar.base.js @@ -125,7 +125,7 @@ module.exports = { 'maintenance/contributor-tiers', { collapsible: true, - items: ['maintenance/issues/rule-deprecations'], + items: ['maintenance/issues/rule-deprecations-and-deletions'], label: 'Issues', link: { id: 'maintenance/issues', From 6cef0649d3bceda47d2504b2abf61241bc12739a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Tue, 4 Jun 2024 00:56:42 -0400 Subject: [PATCH 05/23] docs: add missing sort-type-union-intersection-members.mdx tombstone page (#9236) --- .../rules/sort-type-union-intersection-members.mdx | 12 ++++++++++++ packages/eslint-plugin/tests/docs.test.ts | 1 + 2 files changed, 13 insertions(+) create mode 100644 packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.mdx diff --git a/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.mdx b/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.mdx new file mode 100644 index 00000000000..d8224c93c80 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.mdx @@ -0,0 +1,12 @@ +:::danger Deprecated + +This rule has been renamed to [`sort-type-constituents`](https://typescript-eslint.io/rules/sort-type-constituents). + +::: + + diff --git a/packages/eslint-plugin/tests/docs.test.ts b/packages/eslint-plugin/tests/docs.test.ts index c3f08de4bbd..5011f902dab 100644 --- a/packages/eslint-plugin/tests/docs.test.ts +++ b/packages/eslint-plugin/tests/docs.test.ts @@ -133,6 +133,7 @@ describe('Validating rule docs', () => { 'camelcase.md', 'no-duplicate-imports.mdx', 'no-parameter-properties.mdx', + 'sort-type-union-intersection-members.mdx', ]); const rulesWithComplexOptions = new Set(['array-type', 'member-ordering']); From 68791b8450009be3375c029ced59fb1f75f6f78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Tue, 4 Jun 2024 00:57:44 -0400 Subject: [PATCH 06/23] docs: add shields.io badges to package pages (#9241) --- docs/packages/ESLint_Plugin.mdx | 2 ++ docs/packages/ESLint_Plugin_TSLint.mdx | 2 ++ docs/packages/Parser.mdx | 2 ++ docs/packages/Rule_Tester.mdx | 2 ++ docs/packages/Scope_Manager.mdx | 2 ++ docs/packages/TypeScript_ESLint.mdx | 2 ++ docs/packages/TypeScript_ESTree.mdx | 2 ++ docs/packages/Utils.mdx | 2 ++ packages/website/package.json | 1 + .../MDXComponents/PackageLink.module.css | 3 ++ .../src/theme/MDXComponents/PackageLink.tsx | 29 +++++++++++++++++++ .../website/src/theme/MDXComponents/index.tsx | 2 ++ yarn.lock | 14 +++++++++ 13 files changed, 65 insertions(+) create mode 100644 packages/website/src/theme/MDXComponents/PackageLink.module.css create mode 100644 packages/website/src/theme/MDXComponents/PackageLink.tsx diff --git a/docs/packages/ESLint_Plugin.mdx b/docs/packages/ESLint_Plugin.mdx index bf0777a005d..263d7e4123a 100644 --- a/docs/packages/ESLint_Plugin.mdx +++ b/docs/packages/ESLint_Plugin.mdx @@ -5,6 +5,8 @@ sidebar_label: eslint-plugin # `@typescript-eslint/eslint-plugin` + + > The TypeScript plugin for ESLint. ✨ :::info diff --git a/docs/packages/ESLint_Plugin_TSLint.mdx b/docs/packages/ESLint_Plugin_TSLint.mdx index f8f3d8dc811..91cea06c45a 100644 --- a/docs/packages/ESLint_Plugin_TSLint.mdx +++ b/docs/packages/ESLint_Plugin_TSLint.mdx @@ -5,6 +5,8 @@ sidebar_label: eslint-plugin-tslint # `@typescript-eslint/eslint-plugin-tslint` + + > ESLint plugin that allows running TSLint rules within ESLint to help you migrate from TSLint to ESLint. ✨ :::caution diff --git a/docs/packages/Parser.mdx b/docs/packages/Parser.mdx index 26b5fb80d20..c7364b8cbe4 100644 --- a/docs/packages/Parser.mdx +++ b/docs/packages/Parser.mdx @@ -5,6 +5,8 @@ sidebar_label: parser # `@typescript-eslint/parser` + + > An [ESLint parser](https://eslint.org/docs/user-guide/configuring/plugins#specifying-parser) used to parse TypeScript code into ESLint-compatible nodes, as well as provide backing TypeScript programs. ✨ This is necessary because TypeScript produces a different, incompatible AST format to the one that ESLint requires to work. diff --git a/docs/packages/Rule_Tester.mdx b/docs/packages/Rule_Tester.mdx index 4c62d391c7e..3d1f085c235 100644 --- a/docs/packages/Rule_Tester.mdx +++ b/docs/packages/Rule_Tester.mdx @@ -7,6 +7,8 @@ import CodeBlock from '@theme/CodeBlock'; # `@typescript-eslint/rule-tester` + + > A utility for testing ESLint rules This is a fork of ESLint's built-in `RuleTester` to provide some better types and additional features for testing TypeScript rules. diff --git a/docs/packages/Scope_Manager.mdx b/docs/packages/Scope_Manager.mdx index cd33ac0fc75..0afbdd4690c 100644 --- a/docs/packages/Scope_Manager.mdx +++ b/docs/packages/Scope_Manager.mdx @@ -5,6 +5,8 @@ sidebar_label: scope-manager # `@typescript-eslint/scope-manager` + + > A fork of [`eslint-scope`](https://github.com/eslint/eslint-scope), enhanced to support TypeScript functionality. ✨ A "scope analyser" traverses an AST and builds a model of how variables (and in our case, types) are defined and consumed by the source code. diff --git a/docs/packages/TypeScript_ESLint.mdx b/docs/packages/TypeScript_ESLint.mdx index 5e910850b80..379c939c0be 100644 --- a/docs/packages/TypeScript_ESLint.mdx +++ b/docs/packages/TypeScript_ESLint.mdx @@ -8,6 +8,8 @@ import TabItem from '@theme/TabItem'; # `typescript-eslint` + + > Tooling which enables you to use TypeScript with ESLint This package is the main entrypoint that you can use to consume our tooling with ESLint. diff --git a/docs/packages/TypeScript_ESTree.mdx b/docs/packages/TypeScript_ESTree.mdx index eb6a49c8a1b..516148c4fde 100644 --- a/docs/packages/TypeScript_ESTree.mdx +++ b/docs/packages/TypeScript_ESTree.mdx @@ -5,6 +5,8 @@ sidebar_label: typescript-estree # `@typescript-eslint/typescript-estree` + + > The underlying code used by [`@typescript-eslint/parser`](./Parser.mdx) that converts TypeScript source code into an ESTree-compatible form. ✨ This parser is designed to be generic and robust. diff --git a/docs/packages/Utils.mdx b/docs/packages/Utils.mdx index df05daa7690..ea702046632 100644 --- a/docs/packages/Utils.mdx +++ b/docs/packages/Utils.mdx @@ -5,6 +5,8 @@ sidebar_label: utils # `@typescript-eslint/utils` + + > Utilities for working with TypeScript + ESLint together. ✨ This package contains public utilities for writing custom rules and plugins in TypeScript. diff --git a/packages/website/package.json b/packages/website/package.json index 7222cad68a7..a5c649efedf 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -25,6 +25,7 @@ "@docusaurus/theme-common": "^3.2.1", "@typescript-eslint/parser": "7.12.0", "@typescript-eslint/website-eslint": "7.12.0", + "@uiw/react-shields": "2.0.1", "clsx": "^2.1.0", "eslint": "*", "json5": "^2.2.3", diff --git a/packages/website/src/theme/MDXComponents/PackageLink.module.css b/packages/website/src/theme/MDXComponents/PackageLink.module.css new file mode 100644 index 00000000000..cc472c5ba64 --- /dev/null +++ b/packages/website/src/theme/MDXComponents/PackageLink.module.css @@ -0,0 +1,3 @@ +.packageLink { + margin-bottom: 0.5rem; +} diff --git a/packages/website/src/theme/MDXComponents/PackageLink.tsx b/packages/website/src/theme/MDXComponents/PackageLink.tsx new file mode 100644 index 00000000000..eaf2296aa86 --- /dev/null +++ b/packages/website/src/theme/MDXComponents/PackageLink.tsx @@ -0,0 +1,29 @@ +import Npm from '@uiw/react-shields/npm'; +import React from 'react'; + +import packageData from '../../../package.json'; +import styles from './PackageLink.module.css'; + +export interface PackageLinkProps { + scope?: string; + packageName: string; +} + +export function PackageLink({ + packageName, + scope, +}: PackageLinkProps): React.JSX.Element { + const fullPackageName = [scope, packageName].filter(Boolean).join('/'); + const { version } = packageData; + + return ( + + ); +} diff --git a/packages/website/src/theme/MDXComponents/index.tsx b/packages/website/src/theme/MDXComponents/index.tsx index 78783799596..3efbee2d240 100644 --- a/packages/website/src/theme/MDXComponents/index.tsx +++ b/packages/website/src/theme/MDXComponents/index.tsx @@ -3,6 +3,7 @@ import MDXComponents from '@theme-original/MDXComponents'; import { BaseRuleReference } from './BaseRuleReference'; import { HiddenHeading } from './HiddenHeading'; +import { PackageLink } from './PackageLink'; import { RuleAttributes } from './RuleAttributes'; import { TryInPlayground } from './TryInPlayground'; @@ -11,6 +12,7 @@ export default { Admonition, BaseRuleReference, HiddenHeading, + PackageLink, RuleAttributes, TryInPlayground, }; diff --git a/yarn.lock b/yarn.lock index d0bfed75ece..796c7b42f79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6046,6 +6046,19 @@ __metadata: languageName: unknown linkType: soft +"@uiw/react-shields@npm:2.0.1": + version: 2.0.1 + resolution: "@uiw/react-shields@npm:2.0.1" + dependencies: + "@babel/runtime": ^7.22.6 + peerDependencies: + "@babel/runtime": ">=7.0.0" + react: ">=16.8.0" + react-dom: ">=16.8.0" + checksum: 7103c5c6e135b15fc68fcae9818ddd71ecb40aef253abf45dec9fb068383f2219c08bd5a22957daebbe8395c941632e0e0447ade3e64cda84b79967512b16c19 + languageName: node + linkType: hard + "@ungap/structured-clone@npm:^1.0.0, @ungap/structured-clone@npm:^1.2.0": version: 1.2.0 resolution: "@ungap/structured-clone@npm:1.2.0" @@ -20424,6 +20437,7 @@ __metadata: "@typescript-eslint/typescript-estree": 7.12.0 "@typescript-eslint/utils": 7.12.0 "@typescript-eslint/website-eslint": 7.12.0 + "@uiw/react-shields": 2.0.1 clsx: ^2.1.0 copy-webpack-plugin: ^12.0.0 cross-fetch: "*" From 654f9e929cf088d0f35b99301ee55172f92d4693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Tue, 4 Jun 2024 00:58:10 -0400 Subject: [PATCH 07/23] chore: enable prefer-string-starts-ends-with internally (#9244) --- eslint.config.mjs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index bb2c0c49104..5e32e82438f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -103,9 +103,8 @@ export default tseslint.config( // make sure we're not leveraging any deprecated APIs 'deprecation/deprecation': 'error', - // TODO(#7130): Investigate changing these in or removing these from presets + // TODO: https://github.com/typescript-eslint/typescript-eslint/issues/8538 '@typescript-eslint/no-confusing-void-expression': 'off', - '@typescript-eslint/prefer-string-starts-ends-with': 'off', // // our plugin :D @@ -142,6 +141,12 @@ export default tseslint.config( allowBitwiseExpressions: true, }, ], + '@typescript-eslint/prefer-string-starts-ends-with': [ + 'error', + { + allowSingleElementEquality: 'always', + }, + ], '@typescript-eslint/unbound-method': 'off', '@typescript-eslint/restrict-template-expressions': [ 'error', From c1a257e8521bf6767c951151103df8de43125eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Tue, 4 Jun 2024 00:59:11 -0400 Subject: [PATCH 08/23] chore: ensure 'breaking change' label for PRs that touch stable configs (#9243) --- .github/workflows/pr-labels.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/pr-labels.yml diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml new file mode 100644 index 00000000000..3ede15e7894 --- /dev/null +++ b/.github/workflows/pr-labels.yml @@ -0,0 +1,25 @@ +name: Pull Request Labels + +on: + pull_request: + types: [labeled, opened, synchronize, unlabeled] + +jobs: + label: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - id: changed-stable-configs + uses: tj-actions/changed-files@v44.5.2 + with: + files: packages/{eslint-plugin,typescript-eslint}/src/configs/{recommended,stylistic}* + - if: steps.changed-stable-configs.outputs.any_changed == 'true' + uses: mheap/github-action-required-labels@v5.4.1 + with: + add_comment: true + count: 1 + labels: breaking change + message: '🤖 Beep boop! PRs that change our stable preset configs must be labeled with `breaking change`.' + mode: minimum From d80b3a3bcb52ce3a68a4f53dbce960ad79ea28f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Tue, 4 Jun 2024 00:59:56 -0400 Subject: [PATCH 09/23] docs(website): enable automatic types acqusition (ATA) in the playground (#9242) --- packages/website/src/components/editor/useSandboxServices.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/src/components/editor/useSandboxServices.ts b/packages/website/src/components/editor/useSandboxServices.ts index d5046ad082b..7bceb14f757 100644 --- a/packages/website/src/components/editor/useSandboxServices.ts +++ b/packages/website/src/components/editor/useSandboxServices.ts @@ -62,7 +62,7 @@ export const useSandboxServices = ( wrappingIndent: 'same', hover: { above: false }, }, - acquireTypes: false, + acquireTypes: true, compilerOptions: compilerOptions as Monaco.languages.typescript.CompilerOptions, domID: editorEmbedId, From 988b31e3be10ad83018b20338db3aefa0c570a08 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Tue, 4 Jun 2024 13:45:25 +0800 Subject: [PATCH 10/23] feat(typescript-estree): require `import = require()` argument to be a string literal (#9226) --- .../external-module-ref-non-string-2/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 8 ++++++++ .../snapshots/2-Babel-Error.shot | 3 +++ .../snapshots/3-Alignment-Error.shot | 3 +++ .../external-module-ref-non-string-3/fixture.ts | 1 + .../snapshots/1-TSESTree-Error.shot | 8 ++++++++ .../snapshots/2-Babel-Error.shot | 3 +++ .../snapshots/3-Alignment-Error.shot | 3 +++ .../snapshots/1-TSESTree-Error.shot | 7 ++++++- .../snapshots/3-Alignment-Error.shot | 2 +- .../src/special/TSExternalModuleReference/spec.ts | 5 ++--- .../tests/fixtures-with-differences-errors.shot | 1 - .../src/rules/no-typescript-default-import.ts | 6 +----- .../src/rules/no-restricted-imports.ts | 5 +---- .../tests/rules/no-require-imports.test.ts | 15 --------------- packages/typescript-estree/src/convert.ts | 3 +++ 16 files changed, 44 insertions(+), 30 deletions(-) create mode 100644 packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/fixture.ts create mode 100644 packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/fixture.ts create mode 100644 packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/3-Alignment-Error.shot diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/fixture.ts b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/fixture.ts new file mode 100644 index 00000000000..af81e9506a3 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/fixture.ts @@ -0,0 +1 @@ +import F = require(1 + 1); diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..d3ac7ccd164 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string-2 TSESTree - Error 1`] = ` +"TSError +> 1 | import F = require(1 + 1); + | ^^^^^ String literal expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..c665f97c9fc --- /dev/null +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string-2 Babel - Error 1`] = `[SyntaxError: Unexpected token (1:19)]`; diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..67e53098fb9 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string-2 Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/fixture.ts b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/fixture.ts new file mode 100644 index 00000000000..fc7471ff260 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/fixture.ts @@ -0,0 +1 @@ +import F = require(`1`); diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..6bbae44b9c8 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string-3 TSESTree - Error 1`] = ` +"TSError +> 1 | import F = require(\`1\`); + | ^^^ String literal expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..705e7473716 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string-3 Babel - Error 1`] = `[SyntaxError: Unexpected token (1:19)]`; diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..ec7c941e43f --- /dev/null +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string-3 Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/1-TSESTree-Error.shot index 51aedf5fa31..9bb0b788a35 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string TSESTree - Error 1`] = ` +"TSError +> 1 | import F = require(1); + | ^ String literal expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/3-Alignment-Error.shot index cda96c9ac3d..cefcf460893 100644 --- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/special/TSExternalModuleReference/spec.ts b/packages/ast-spec/src/special/TSExternalModuleReference/spec.ts index 1efd283fd8c..debc2daff41 100644 --- a/packages/ast-spec/src/special/TSExternalModuleReference/spec.ts +++ b/packages/ast-spec/src/special/TSExternalModuleReference/spec.ts @@ -1,9 +1,8 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; -import type { Expression } from '../../unions/Expression'; +import type { StringLiteral } from '../../expression/literal/StringLiteral/spec'; export interface TSExternalModuleReference extends BaseNode { type: AST_NODE_TYPES.TSExternalModuleReference; - // TODO(#1852) - this must be a string - expression: Expression; + expression: StringLiteral; } diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 3baa5a85efc..4932aead790 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -11,7 +11,6 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = ` "declaration/TSDeclareFunction/fixtures/_error_/async/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/fixture.ts", - "declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/fixture.ts", "declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/fixture.ts", diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts index 8ee08569518..e9cb7e31d9d 100644 --- a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts +++ b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts @@ -1,5 +1,4 @@ import type { TSESTree } from '@typescript-eslint/utils'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { createRule } from '../util'; @@ -62,10 +61,7 @@ export default createRule({ node: TSESTree.TSExternalModuleReference, ): void { const parent = node.parent as TSESTree.TSImportEqualsDeclaration; - if ( - node.expression.type === AST_NODE_TYPES.Literal && - node.expression.value === 'typescript' - ) { + if (node.expression.value === 'typescript') { context.report({ node, messageId: 'noTSDefaultImport', diff --git a/packages/eslint-plugin/src/rules/no-restricted-imports.ts b/packages/eslint-plugin/src/rules/no-restricted-imports.ts index b1e2d229f6a..1bd052ab333 100644 --- a/packages/eslint-plugin/src/rules/no-restricted-imports.ts +++ b/packages/eslint-plugin/src/rules/no-restricted-imports.ts @@ -312,10 +312,7 @@ export default createRule({ node: TSESTree.TSImportEqualsDeclaration, ): void { if ( - node.moduleReference.type === - AST_NODE_TYPES.TSExternalModuleReference && - node.moduleReference.expression.type === AST_NODE_TYPES.Literal && - typeof node.moduleReference.expression.value === 'string' + node.moduleReference.type === AST_NODE_TYPES.TSExternalModuleReference ) { const synthesizedImport = { ...node, diff --git a/packages/eslint-plugin/tests/rules/no-require-imports.test.ts b/packages/eslint-plugin/tests/rules/no-require-imports.test.ts index bdfddbc25ae..49fe55f6de4 100644 --- a/packages/eslint-plugin/tests/rules/no-require-imports.test.ts +++ b/packages/eslint-plugin/tests/rules/no-require-imports.test.ts @@ -51,10 +51,6 @@ require('remark-preset-prettier'); code: "import pkg = require('some-package');", options: [{ allow: ['^some-package$'] }], }, - { - code: 'import pkg = require(`some-package`);', - options: [{ allow: ['^some-package$'] }], - }, ], invalid: [ { @@ -207,16 +203,5 @@ var lib5 = require?.('lib5'), }, ], }, - { - code: 'import pkg = require(`./package.json`);', - options: [{ allow: ['^some-package$'] }], - errors: [ - { - line: 1, - column: 14, - messageId: 'noRequireImports', - }, - ], - }, ], }); diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 9d068cbf243..52e4b16baf0 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -3107,6 +3107,9 @@ export class Converter { ); } case SyntaxKind.ExternalModuleReference: { + if (node.expression.kind !== SyntaxKind.StringLiteral) { + this.#throwError(node.expression, 'String literal expected.'); + } return this.createNode(node, { type: AST_NODE_TYPES.TSExternalModuleReference, expression: this.convertChild(node.expression), From 92c82030d780d54fd3831ad8454d452085637b4a Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Tue, 4 Jun 2024 14:35:25 +0800 Subject: [PATCH 11/23] feat(typescript-estree): forbid `.body`, `.async`, `.generator` on `declare function` (#9225) --- .../async/snapshots/1-TSESTree-Error.shot | 7 +- .../async/snapshots/3-Alignment-Error.shot | 2 +- .../snapshots/1-TSESTree-Error.shot | 7 +- .../snapshots/3-Alignment-Error.shot | 2 +- .../_error_/generator-ambient/fixture.ts | 3 + .../snapshots/1-TSESTree-Error.shot | 10 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../_error_/generator-overload/fixture.ts | 2 + .../snapshots/1-TSESTree-Error.shot | 9 + .../snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../{ => _error_}/generator/fixture.ts | 0 .../generator/snapshots/1-TSESTree-Error.shot | 8 + .../generator/snapshots/2-Babel-Error.shot | 3 + .../snapshots/3-Alignment-Error.shot | 3 + .../fixtures/async-ambient/fixture.ts | 3 + .../snapshots/1-TSESTree-AST.shot | 94 ++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 136 ++++++++++++++ .../async-ambient/snapshots/3-Babel-AST.shot | 89 +++++++++ .../snapshots/4-Babel-Tokens.shot | 136 ++++++++++++++ .../snapshots/5-AST-Alignment-AST.shot | 98 ++++++++++ .../snapshots/6-AST-Alignment-Tokens.shot | 2 +- .../fixtures/async-overload/fixture.ts | 2 + .../snapshots/1-TSESTree-AST.shot | 114 ++++++++++++ .../snapshots/2-TSESTree-Tokens.shot | 176 ++++++++++++++++++ .../async-overload/snapshots/3-Babel-AST.shot | 108 +++++++++++ .../snapshots/4-Babel-Tokens.shot | 176 ++++++++++++++++++ .../snapshots/5-AST-Alignment-AST.shot | 118 ++++++++++++ .../snapshots/6-AST-Alignment-Tokens.shot | 6 + .../generator/snapshots/1-TSESTree-AST.shot | 42 ----- .../snapshots/2-TSESTree-Tokens.shot | 76 -------- .../generator/snapshots/3-Babel-AST.shot | 40 ---- .../generator/snapshots/4-Babel-Tokens.shot | 76 -------- .../snapshots/5-AST-Alignment-AST.shot | 46 ----- .../src/declaration/TSDeclareFunction/spec.ts | 52 +++++- .../tests/fixtures-with-differences-ast.shot | 3 +- .../fixtures-with-differences-errors.shot | 5 +- .../tests/rules/consistent-return.test.ts | 2 +- .../naming-convention.test.ts | 6 +- packages/typescript-estree/src/convert.ts | 39 +++- 41 files changed, 1411 insertions(+), 302 deletions(-) create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/fixture.ts create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/fixture.ts create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/3-Alignment-Error.shot rename packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/{ => _error_}/generator/fixture.ts (100%) create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/1-TSESTree-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/2-Babel-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/3-Alignment-Error.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/fixture.ts create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/5-AST-Alignment-AST.shot rename packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/{generator => async-ambient}/snapshots/6-AST-Alignment-Tokens.shot (52%) create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/fixture.ts create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/1-TSESTree-AST.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/2-TSESTree-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/3-Babel-AST.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/4-Babel-Tokens.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/5-AST-Alignment-AST.shot create mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/6-AST-Alignment-Tokens.shot delete mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/1-TSESTree-AST.shot delete mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/2-TSESTree-Tokens.shot delete mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/3-Babel-AST.shot delete mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/4-Babel-Tokens.shot delete mode 100644 packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/5-AST-Alignment-AST.shot diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/1-TSESTree-Error.shot index 79f1c74928b..b2dfc1ae3ec 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSDeclareFunction _error_ async TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration TSDeclareFunction _error_ async TSESTree - Error 1`] = ` +"TSError +> 1 | declare async function foo(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 'async' modifier cannot be used in an ambient context. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/3-Alignment-Error.shot index 1f36cb0955f..67e64f02351 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSDeclareFunction _error_ async Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration TSDeclareFunction _error_ async Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/1-TSESTree-Error.shot index ca0dba2a0c3..c8a50d813ca 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/1-TSESTree-Error.shot @@ -1,3 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSDeclareFunction _error_ declare-with-body TSESTree - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration TSDeclareFunction _error_ declare-with-body TSESTree - Error 1`] = ` +"TSError +> 1 | declare function foo(): void {}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ An implementation cannot be declared in ambient contexts. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/3-Alignment-Error.shot index 22b125b5643..5bb32677684 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSDeclareFunction _error_ declare-with-body Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; +exports[`AST Fixtures declaration TSDeclareFunction _error_ declare-with-body Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/fixture.ts b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/fixture.ts new file mode 100644 index 00000000000..3bc9eccf097 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/fixture.ts @@ -0,0 +1,3 @@ +declare module "x" { + function* foo(): any; +} diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..804b5bd1e90 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,10 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction _error_ generator-ambient TSESTree - Error 1`] = ` +"TSError + 1 | declare module "x" { +> 2 | function* foo(): any; + | ^^^^^^^^^^^^^^^^^^^^^ A function signature cannot be declared as a generator. + 3 | } + 4 |" +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..a91598605cd --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction _error_ generator-ambient Babel - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..9a14b2e1b4b --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction _error_ generator-ambient Error Alignment 1`] = `"TSESTree errored but Babel didn't"`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/fixture.ts b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/fixture.ts new file mode 100644 index 00000000000..b3985fb6a6e --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/fixture.ts @@ -0,0 +1,2 @@ +function* foo(): any; +function* foo(): any {} diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..50e0462fd03 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction _error_ generator-overload TSESTree - Error 1`] = ` +"TSError +> 1 | function* foo(): any; + | ^^^^^^^^^^^^^^^^^^^^^ A function signature cannot be declared as a generator. + 2 | function* foo(): any {} + 3 |" +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..bf3d8c4f43d --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction _error_ generator-overload Babel - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..6c2cab494ca --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator-overload/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction _error_ generator-overload Error Alignment 1`] = `"TSESTree errored but Babel didn't"`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/fixture.ts b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/fixture.ts similarity index 100% rename from packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/fixture.ts rename to packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/fixture.ts diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..f5f1b9e0753 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction _error_ generator TSESTree - Error 1`] = ` +"TSError +> 1 | declare function* foo(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ Generators are not allowed in an ambient context. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..8cac9a65578 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction _error_ generator Babel - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..c04e69e4e12 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/generator/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction _error_ generator Error Alignment 1`] = `"TSESTree errored but Babel didn't"`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/fixture.ts b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/fixture.ts new file mode 100644 index 00000000000..b7a7f4a7cd3 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/fixture.ts @@ -0,0 +1,3 @@ +declare module 'x' { + async function foo(): any; +} diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..7d2ab1f0cd8 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,94 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction async-ambient TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: [ + TSDeclareFunction { + type: "TSDeclareFunction", + async: true, + declare: false, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + decorators: [], + name: "foo", + optional: false, + + range: [38, 41], + loc: { + start: { column: 17, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + params: [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [45, 48], + loc: { + start: { column: 24, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [43, 48], + loc: { + start: { column: 22, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [23, 49], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [19, 51], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: true, + global: false, + id: Literal { + type: "Literal", + raw: "'x'", + value: "x", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + kind: "module", + + range: [0, 51], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 52], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..6057be3fa44 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction async-ambient TSESTree - Tokens 1`] = ` +[ + Identifier { + type: "Identifier", + value: "declare", + + range: [0, 7], + loc: { + start: { column: 0, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [8, 14], + loc: { + start: { column: 8, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + String { + type: "String", + value: "'x'", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [23, 28], + loc: { + start: { column: 2, line: 2 }, + end: { column: 7, line: 2 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [29, 37], + loc: { + start: { column: 8, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [38, 41], + loc: { + start: { column: 17, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [41, 42], + loc: { + start: { column: 20, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [42, 43], + loc: { + start: { column: 21, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [43, 44], + loc: { + start: { column: 22, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [45, 48], + loc: { + start: { column: 24, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [48, 49], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [50, 51], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..c7ec3ee7ecc --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/3-Babel-AST.shot @@ -0,0 +1,89 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction async-ambient Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: [ + TSDeclareFunction { + type: "TSDeclareFunction", + async: true, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [38, 41], + loc: { + start: { column: 17, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + params: [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [45, 48], + loc: { + start: { column: 24, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [43, 48], + loc: { + start: { column: 22, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [23, 49], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [19, 51], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: true, + id: Literal { + type: "Literal", + raw: "'x'", + value: "x", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + + range: [0, 51], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 52], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..d78930b42a7 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction async-ambient Babel - Tokens 1`] = ` +[ + Identifier { + type: "Identifier", + value: "declare", + + range: [0, 7], + loc: { + start: { column: 0, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "module", + + range: [8, 14], + loc: { + start: { column: 8, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + String { + type: "String", + value: "'x'", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [23, 28], + loc: { + start: { column: 2, line: 2 }, + end: { column: 7, line: 2 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [29, 37], + loc: { + start: { column: 8, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [38, 41], + loc: { + start: { column: 17, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [41, 42], + loc: { + start: { column: 20, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [42, 43], + loc: { + start: { column: 21, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [43, 44], + loc: { + start: { column: 22, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [45, 48], + loc: { + start: { column: 24, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [48, 49], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [50, 51], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..435ae1de0ad --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,98 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction async-ambient AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSModuleDeclaration { + type: 'TSModuleDeclaration', + body: TSModuleBlock { + type: 'TSModuleBlock', + body: Array [ + TSDeclareFunction { + type: 'TSDeclareFunction', + async: true, +- declare: false, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'foo', +- optional: false, + + range: [38, 41], + loc: { + start: { column: 17, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [45, 48], + loc: { + start: { column: 24, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [43, 48], + loc: { + start: { column: 22, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [23, 49], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [19, 51], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + declare: true, +- global: false, + id: Literal { + type: 'Literal', + raw: '\\'x\\'', + value: 'x', + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, +- kind: 'module', + + range: [0, 51], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 52], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/6-AST-Alignment-Tokens.shot similarity index 52% rename from packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/6-AST-Alignment-Tokens.shot rename to packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/6-AST-Alignment-Tokens.shot index 0c5870a8a61..7dbd5a90725 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-ambient/snapshots/6-AST-Alignment-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSDeclareFunction generator AST Alignment - Token 1`] = ` +exports[`AST Fixtures declaration TSDeclareFunction async-ambient AST Alignment - Token 1`] = ` "Snapshot Diff: Compared values have no visual difference." `; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/fixture.ts b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/fixture.ts new file mode 100644 index 00000000000..31dd56160e4 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/fixture.ts @@ -0,0 +1,2 @@ +async function foo(): any; +async function foo(): any {} diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..325d2fb0435 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction async-overload TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + TSDeclareFunction { + type: "TSDeclareFunction", + async: true, + declare: false, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + decorators: [], + name: "foo", + optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + params: [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [22, 25], + loc: { + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [20, 25], + loc: { + start: { column: 20, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + FunctionDeclaration { + type: "FunctionDeclaration", + async: true, + body: BlockStatement { + type: "BlockStatement", + body: [], + + range: [53, 55], + loc: { + start: { column: 26, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + declare: false, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + decorators: [], + name: "foo", + optional: false, + + range: [42, 45], + loc: { + start: { column: 15, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + params: [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [49, 52], + loc: { + start: { column: 22, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [47, 52], + loc: { + start: { column: 20, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [27, 55], + loc: { + start: { column: 0, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + sourceType: "script", + + range: [0, 56], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 3 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..213de06b48f --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction async-overload TSESTree - Tokens 1`] = ` +[ + Identifier { + type: "Identifier", + value: "async", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [6, 14], + loc: { + start: { column: 6, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [22, 25], + loc: { + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [27, 32], + loc: { + start: { column: 0, line: 2 }, + end: { column: 5, line: 2 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [33, 41], + loc: { + start: { column: 6, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [42, 45], + loc: { + start: { column: 15, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [45, 46], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [46, 47], + loc: { + start: { column: 19, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [47, 48], + loc: { + start: { column: 20, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [49, 52], + loc: { + start: { column: 22, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [53, 54], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [54, 55], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..09174cb2b0e --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/3-Babel-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction async-overload Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + TSDeclareFunction { + type: "TSDeclareFunction", + async: true, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + params: [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [22, 25], + loc: { + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [20, 25], + loc: { + start: { column: 20, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + FunctionDeclaration { + type: "FunctionDeclaration", + async: true, + body: BlockStatement { + type: "BlockStatement", + body: [], + + range: [53, 55], + loc: { + start: { column: 26, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "foo", + + range: [42, 45], + loc: { + start: { column: 15, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + params: [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSAnyKeyword { + type: "TSAnyKeyword", + + range: [49, 52], + loc: { + start: { column: 22, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [47, 52], + loc: { + start: { column: 20, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [27, 55], + loc: { + start: { column: 0, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + sourceType: "script", + + range: [0, 56], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 3 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..ca4d328c84d --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction async-overload Babel - Tokens 1`] = ` +[ + Identifier { + type: "Identifier", + value: "async", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [6, 14], + loc: { + start: { column: 6, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [22, 25], + loc: { + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "async", + + range: [27, 32], + loc: { + start: { column: 0, line: 2 }, + end: { column: 5, line: 2 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [33, 41], + loc: { + start: { column: 6, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [42, 45], + loc: { + start: { column: 15, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [45, 46], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [46, 47], + loc: { + start: { column: 19, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [47, 48], + loc: { + start: { column: 20, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "any", + + range: [49, 52], + loc: { + start: { column: 22, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [53, 54], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [54, 55], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..2515ee9a01e --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,118 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction async-overload AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSDeclareFunction { + type: 'TSDeclareFunction', + async: true, +- declare: false, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'foo', +- optional: false, + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [22, 25], + loc: { + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [20, 25], + loc: { + start: { column: 20, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + FunctionDeclaration { + type: 'FunctionDeclaration', + async: true, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [53, 55], + loc: { + start: { column: 26, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, +- declare: false, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'foo', +- optional: false, + + range: [42, 45], + loc: { + start: { column: 15, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + params: Array [], + returnType: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSAnyKeyword { + type: 'TSAnyKeyword', + + range: [49, 52], + loc: { + start: { column: 22, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [47, 52], + loc: { + start: { column: 20, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [27, 55], + loc: { + start: { column: 0, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 56], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 3 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..b6b9fa4d737 --- /dev/null +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/async-overload/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration TSDeclareFunction async-overload AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/1-TSESTree-AST.shot deleted file mode 100644 index b621f52027b..00000000000 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/1-TSESTree-AST.shot +++ /dev/null @@ -1,42 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration TSDeclareFunction generator TSESTree - AST 1`] = ` -Program { - type: "Program", - body: [ - TSDeclareFunction { - type: "TSDeclareFunction", - async: false, - declare: true, - expression: false, - generator: true, - id: Identifier { - type: "Identifier", - decorators: [], - name: "foo", - optional: false, - - range: [18, 21], - loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, - }, - }, - params: [], - - range: [0, 24], - loc: { - start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, - ], - sourceType: "script", - - range: [0, 25], - loc: { - start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, - }, -} -`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/2-TSESTree-Tokens.shot deleted file mode 100644 index 42e396c0099..00000000000 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/2-TSESTree-Tokens.shot +++ /dev/null @@ -1,76 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration TSDeclareFunction generator TSESTree - Tokens 1`] = ` -[ - Identifier { - type: "Identifier", - value: "declare", - - range: [0, 7], - loc: { - start: { column: 0, line: 1 }, - end: { column: 7, line: 1 }, - }, - }, - Keyword { - type: "Keyword", - value: "function", - - range: [8, 16], - loc: { - start: { column: 8, line: 1 }, - end: { column: 16, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "*", - - range: [16, 17], - loc: { - start: { column: 16, line: 1 }, - end: { column: 17, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "foo", - - range: [18, 21], - loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "(", - - range: [21, 22], - loc: { - start: { column: 21, line: 1 }, - end: { column: 22, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ")", - - range: [22, 23], - loc: { - start: { column: 22, line: 1 }, - end: { column: 23, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [23, 24], - loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, -] -`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/3-Babel-AST.shot deleted file mode 100644 index 26ccbf892c1..00000000000 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/3-Babel-AST.shot +++ /dev/null @@ -1,40 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration TSDeclareFunction generator Babel - AST 1`] = ` -Program { - type: "Program", - body: [ - TSDeclareFunction { - type: "TSDeclareFunction", - async: false, - declare: true, - expression: false, - generator: true, - id: Identifier { - type: "Identifier", - name: "foo", - - range: [18, 21], - loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, - }, - }, - params: [], - - range: [0, 24], - loc: { - start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, - ], - sourceType: "script", - - range: [0, 25], - loc: { - start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, - }, -} -`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/4-Babel-Tokens.shot deleted file mode 100644 index 76c88da05a1..00000000000 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/4-Babel-Tokens.shot +++ /dev/null @@ -1,76 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration TSDeclareFunction generator Babel - Tokens 1`] = ` -[ - Identifier { - type: "Identifier", - value: "declare", - - range: [0, 7], - loc: { - start: { column: 0, line: 1 }, - end: { column: 7, line: 1 }, - }, - }, - Keyword { - type: "Keyword", - value: "function", - - range: [8, 16], - loc: { - start: { column: 8, line: 1 }, - end: { column: 16, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "*", - - range: [16, 17], - loc: { - start: { column: 16, line: 1 }, - end: { column: 17, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "foo", - - range: [18, 21], - loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "(", - - range: [21, 22], - loc: { - start: { column: 21, line: 1 }, - end: { column: 22, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ")", - - range: [22, 23], - loc: { - start: { column: 22, line: 1 }, - end: { column: 23, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [23, 24], - loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, -] -`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/5-AST-Alignment-AST.shot deleted file mode 100644 index f2de95210fa..00000000000 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/5-AST-Alignment-AST.shot +++ /dev/null @@ -1,46 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration TSDeclareFunction generator AST Alignment - AST 1`] = ` -"Snapshot Diff: -- TSESTree -+ Babel - - Program { - type: 'Program', - body: Array [ - TSDeclareFunction { - type: 'TSDeclareFunction', - async: false, - declare: true, - expression: false, - generator: true, - id: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'foo', -- optional: false, - - range: [18, 21], - loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, - }, - }, - params: Array [], - - range: [0, 24], - loc: { - start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, - ], - sourceType: 'script', - - range: [0, 25], - loc: { - start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, - }, - }" -`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/spec.ts b/packages/ast-spec/src/declaration/TSDeclareFunction/spec.ts index 50cc07ec424..ab75a908aa8 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/spec.ts +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/spec.ts @@ -1,11 +1,55 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { FunctionBase } from '../../base/FunctionBase'; -import type { BlockStatement } from '../../statement/BlockStatement/spec'; -// TODO(#1852) - async + declare are semantically invalid together -export interface TSDeclareFunction extends FunctionBase { +interface TSDeclareFunctionBase extends FunctionBase { type: AST_NODE_TYPES.TSDeclareFunction; - body: BlockStatement | undefined; + /** + * TS1183: An implementation cannot be declared in ambient contexts. + */ + body: undefined; + /** + * Whether the declaration has `declare` modifier. + */ declare: boolean; expression: false; } + +/** + * Function declaration with the `declare` keyword: + * ``` + * declare function foo(): void; + * ``` + */ +export interface TSDeclareFunctionWithDeclare extends TSDeclareFunctionBase { + /** + * TS1040: 'async' modifier cannot be used in an ambient context. + */ + async: false; + declare: true; + /** + * TS1221: Generators are not allowed in an ambient context. + */ + generator: false; +} + +/** + * Function declaration without the `declare` keyword: + * ``` + * function foo(): void; + * ``` + * This can either be an overload signature or a declaration in an ambient context + * (e.g. `declare module`) + */ + +export interface TSDeclareFunctionNoDeclare extends TSDeclareFunctionBase { + declare: false; + /** + * - TS1221: Generators are not allowed in an ambient context. + * - TS1222: An overload signature cannot be declared as a generator. + */ + generator: false; +} + +export type TSDeclareFunction = + | TSDeclareFunctionNoDeclare + | TSDeclareFunctionWithDeclare; diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot index 40921644512..fe7cf666fec 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot @@ -56,8 +56,9 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = ` "declaration/ImportDeclaration/fixtures/named-none/fixture.ts", "declaration/ImportDeclaration/fixtures/named-one/fixture.ts", "declaration/ImportDeclaration/fixtures/side-effect/fixture.ts", + "declaration/TSDeclareFunction/fixtures/async-ambient/fixture.ts", + "declaration/TSDeclareFunction/fixtures/async-overload/fixture.ts", "declaration/TSDeclareFunction/fixtures/empty/fixture.ts", - "declaration/TSDeclareFunction/fixtures/generator/fixture.ts", "declaration/TSDeclareFunction/fixtures/param-many/fixture.ts", "declaration/TSDeclareFunction/fixtures/param-one/fixture.ts", "declaration/TSDeclareFunction/fixtures/returnType/fixture.ts", diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 4932aead790..76663a6ec6c 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -8,8 +8,6 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = ` "declaration/ClassDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture.ts", "declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/fixture.ts", - "declaration/TSDeclareFunction/fixtures/_error_/async/fixture.ts", - "declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/fixture.ts", "declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/fixture.ts", "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/fixture.ts", @@ -48,6 +46,9 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = ` "TSESTree errored but Babel didn't": [ "declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts", + "declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/fixture.ts", + "declaration/TSDeclareFunction/fixtures/_error_/generator-overload/fixture.ts", + "declaration/TSDeclareFunction/fixtures/_error_/generator/fixture.ts", "element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/fixture.ts", "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/fixture.ts", "legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/fixture.ts", diff --git a/packages/eslint-plugin/tests/rules/consistent-return.test.ts b/packages/eslint-plugin/tests/rules/consistent-return.test.ts index 1489b835d8b..cb74ca29b8c 100644 --- a/packages/eslint-plugin/tests/rules/consistent-return.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-return.test.ts @@ -380,7 +380,7 @@ ruleTester.run('consistent-return', rule, { }, { code: ` - declare async function bar(): Promise; + declare function bar(): Promise; function foo(flag?: boolean): Promise { if (flag) { return bar(); diff --git a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts index 85fa8450ad2..0f956df18c0 100644 --- a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts +++ b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts @@ -466,11 +466,11 @@ ruleTester.run('naming-convention', rule, { { const camelCaseVar = 1; function camelCaseFunction() {} - declare function camelCaseDeclaredFunction() {}; + declare function camelCaseDeclaredFunction(); } const PascalCaseVar = 1; function PascalCaseFunction() {} - declare function PascalCaseDeclaredFunction() {}; + declare function PascalCaseDeclaredFunction(); `, options: [ { selector: 'default', format: ['camelCase'] }, @@ -1507,7 +1507,7 @@ ruleTester.run('naming-convention', rule, { code: ` const PascalCaseVar = 1; function PascalCaseFunction() {} - declare function PascalCaseDeclaredFunction() {}; + declare function PascalCaseDeclaredFunction(); `, options: [ { selector: 'default', format: ['snake_case'] }, diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 52e4b16baf0..525f03481c3 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -963,19 +963,46 @@ export class Converter { case SyntaxKind.FunctionDeclaration: { const isDeclare = hasModifier(SyntaxKind.DeclareKeyword, node); + const isAsync = hasModifier(SyntaxKind.AsyncKeyword, node); + const isGenerator = !!node.asteriskToken; + if (isDeclare) { + if (node.body) { + this.#throwError( + node, + 'An implementation cannot be declared in ambient contexts.', + ); + } else if (isAsync) { + this.#throwError( + node, + "'async' modifier cannot be used in an ambient context.", + ); + } else if (isGenerator) { + this.#throwError( + node, + 'Generators are not allowed in an ambient context.', + ); + } + } else { + if (!node.body && isGenerator) { + this.#throwError( + node, + 'A function signature cannot be declared as a generator.', + ); + } + } const result = this.createNode< TSESTree.FunctionDeclaration | TSESTree.TSDeclareFunction >(node, { - type: - isDeclare || !node.body - ? AST_NODE_TYPES.TSDeclareFunction - : AST_NODE_TYPES.FunctionDeclaration, - async: hasModifier(SyntaxKind.AsyncKeyword, node), + // declare implies no body due to the invariant above + type: !node.body + ? AST_NODE_TYPES.TSDeclareFunction + : AST_NODE_TYPES.FunctionDeclaration, + async: isAsync, body: this.convertChild(node.body) || undefined, declare: isDeclare, expression: false, - generator: !!node.asteriskToken, + generator: isGenerator, id: this.convertChild(node.name), params: this.convertParameters(node.parameters), returnType: node.type && this.convertTypeAnnotation(node.type, node), From 2b770006d0e2d54dd2866b8d790f119a537b9398 Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Tue, 4 Jun 2024 15:35:53 +0800 Subject: [PATCH 12/23] fix(ast-spec): function-call-like callee should be Expression not LeftHandSideExpression (#9231) --- packages/ast-spec/src/base/UnaryExpressionBase.ts | 6 ++---- packages/ast-spec/src/expression/CallExpression/spec.ts | 4 ++-- packages/ast-spec/src/expression/ClassExpression/spec.ts | 1 - packages/ast-spec/src/expression/NewExpression/spec.ts | 4 ++-- .../src/expression/TaggedTemplateExpression/spec.ts | 4 ++-- .../src/rules/plugin-test-formatting.ts | 4 +--- packages/eslint-plugin/src/rules/no-implied-eval.ts | 4 +--- packages/eslint-plugin/src/rules/no-unsafe-argument.ts | 2 +- 8 files changed, 11 insertions(+), 18 deletions(-) diff --git a/packages/ast-spec/src/base/UnaryExpressionBase.ts b/packages/ast-spec/src/base/UnaryExpressionBase.ts index feb681ccbc3..6401c7e73fb 100644 --- a/packages/ast-spec/src/base/UnaryExpressionBase.ts +++ b/packages/ast-spec/src/base/UnaryExpressionBase.ts @@ -1,10 +1,8 @@ -import type { UnaryExpression } from '../expression/UnaryExpression/spec'; -import type { LeftHandSideExpression } from '../unions/LeftHandSideExpression'; -import type { Literal } from '../unions/Literal'; +import type { Expression } from '../unions/Expression'; import type { BaseNode } from './BaseNode'; export interface UnaryExpressionBase extends BaseNode { operator: string; prefix: boolean; - argument: LeftHandSideExpression | Literal | UnaryExpression; + argument: Expression; } diff --git a/packages/ast-spec/src/expression/CallExpression/spec.ts b/packages/ast-spec/src/expression/CallExpression/spec.ts index b7569c9892e..2706ca6b4a1 100644 --- a/packages/ast-spec/src/expression/CallExpression/spec.ts +++ b/packages/ast-spec/src/expression/CallExpression/spec.ts @@ -2,11 +2,11 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { TSTypeParameterInstantiation } from '../../special/TSTypeParameterInstantiation/spec'; import type { CallExpressionArgument } from '../../unions/CallExpressionArgument'; -import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression'; +import type { Expression } from '../../unions/Expression'; export interface CallExpression extends BaseNode { type: AST_NODE_TYPES.CallExpression; - callee: LeftHandSideExpression; + callee: Expression; arguments: CallExpressionArgument[]; typeArguments: TSTypeParameterInstantiation | undefined; diff --git a/packages/ast-spec/src/expression/ClassExpression/spec.ts b/packages/ast-spec/src/expression/ClassExpression/spec.ts index dbd4936f67c..71a7be13140 100644 --- a/packages/ast-spec/src/expression/ClassExpression/spec.ts +++ b/packages/ast-spec/src/expression/ClassExpression/spec.ts @@ -5,5 +5,4 @@ export interface ClassExpression extends ClassBase { type: AST_NODE_TYPES.ClassExpression; abstract: false; declare: false; - decorators: []; } diff --git a/packages/ast-spec/src/expression/NewExpression/spec.ts b/packages/ast-spec/src/expression/NewExpression/spec.ts index 51aea284158..de45a835764 100644 --- a/packages/ast-spec/src/expression/NewExpression/spec.ts +++ b/packages/ast-spec/src/expression/NewExpression/spec.ts @@ -2,11 +2,11 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { TSTypeParameterInstantiation } from '../../special/TSTypeParameterInstantiation/spec'; import type { CallExpressionArgument } from '../../unions/CallExpressionArgument'; -import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression'; +import type { Expression } from '../../unions/Expression'; export interface NewExpression extends BaseNode { type: AST_NODE_TYPES.NewExpression; - callee: LeftHandSideExpression; + callee: Expression; arguments: CallExpressionArgument[]; typeArguments: TSTypeParameterInstantiation | undefined; diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/spec.ts b/packages/ast-spec/src/expression/TaggedTemplateExpression/spec.ts index b673ca5f0db..2e2d77e68db 100644 --- a/packages/ast-spec/src/expression/TaggedTemplateExpression/spec.ts +++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/spec.ts @@ -1,7 +1,7 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { TSTypeParameterInstantiation } from '../../special/TSTypeParameterInstantiation/spec'; -import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression'; +import type { Expression } from '../../unions/Expression'; import type { TemplateLiteral } from '../TemplateLiteral/spec'; export interface TaggedTemplateExpression extends BaseNode { @@ -11,6 +11,6 @@ export interface TaggedTemplateExpression extends BaseNode { /** @deprecated Use {@link `typeArguments`} instead. */ typeParameters: TSTypeParameterInstantiation | undefined; - tag: LeftHandSideExpression; + tag: Expression; quasi: TemplateLiteral; } diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts index 6c0f716d79e..20a40146528 100644 --- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -426,9 +426,7 @@ export default createRule({ } } - function isNoFormatTemplateTag( - tag: TSESTree.LeftHandSideExpression, - ): boolean { + function isNoFormatTemplateTag(tag: TSESTree.Expression): boolean { return tag.type === AST_NODE_TYPES.Identifier && tag.name === 'noFormat'; } diff --git a/packages/eslint-plugin/src/rules/no-implied-eval.ts b/packages/eslint-plugin/src/rules/no-implied-eval.ts index de2e0574929..dee23d62d27 100644 --- a/packages/eslint-plugin/src/rules/no-implied-eval.ts +++ b/packages/eslint-plugin/src/rules/no-implied-eval.ts @@ -36,9 +36,7 @@ export default createRule({ const services = getParserServices(context); const checker = services.program.getTypeChecker(); - function getCalleeName( - node: TSESTree.LeftHandSideExpression, - ): string | null { + function getCalleeName(node: TSESTree.Expression): string | null { if (node.type === AST_NODE_TYPES.Identifier) { return node.name; } diff --git a/packages/eslint-plugin/src/rules/no-unsafe-argument.ts b/packages/eslint-plugin/src/rules/no-unsafe-argument.ts index d55d8f75b06..08950fa8d73 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-argument.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-argument.ts @@ -165,7 +165,7 @@ export default createRule<[], MessageIds>({ function checkUnsafeArguments( args: TSESTree.Expression[] | TSESTree.CallExpressionArgument[], - callee: TSESTree.LeftHandSideExpression, + callee: TSESTree.Expression, node: | TSESTree.CallExpression | TSESTree.NewExpression From 834332ffe060f61ec709a5d5e70f65c02ef6dbfc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 06:55:08 -0400 Subject: [PATCH 13/23] chore(deps): update docusaurus to v3.4.0 (#9235) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 424 +++++++++++++++++++++++++++--------------------------- 1 file changed, 214 insertions(+), 210 deletions(-) diff --git a/yarn.lock b/yarn.lock index 796c7b42f79..0f88a624ba6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2370,9 +2370,9 @@ __metadata: languageName: node linkType: hard -"@docusaurus/core@npm:3.3.2, @docusaurus/core@npm:^3.2.1": - version: 3.3.2 - resolution: "@docusaurus/core@npm:3.3.2" +"@docusaurus/core@npm:3.4.0, @docusaurus/core@npm:^3.2.1": + version: 3.4.0 + resolution: "@docusaurus/core@npm:3.4.0" dependencies: "@babel/core": ^7.23.3 "@babel/generator": ^7.23.3 @@ -2384,12 +2384,12 @@ __metadata: "@babel/runtime": ^7.22.6 "@babel/runtime-corejs3": ^7.22.6 "@babel/traverse": ^7.22.8 - "@docusaurus/cssnano-preset": 3.3.2 - "@docusaurus/logger": 3.3.2 - "@docusaurus/mdx-loader": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-common": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 + "@docusaurus/cssnano-preset": 3.4.0 + "@docusaurus/logger": 3.4.0 + "@docusaurus/mdx-loader": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-common": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 autoprefixer: ^10.4.14 babel-loader: ^9.1.3 babel-plugin-dynamic-import-node: ^2.3.3 @@ -2447,39 +2447,39 @@ __metadata: react-dom: ^18.0.0 bin: docusaurus: bin/docusaurus.mjs - checksum: 4b5100c0695f896f53a2a2103a3cd7d1685cf9708982dc13c391a2cae73d6f32dd76e9357b1771c18d3b08df4f90f3ee135b9260a5941e01e3211934dedfd93e + checksum: b7417648fedd1b0821332b86c7e64e68c70bfe02f393db032b50942856706a0b02d2d9e713d3cc979c4129a88e80319007f60263d48f1ede2499611ae20be8ec languageName: node linkType: hard -"@docusaurus/cssnano-preset@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/cssnano-preset@npm:3.3.2" +"@docusaurus/cssnano-preset@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/cssnano-preset@npm:3.4.0" dependencies: cssnano-preset-advanced: ^6.1.2 postcss: ^8.4.38 postcss-sort-media-queries: ^5.2.0 tslib: ^2.6.0 - checksum: cdb7b09a879e3f20faa2cd274bf37cb6b9d760a66268799f384be583e327b2269559e0fc2ee7d77ee5febe7293a4c4866edee8dd439efcef4d5545362e802838 + checksum: cc1892257cd49d752df615f6194b32ce810cdbf71b4fd32aa268cbd4b41071991d5573fca77417cc1f4cc1f85a9097d8cbc6d8eb413292a5d38b8d062e39489a languageName: node linkType: hard -"@docusaurus/logger@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/logger@npm:3.3.2" +"@docusaurus/logger@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/logger@npm:3.4.0" dependencies: chalk: ^4.1.2 tslib: ^2.6.0 - checksum: 8d45a67d55d6e829a3edcc49673864247e4ce0a6a0a342728d1b3afe48eeb4226202513dc1ef63d2b1229fd86f0bc0fdc11bba982e0fa444f2805395eab44e43 + checksum: 7da9bc96d47ab70674d6d17d1653fc3cef2366dd8a900078c9a1b43dfbc2edc500febbcbc4976afd21c26f3c6812af28baf2bba832f3ed4c1a106b4599e3febe languageName: node linkType: hard -"@docusaurus/mdx-loader@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/mdx-loader@npm:3.3.2" +"@docusaurus/mdx-loader@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/mdx-loader@npm:3.4.0" dependencies: - "@docusaurus/logger": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 + "@docusaurus/logger": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 "@mdx-js/mdx": ^3.0.0 "@slorber/remark-comment": ^1.0.0 escape-html: ^1.0.3 @@ -2504,15 +2504,15 @@ __metadata: peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: 98a800ec05cf9d5da85d3109a5cb62eb5876d25126209fe9502ef45e8a9742e0a7d6d63c8a9a35f09001555828210660232f5500b9ea248d813db146ab2d4571 + checksum: d85781ef53fe78b56dc1db305be8b7619392ebfaeaa95cfc3297d639b8e6a77415c81e80065a93c7bc24cc95211879eb1548457d3ebcc700523171a192e2959e languageName: node linkType: hard -"@docusaurus/module-type-aliases@npm:3.3.2, @docusaurus/module-type-aliases@npm:^3.2.1": - version: 3.3.2 - resolution: "@docusaurus/module-type-aliases@npm:3.3.2" +"@docusaurus/module-type-aliases@npm:3.4.0, @docusaurus/module-type-aliases@npm:^3.2.1": + version: 3.4.0 + resolution: "@docusaurus/module-type-aliases@npm:3.4.0" dependencies: - "@docusaurus/types": 3.3.2 + "@docusaurus/types": 3.4.0 "@types/history": ^4.7.11 "@types/react": "*" "@types/react-router-config": "*" @@ -2522,19 +2522,19 @@ __metadata: peerDependencies: react: "*" react-dom: "*" - checksum: 858f734379daac5622dfc04fa7f6b90bcffd33a5e7972d2f47c3b820564ea62f3e0b27bc1a55bc47ea3a23a52342bec844ce0db0bfcfcaf12e39490acd34e72a + checksum: d2054c07455cb19bbb48aa8d00c9409066172716bf0a00780b9044975c1250c65de6eb25368392085f2f52f9d882ee8c9285ae65bc2e6e7bbaefa5ebb7866edd languageName: node linkType: hard "@docusaurus/plugin-client-redirects@npm:^3.2.1": - version: 3.3.2 - resolution: "@docusaurus/plugin-client-redirects@npm:3.3.2" - dependencies: - "@docusaurus/core": 3.3.2 - "@docusaurus/logger": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-common": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 + version: 3.4.0 + resolution: "@docusaurus/plugin-client-redirects@npm:3.4.0" + dependencies: + "@docusaurus/core": 3.4.0 + "@docusaurus/logger": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-common": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 eta: ^2.2.0 fs-extra: ^11.1.1 lodash: ^4.17.21 @@ -2542,21 +2542,21 @@ __metadata: peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: 9e3cb2e9180d27018681e9e0991b314bc1b0f664af6f236257538b96fef7e1f8c83879e611f4e85ac6ee92b29f903144a5afc3d9592f55bf120b52e8cc5eea2f + checksum: ebeff632ca5bf82a115459026c401759e3631442197d892f808e5608dacdfbcb13592b4a9c8b3718c8f25c6fac3471ceeafa4fd2f10f73ffe4b6693b7a3e29f9 languageName: node linkType: hard -"@docusaurus/plugin-content-blog@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/plugin-content-blog@npm:3.3.2" - dependencies: - "@docusaurus/core": 3.3.2 - "@docusaurus/logger": 3.3.2 - "@docusaurus/mdx-loader": 3.3.2 - "@docusaurus/types": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-common": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 +"@docusaurus/plugin-content-blog@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/plugin-content-blog@npm:3.4.0" + dependencies: + "@docusaurus/core": 3.4.0 + "@docusaurus/logger": 3.4.0 + "@docusaurus/mdx-loader": 3.4.0 + "@docusaurus/types": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-common": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 cheerio: ^1.0.0-rc.12 feed: ^4.2.2 fs-extra: ^11.1.1 @@ -2570,22 +2570,22 @@ __metadata: peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: e8a10b6b68dbc1396d60df3bff300f1e7220a46a24febb310b4432ed882cd3dd97c8c9bf9740d4a67935ae66d9826f87e2c5cbd037c8fa0a9e88819e5548f3b4 + checksum: d1ee5a8df0f078a2ac0b176ea29ed2714beaef51b79762797b5d70191ef931a91dceb12c3f6f2d51fb083b1fe6a0c41693dd65dce4e3a5bef6a0c76b3415c4d1 languageName: node linkType: hard -"@docusaurus/plugin-content-docs@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/plugin-content-docs@npm:3.3.2" - dependencies: - "@docusaurus/core": 3.3.2 - "@docusaurus/logger": 3.3.2 - "@docusaurus/mdx-loader": 3.3.2 - "@docusaurus/module-type-aliases": 3.3.2 - "@docusaurus/types": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-common": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 +"@docusaurus/plugin-content-docs@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/plugin-content-docs@npm:3.4.0" + dependencies: + "@docusaurus/core": 3.4.0 + "@docusaurus/logger": 3.4.0 + "@docusaurus/mdx-loader": 3.4.0 + "@docusaurus/module-type-aliases": 3.4.0 + "@docusaurus/types": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-common": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 "@types/react-router-config": ^5.0.7 combine-promises: ^1.1.0 fs-extra: ^11.1.1 @@ -2597,104 +2597,105 @@ __metadata: peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: 410b223268d50878e96dc072a6172eaf5d4fb53d7a6f23465029abc1e201acd0a4b8da4b05af2df2dafb0172642c35b2ee19a49107a8c63ab1dd10e1a11f15f7 + checksum: fcdffe6a8270f4ac5803fdbc46860b3454675d2c280c6c518c3934f055d6d78542e69968d8a8bc10515f53514331813a6f5c0c18ceccec2d7fdd185352072f81 languageName: node linkType: hard -"@docusaurus/plugin-content-pages@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/plugin-content-pages@npm:3.3.2" +"@docusaurus/plugin-content-pages@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/plugin-content-pages@npm:3.4.0" dependencies: - "@docusaurus/core": 3.3.2 - "@docusaurus/mdx-loader": 3.3.2 - "@docusaurus/types": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 + "@docusaurus/core": 3.4.0 + "@docusaurus/mdx-loader": 3.4.0 + "@docusaurus/types": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 fs-extra: ^11.1.1 tslib: ^2.6.0 webpack: ^5.88.1 peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: 185ba1cb6abe4feea03724015185cd1ef585db2dad9be182cb19f1205e32b19abcc8ea3d96bd1ab4c85190255c682e5c190628b2bf19e2bd66e2903e4cf7146b + checksum: bc175e5ddd0ea77d3a3efc4c2e530e1dc8024ae135f8ed4877f98bbaa5f19713bd80b9576530e39f856dfbf91578433873c89c851e64d175473fbf4a36eb36a1 languageName: node linkType: hard -"@docusaurus/plugin-debug@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/plugin-debug@npm:3.3.2" +"@docusaurus/plugin-debug@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/plugin-debug@npm:3.4.0" dependencies: - "@docusaurus/core": 3.3.2 - "@docusaurus/types": 3.3.2 - "@docusaurus/utils": 3.3.2 + "@docusaurus/core": 3.4.0 + "@docusaurus/types": 3.4.0 + "@docusaurus/utils": 3.4.0 fs-extra: ^11.1.1 react-json-view-lite: ^1.2.0 tslib: ^2.6.0 peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: 043a025c160fb1cfb0149a8b939d0b8c54e2e79754fba5430112f476dc5f21650de54df8bab7bbf55f4677b914b5e115df8c24d6e2aca08345d54fd3784d1336 + checksum: f07caeed0608a62c447b1a495e48fa8fcc8248d9c385887e2e814bb7610ff09b4ab2d7b10ba8ecc5024880a4e37d958fcd99aa4684406a946d92121ab94149c1 languageName: node linkType: hard -"@docusaurus/plugin-google-analytics@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/plugin-google-analytics@npm:3.3.2" +"@docusaurus/plugin-google-analytics@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/plugin-google-analytics@npm:3.4.0" dependencies: - "@docusaurus/core": 3.3.2 - "@docusaurus/types": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 + "@docusaurus/core": 3.4.0 + "@docusaurus/types": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 tslib: ^2.6.0 peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: a472f5c94114a298b73e39cda5ba09dde0cc00e85943de7dbb9294ddc650e33bc7ce9999df7946b9f56488cb1843393c389c95c5958ce3a36a366dc663046641 + checksum: ade51012397c12dbe7d0563ad7b2e345e3acbbd7729bf490b6d0f0cc2527b91abdd41b31392786c4697591d5b1f066f9ad257f483deaa2f2ea5194e33e3cd821 languageName: node linkType: hard -"@docusaurus/plugin-google-gtag@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/plugin-google-gtag@npm:3.3.2" +"@docusaurus/plugin-google-gtag@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/plugin-google-gtag@npm:3.4.0" dependencies: - "@docusaurus/core": 3.3.2 - "@docusaurus/types": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 + "@docusaurus/core": 3.4.0 + "@docusaurus/types": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 "@types/gtag.js": ^0.0.12 tslib: ^2.6.0 peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: 8597cc183ce7432af0aeedfb1bc042f41c6a2b87b6968dd8ce0767419b4088e02e96fd3c1710e74821404155a04627907182a11f31a5dc4f525a4a4ed8593196 + checksum: bab50eecf16d41b3a6896f0f222477495be63a195d012725042df6ea43a25281ca6929422b3b1ca901ae4127cf2000c05432afd01c69430fe973dc5a9ad35b9d languageName: node linkType: hard -"@docusaurus/plugin-google-tag-manager@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/plugin-google-tag-manager@npm:3.3.2" +"@docusaurus/plugin-google-tag-manager@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/plugin-google-tag-manager@npm:3.4.0" dependencies: - "@docusaurus/core": 3.3.2 - "@docusaurus/types": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 + "@docusaurus/core": 3.4.0 + "@docusaurus/types": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 tslib: ^2.6.0 peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: 9df287d72e0c56fea6fb1ffca0bf32423a91736ce95c79e52575295aafd0a5422463672b4ca9cbb185d220526756422ead477dc2bedb57230f73a853cba8f28d + checksum: 0b3e98856b81d66ba756fb2504bf54dbe24372fca0b4c298b6e83339be7c7c970c759bce3a4321b73c117d5eeef962f3395651100832bb3618f6cdb87f133b15 languageName: node linkType: hard "@docusaurus/plugin-pwa@npm:^3.2.1": - version: 3.3.2 - resolution: "@docusaurus/plugin-pwa@npm:3.3.2" + version: 3.4.0 + resolution: "@docusaurus/plugin-pwa@npm:3.4.0" dependencies: "@babel/core": ^7.23.3 "@babel/preset-env": ^7.23.3 - "@docusaurus/core": 3.3.2 - "@docusaurus/theme-common": 3.3.2 - "@docusaurus/theme-translations": 3.3.2 - "@docusaurus/types": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 + "@docusaurus/core": 3.4.0 + "@docusaurus/logger": 3.4.0 + "@docusaurus/theme-common": 3.4.0 + "@docusaurus/theme-translations": 3.4.0 + "@docusaurus/types": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 babel-loader: ^9.1.3 clsx: ^2.0.0 core-js: ^3.31.1 @@ -2709,83 +2710,83 @@ __metadata: peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: e43ab564307874646c4227ad5704bfa7eee7c3ae8512f7c74143cffd6fdd59ee195d046802be9c446e052d64294e188d14615cfa4e0929f855bbeb45f2cec087 + checksum: 88b1245671b137c41d04e57acf4e44b80a8ea374fc65b1798037a2faeb1fad1a2633fe2a3f6d9cd86b14b697d1f90c4de677e832687d7b5cd7dafb69f4b28c87 languageName: node linkType: hard -"@docusaurus/plugin-sitemap@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/plugin-sitemap@npm:3.3.2" - dependencies: - "@docusaurus/core": 3.3.2 - "@docusaurus/logger": 3.3.2 - "@docusaurus/types": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-common": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 +"@docusaurus/plugin-sitemap@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/plugin-sitemap@npm:3.4.0" + dependencies: + "@docusaurus/core": 3.4.0 + "@docusaurus/logger": 3.4.0 + "@docusaurus/types": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-common": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 fs-extra: ^11.1.1 sitemap: ^7.1.1 tslib: ^2.6.0 peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: 65f813901476c81e94003e87f839c2e85d9662808215f0148a2aad39da2b97f43ab213543e5d40221bfb71e642b953e39601447d92f294a437b390e20c556ab4 + checksum: fb2163fbedbdf7952e1ac35faad98e730519a03cc620d371b7e76e5376e8344f903f3612297a76f09593b9fb94256035f47c0bd7c8c5e908a2cdbfd9fc44516f languageName: node linkType: hard "@docusaurus/preset-classic@npm:^3.2.1": - version: 3.3.2 - resolution: "@docusaurus/preset-classic@npm:3.3.2" - dependencies: - "@docusaurus/core": 3.3.2 - "@docusaurus/plugin-content-blog": 3.3.2 - "@docusaurus/plugin-content-docs": 3.3.2 - "@docusaurus/plugin-content-pages": 3.3.2 - "@docusaurus/plugin-debug": 3.3.2 - "@docusaurus/plugin-google-analytics": 3.3.2 - "@docusaurus/plugin-google-gtag": 3.3.2 - "@docusaurus/plugin-google-tag-manager": 3.3.2 - "@docusaurus/plugin-sitemap": 3.3.2 - "@docusaurus/theme-classic": 3.3.2 - "@docusaurus/theme-common": 3.3.2 - "@docusaurus/theme-search-algolia": 3.3.2 - "@docusaurus/types": 3.3.2 + version: 3.4.0 + resolution: "@docusaurus/preset-classic@npm:3.4.0" + dependencies: + "@docusaurus/core": 3.4.0 + "@docusaurus/plugin-content-blog": 3.4.0 + "@docusaurus/plugin-content-docs": 3.4.0 + "@docusaurus/plugin-content-pages": 3.4.0 + "@docusaurus/plugin-debug": 3.4.0 + "@docusaurus/plugin-google-analytics": 3.4.0 + "@docusaurus/plugin-google-gtag": 3.4.0 + "@docusaurus/plugin-google-tag-manager": 3.4.0 + "@docusaurus/plugin-sitemap": 3.4.0 + "@docusaurus/theme-classic": 3.4.0 + "@docusaurus/theme-common": 3.4.0 + "@docusaurus/theme-search-algolia": 3.4.0 + "@docusaurus/types": 3.4.0 peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: fe98e457990a8d3d9966247ca02ad4f960aea0c9200e76ee1180942daea8165352dfa12b52bf3d8bd1ad89c16e849b36170f584aef838f16aaf3daab26ebbb3f + checksum: 968833af162303685bebce71baed4ae662ce4c67957ceba0c9d697459c5e7996455a8a7ecb1b5c1a5978b475d5aa71605f8ec6b5b90459940310ffb2f4f5b6f1 languageName: node linkType: hard "@docusaurus/remark-plugin-npm2yarn@npm:^3.2.1": - version: 3.3.2 - resolution: "@docusaurus/remark-plugin-npm2yarn@npm:3.3.2" + version: 3.4.0 + resolution: "@docusaurus/remark-plugin-npm2yarn@npm:3.4.0" dependencies: mdast-util-mdx: ^3.0.0 npm-to-yarn: ^2.2.1 tslib: ^2.6.0 unified: ^11.0.3 unist-util-visit: ^5.0.0 - checksum: 91468d91cacefdf40e3e0698847bcfff005652a18299fd9c2ddee05d9d1b3f0141bc1076cf803dd99243e9deb4cee2178a15ed2d5819e93f658728c20dad7fc9 - languageName: node - linkType: hard - -"@docusaurus/theme-classic@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/theme-classic@npm:3.3.2" - dependencies: - "@docusaurus/core": 3.3.2 - "@docusaurus/mdx-loader": 3.3.2 - "@docusaurus/module-type-aliases": 3.3.2 - "@docusaurus/plugin-content-blog": 3.3.2 - "@docusaurus/plugin-content-docs": 3.3.2 - "@docusaurus/plugin-content-pages": 3.3.2 - "@docusaurus/theme-common": 3.3.2 - "@docusaurus/theme-translations": 3.3.2 - "@docusaurus/types": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-common": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 + checksum: 01dee94430779ce47d417f5b312fa1eeb593542e070649fc1718e74b4d4f0a0ef9b5b1d4d317eca2639cd92f3922f384b584cb31550dec29f8716fcbf0ea6c4c + languageName: node + linkType: hard + +"@docusaurus/theme-classic@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/theme-classic@npm:3.4.0" + dependencies: + "@docusaurus/core": 3.4.0 + "@docusaurus/mdx-loader": 3.4.0 + "@docusaurus/module-type-aliases": 3.4.0 + "@docusaurus/plugin-content-blog": 3.4.0 + "@docusaurus/plugin-content-docs": 3.4.0 + "@docusaurus/plugin-content-pages": 3.4.0 + "@docusaurus/theme-common": 3.4.0 + "@docusaurus/theme-translations": 3.4.0 + "@docusaurus/types": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-common": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 "@mdx-js/react": ^3.0.0 clsx: ^2.0.0 copy-text-to-clipboard: ^3.2.0 @@ -2802,21 +2803,21 @@ __metadata: peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: af3e6ede0574fba04e44560a6126ab380ab21e32ee13482cf4f21230818d58f3e794ff5ac9e715091612ff5f52561c3fcc8c59e3a69c75b663b70e00ffdfadbe + checksum: 3c8aaa8c31d86683909d242e3c1fa01732a10b6f62f27eda0768048a0598ed69da70824553da4e437271ac4ddbe5098c11b2012dbb09c9f97c0f40fb21e41843 languageName: node linkType: hard -"@docusaurus/theme-common@npm:3.3.2, @docusaurus/theme-common@npm:^3.2.1": - version: 3.3.2 - resolution: "@docusaurus/theme-common@npm:3.3.2" - dependencies: - "@docusaurus/mdx-loader": 3.3.2 - "@docusaurus/module-type-aliases": 3.3.2 - "@docusaurus/plugin-content-blog": 3.3.2 - "@docusaurus/plugin-content-docs": 3.3.2 - "@docusaurus/plugin-content-pages": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-common": 3.3.2 +"@docusaurus/theme-common@npm:3.4.0, @docusaurus/theme-common@npm:^3.2.1": + version: 3.4.0 + resolution: "@docusaurus/theme-common@npm:3.4.0" + dependencies: + "@docusaurus/mdx-loader": 3.4.0 + "@docusaurus/module-type-aliases": 3.4.0 + "@docusaurus/plugin-content-blog": 3.4.0 + "@docusaurus/plugin-content-docs": 3.4.0 + "@docusaurus/plugin-content-pages": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-common": 3.4.0 "@types/history": ^4.7.11 "@types/react": "*" "@types/react-router-config": "*" @@ -2828,22 +2829,22 @@ __metadata: peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: b88ebf0cdeabdb766f98179d5ba4f54fddb24a3db6e498d01eeadf6d59c5f2d83588f30075551076f171a78ea9704f398d64e06d2af625f3232d7f261c90af10 + checksum: e8231b931775225dd313b3a46e1857cb038fb1567437fd0b6327a944246f380309bdefc7a512517797b9f13cdca282eb6a08a2c5ea2e59c002ad9f459942b943 languageName: node linkType: hard -"@docusaurus/theme-search-algolia@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/theme-search-algolia@npm:3.3.2" +"@docusaurus/theme-search-algolia@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/theme-search-algolia@npm:3.4.0" dependencies: "@docsearch/react": ^3.5.2 - "@docusaurus/core": 3.3.2 - "@docusaurus/logger": 3.3.2 - "@docusaurus/plugin-content-docs": 3.3.2 - "@docusaurus/theme-common": 3.3.2 - "@docusaurus/theme-translations": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-validation": 3.3.2 + "@docusaurus/core": 3.4.0 + "@docusaurus/logger": 3.4.0 + "@docusaurus/plugin-content-docs": 3.4.0 + "@docusaurus/theme-common": 3.4.0 + "@docusaurus/theme-translations": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-validation": 3.4.0 algoliasearch: ^4.18.0 algoliasearch-helper: ^3.13.3 clsx: ^2.0.0 @@ -2855,23 +2856,23 @@ __metadata: peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: 1a922620399d69199ef2e32bded18b11ff2b1e5f93d074b46489052cab8e1f70d2c975b033bf74712756b051351b57807caae7630ed19d28de333a9fd02304e8 + checksum: 173c8a2d600a681d736f5097529c3dcb46cdd8f717a6875cd7701b762010f209e1703537fcc475fc344323ec0213a2709180cfdb8c18a334c063bc74789d749b languageName: node linkType: hard -"@docusaurus/theme-translations@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/theme-translations@npm:3.3.2" +"@docusaurus/theme-translations@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/theme-translations@npm:3.4.0" dependencies: fs-extra: ^11.1.1 tslib: ^2.6.0 - checksum: a20ba46d36a7ac10d43ac0bc66ab3e137dd7d9529d26eee76513366f9fa7ae6fde61a85ce304c88bfa39136a90ffd53ee18358efd338a33e462999861bb01cdc + checksum: 599cdedf90da0f6fdd75088f358dd045a69a5b00904100a931bfea4f514c8282e1093b4f62c0af96be422b528a1addfc24043cba857db6357010ff92020795b6 languageName: node linkType: hard -"@docusaurus/types@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/types@npm:3.3.2" +"@docusaurus/types@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/types@npm:3.4.0" dependencies: "@mdx-js/mdx": ^3.0.0 "@types/history": ^4.7.11 @@ -2885,13 +2886,13 @@ __metadata: peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 - checksum: 6da53038547d94cf5e2a8b14224972f83e1779e45453fcaf237e4e2b5f4c380534a04332cfa2029ceaae72e3d4a93a544d2b07c0bd280a365cb2b77516620628 + checksum: a3d50dd22db201711894ac73bfc9816ea4c01962063a91cdb7933597c621a794a85aa322d4c0bc8cacf9029902cdfc5a9c027b603fa9197bc4cd1917270b5da2 languageName: node linkType: hard -"@docusaurus/utils-common@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/utils-common@npm:3.3.2" +"@docusaurus/utils-common@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/utils-common@npm:3.4.0" dependencies: tslib: ^2.6.0 peerDependencies: @@ -2899,30 +2900,32 @@ __metadata: peerDependenciesMeta: "@docusaurus/types": optional: true - checksum: cb745c0b912babee39a78bbf592cc622b35de9044bc5b99a8b59fad1e278ef447b03aac39a18d6112a74d9053f04ab9ec4b3d2f2bc77014a8dd6d212e4e48b21 + checksum: a3d17e3e504e22972a3344215da9e97b5c5d9813a826146b5aad159953f92e1cd9cfecc9d1e2da22ee6df5be3f4b0cbd8f58071f979d0805b1b680d8e6bd571c languageName: node linkType: hard -"@docusaurus/utils-validation@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/utils-validation@npm:3.3.2" +"@docusaurus/utils-validation@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/utils-validation@npm:3.4.0" dependencies: - "@docusaurus/logger": 3.3.2 - "@docusaurus/utils": 3.3.2 - "@docusaurus/utils-common": 3.3.2 + "@docusaurus/logger": 3.4.0 + "@docusaurus/utils": 3.4.0 + "@docusaurus/utils-common": 3.4.0 + fs-extra: ^11.2.0 joi: ^17.9.2 js-yaml: ^4.1.0 + lodash: ^4.17.21 tslib: ^2.6.0 - checksum: 2635d233a34919bb8a2970eec63cbf79788104e7c821d63488c6c1ed466b450019ffa640ddd6d0560b99f17829275c9735de6fc0154ad2e2de5d841083a852c1 + checksum: 8130455f9448351102d94d366dc3781e21682d8b9760d8e86a01549c8e5db0e3035caca1ee2dc577362cd0942d15895409a170553a368654a08f4b53e4788aea languageName: node linkType: hard -"@docusaurus/utils@npm:3.3.2": - version: 3.3.2 - resolution: "@docusaurus/utils@npm:3.3.2" +"@docusaurus/utils@npm:3.4.0": + version: 3.4.0 + resolution: "@docusaurus/utils@npm:3.4.0" dependencies: - "@docusaurus/logger": 3.3.2 - "@docusaurus/utils-common": 3.3.2 + "@docusaurus/logger": 3.4.0 + "@docusaurus/utils-common": 3.4.0 "@svgr/webpack": ^8.1.0 escape-string-regexp: ^4.0.0 file-loader: ^6.2.0 @@ -2939,13 +2942,14 @@ __metadata: shelljs: ^0.8.5 tslib: ^2.6.0 url-loader: ^4.1.1 + utility-types: ^3.10.0 webpack: ^5.88.1 peerDependencies: "@docusaurus/types": "*" peerDependenciesMeta: "@docusaurus/types": optional: true - checksum: 5757e9cb7d70a5b9fbb2a6cde6b66e36b335b77a2349eaa88c3dca5819ac680d5491b2df992223f3ae7fb6ffeb957f6929a9145fd6f154c761c89536450d745c + checksum: 2be7c435797120456528bcf476b68a96d39a9faaaa955f045f37f111cee0d64357abad160a99b7c3aaf9ac2744722c02641610dfaf123c25fbc42b3b5af7d0fb languageName: node linkType: hard @@ -10840,7 +10844,7 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:^11.1.0, fs-extra@npm:^11.1.1": +"fs-extra@npm:^11.1.0, fs-extra@npm:^11.1.1, fs-extra@npm:^11.2.0": version: 11.2.0 resolution: "fs-extra@npm:11.2.0" dependencies: From a4810021e9b74e7513172879972ef378c899ef49 Mon Sep 17 00:00:00 2001 From: YeonJuan Date: Tue, 4 Jun 2024 19:56:47 +0900 Subject: [PATCH 14/23] fix(scope-manager): handle index signature in class (#9054) * fix(scope-manager): handle index signature in class * add tc * add test case * add snapshot --- .../tests/eslint-rules/no-undef.test.ts | 35 +++++++ .../no-unused-vars/no-unused-vars.test.ts | 12 +++ .../src/referencer/ClassVisitor.ts | 4 + .../class/declaration/index-signature.ts | 7 ++ .../class/declaration/index-signature.ts.shot | 98 +++++++++++++++++++ 5 files changed, 156 insertions(+) create mode 100644 packages/scope-manager/tests/fixtures/class/declaration/index-signature.ts create mode 100644 packages/scope-manager/tests/fixtures/class/declaration/index-signature.ts.shot diff --git a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts index 252b6fe2f32..a6ce89cc8d2 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -259,6 +259,11 @@ const obj = { }, }; `, + ` +class Foo { + [x: string]: any; +} + `, ], invalid: [ { @@ -396,5 +401,35 @@ function Foo() {} }, ], }, + { + code: ` +class Foo { + [x: Bar]: string; +} + `, + errors: [ + { + messageId: 'undef', + data: { + name: 'Bar', + }, + }, + ], + }, + { + code: ` +class Foo { + [x: string]: Bar; +} + `, + errors: [ + { + messageId: 'undef', + data: { + name: 'Bar', + }, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts index c810f351c0a..364d8fbdf14 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts @@ -689,6 +689,18 @@ export type T = { }; `, ` +type Foo = string; +export class Bar { + [x: Foo]: any; +} + `, + ` +type Foo = string; +export class Bar { + [x: Foo]: Foo; +} + `, + ` namespace Foo { export const Foo = 1; } diff --git a/packages/scope-manager/src/referencer/ClassVisitor.ts b/packages/scope-manager/src/referencer/ClassVisitor.ts index 94cb7ab5981..cf5d7022b25 100644 --- a/packages/scope-manager/src/referencer/ClassVisitor.ts +++ b/packages/scope-manager/src/referencer/ClassVisitor.ts @@ -320,6 +320,10 @@ class ClassVisitor extends Visitor { // intentionally skip } + protected TSIndexSignature(node: TSESTree.TSIndexSignature): void { + this.visitType(node); + } + protected StaticBlock(node: TSESTree.StaticBlock): void { this.#referencer.scopeManager.nestClassStaticBlockScope(node); diff --git a/packages/scope-manager/tests/fixtures/class/declaration/index-signature.ts b/packages/scope-manager/tests/fixtures/class/declaration/index-signature.ts new file mode 100644 index 00000000000..64b3581b128 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/index-signature.ts @@ -0,0 +1,7 @@ +type Bar = number; + +class Foo { + [x: string]: any; + [y: Bar]: string; + [z: symbol]: Foo; +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/index-signature.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/index-signature.ts.shot new file mode 100644 index 00000000000..52fa3c5480e --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/index-signature.ts.shot @@ -0,0 +1,98 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class declaration index-signature 1`] = ` +ScopeManager { + variables: [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: [ + TypeDefinition$1 { + name: Identifier<"Bar">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "Bar", + references: [ + Reference$1 { + identifier: Identifier<"Bar">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$3 { + defs: [ + ClassNameDefinition$2 { + name: Identifier<"Foo">, + node: ClassDeclaration$2, + }, + ], + name: "Foo", + references: [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: [ + ClassNameDefinition$3 { + name: Identifier<"Foo">, + node: ClassDeclaration$2, + }, + ], + name: "Foo", + references: [ + Reference$2 { + identifier: Identifier<"Foo">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$4, + }, + ], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: [], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "Bar" => Variable$2, + "Foo" => Variable$3, + }, + type: "global", + upper: null, + variables: [ + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$3, + ], + }, + ClassScope$2 { + block: ClassDeclaration$2, + isStrict: true, + references: [ + Reference$1, + Reference$2, + ], + set: Map { + "Foo" => Variable$4, + }, + type: "class", + upper: GlobalScope$1, + variables: [ + Variable$4, + ], + }, + ], +} +`; From 4b698aa7561aace12d24ff6c08b4e23d5e66e99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Tue, 4 Jun 2024 07:56:35 -0400 Subject: [PATCH 15/23] docs: auto-generate support h2 below all blog posts (#9238) * docs: auto-generate support h2 below all blog posts * Apply suggestions from code review Co-authored-by: Joshua Chen * Move heading out * fix: don't show in root index --------- Co-authored-by: Joshua Chen --- ...ed-rule-docs-with-docusaurus-and-remark.md | 6 --- ...nt-type-exports-and-imports-why-and-how.md | 6 --- ...13-announcing-typescript-eslint-v6-beta.md | 6 --- ...3-07-09-announcing-typescript-eslint-v6.md | 6 --- .../2023-09-18-parser-options-project-true.md | 6 --- ...2023-12-25-deprecating-formatting-rules.md | 6 --- ...7-announcing-typescript-eslint-v8-beta.mdx | 6 --- packages/website/docusaurus.config.mts | 3 ++ packages/website/plugins/blog-footer.ts | 52 +++++++++++++++++++ .../generated-rule-docs/RuleDocsPage.ts | 4 +- .../addESLintHashToCodeBlocksMeta.ts | 3 +- .../generated-rule-docs/createRuleDocsPage.ts | 4 +- .../plugins/generated-rule-docs/index.ts | 7 +-- .../insertions/insertBaseRuleReferences.ts | 2 +- .../insertions/insertNewRuleReferences.ts | 3 +- .../insertions/insertResources.ts | 2 +- .../insertions/insertSpecialCaseOptions.ts | 2 +- .../insertions/insertWhenNotToUseIt.ts | 2 +- packages/website/plugins/utils/nodes.ts | 14 +++++ .../utils.ts => utils/rules.ts} | 15 +----- 20 files changed, 85 insertions(+), 70 deletions(-) create mode 100644 packages/website/plugins/blog-footer.ts create mode 100644 packages/website/plugins/utils/nodes.ts rename packages/website/plugins/{generated-rule-docs/utils.ts => utils/rules.ts} (87%) diff --git a/packages/website/blog/2022-09-18-automated-rule-docs-with-docusaurus-and-remark.md b/packages/website/blog/2022-09-18-automated-rule-docs-with-docusaurus-and-remark.md index 7606e3e9f36..8009c1f0004 100644 --- a/packages/website/blog/2022-09-18-automated-rule-docs-with-docusaurus-and-remark.md +++ b/packages/website/blog/2022-09-18-automated-rule-docs-with-docusaurus-and-remark.md @@ -220,9 +220,3 @@ I'm excited to focus in particular on [Docs: Proofread rule docs for clarity (#4 We'd like to extend thanks to [Joshua Chen](https://github.com/Josh-Cena), one of the Docusaurus maintainers who also has been helping us with Docusaurus — and helped proofread [this blog post's PR](https://github.com/typescript-eslint/typescript-eslint/pull/5593). Without Joshua, this change would have taken us a great deal longer (if we'd have been able to tackle it at all). Thanks Joshua! 🤗 - -## Supporting typescript-eslint - -If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint). -We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great. -Thanks! 💖 diff --git a/packages/website/blog/2023-02-24-consistent-type-exports-and-imports-why-and-how.md b/packages/website/blog/2023-02-24-consistent-type-exports-and-imports-why-and-how.md index cde68190cd4..37df608f122 100644 --- a/packages/website/blog/2023-02-24-consistent-type-exports-and-imports-why-and-how.md +++ b/packages/website/blog/2023-02-24-consistent-type-exports-and-imports-why-and-how.md @@ -183,9 +183,3 @@ If it detects an import that only imports specifiers with inline `type` qualifie You can read more about the rules' configuration options in their docs pages. See [our Getting Started docs](/getting-started) for more information on linting your TypeScript code with typescript-eslint. - -## Supporting typescript-eslint - -If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint). -We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great. -Thanks! 💖 diff --git a/packages/website/blog/2023-03-13-announcing-typescript-eslint-v6-beta.md b/packages/website/blog/2023-03-13-announcing-typescript-eslint-v6-beta.md index 49d3bbf416e..a69f5f71a84 100644 --- a/packages/website/blog/2023-03-13-announcing-typescript-eslint-v6-beta.md +++ b/packages/website/blog/2023-03-13-announcing-typescript-eslint-v6-beta.md @@ -374,9 +374,3 @@ We'd like to extend a sincere _thank you_ to everybody who pitched in to make ty See the [v6.0.0 milestone](https://github.com/typescript-eslint/typescript-eslint/milestone/8) for the list of issues and associated merged pull requests. - -## Supporting typescript-eslint - -If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint). -We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great. -Thanks! 💖 diff --git a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md index 0920b004790..26e7f674e07 100644 --- a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md +++ b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md @@ -699,9 +699,3 @@ We'd like to extend a sincere _thank you_ to everybody who pitched in to make ty - [TypeScript](https://github.com/microsoft/TypeScript/pull/54693) See the [v6.0.0 milestone](https://github.com/typescript-eslint/typescript-eslint/milestone/8) for the list of issues and associated merged pull requests. - -## Supporting typescript-eslint - -If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint). -We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great. -Thanks! 💖 diff --git a/packages/website/blog/2023-09-18-parser-options-project-true.md b/packages/website/blog/2023-09-18-parser-options-project-true.md index d279beae93b..e2ffd4ef6d1 100644 --- a/packages/website/blog/2023-09-18-parser-options-project-true.md +++ b/packages/website/blog/2023-09-18-parser-options-project-true.md @@ -144,9 +144,3 @@ We hope this option will eventually become the standard way to enable typed lint However, because it's so new and untested, we're keeping it under the `EXPERIMENTAL_` prefix for at least all of the `6.X` versions. See [Packages > Parser > `EXPERIMENTAL_useProjectService`](/packages/parser#experimental_useprojectservice) for more information. - -## Supporting typescript-eslint - -If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint). -We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great. -Thanks! 💖 diff --git a/packages/website/blog/2023-12-25-deprecating-formatting-rules.md b/packages/website/blog/2023-12-25-deprecating-formatting-rules.md index 6767fedc990..65c2c5a3ce6 100644 --- a/packages/website/blog/2023-12-25-deprecating-formatting-rules.md +++ b/packages/website/blog/2023-12-25-deprecating-formatting-rules.md @@ -62,9 +62,3 @@ The equivalent stylistic rules for deprecated typescript-eslint rules are summar | [`@typescript-eslint/space-before-function-paren`](/rules/space-before-function-paren) | [`@stylistic/space-before-function-paren`](https://eslint.style/rules/ts/space-before-function-paren) | | [`@typescript-eslint/space-infix-ops`](/rules/space-infix-ops) | [`@stylistic/space-infix-ops`](https://eslint.style/rules/ts/space-infix-ops) | | [`@typescript-eslint/type-annotation-spacing`](/rules/type-annotation-spacing) | [`@stylistic/type-annotation-spacing`](https://eslint.style/rules/ts/type-annotation-spacing) | - -## Supporting typescript-eslint - -If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint). -We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great. -Thanks! 💖 diff --git a/packages/website/blog/2024-05-27-announcing-typescript-eslint-v8-beta.mdx b/packages/website/blog/2024-05-27-announcing-typescript-eslint-v8-beta.mdx index bb4df35009b..6348a37ddf4 100644 --- a/packages/website/blog/2024-05-27-announcing-typescript-eslint-v8-beta.mdx +++ b/packages/website/blog/2024-05-27-announcing-typescript-eslint-v8-beta.mdx @@ -349,9 +349,3 @@ We'd like to extend a sincere _thank you_ to everybody who pitched in to make ty See the [v8.0.0 milestone](https://github.com/typescript-eslint/typescript-eslint/milestone/9) for the list of issues and associated merged pull requests. - -## Supporting typescript-eslint - -If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint). -We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great. -Thanks! 💖 diff --git a/packages/website/docusaurus.config.mts b/packages/website/docusaurus.config.mts index edb6e58484a..a728e223b11 100644 --- a/packages/website/docusaurus.config.mts +++ b/packages/website/docusaurus.config.mts @@ -9,6 +9,7 @@ import type { UserThemeConfig as AlgoliaThemeConfig } from '@docusaurus/theme-se import type { Config } from '@docusaurus/types'; import { version } from './package.json'; +import { blogFooter } from './plugins/blog-footer'; import { generatedRuleDocs } from './plugins/generated-rule-docs'; import { rulesMeta } from './rulesMeta'; @@ -19,6 +20,8 @@ const githubUrl = 'https://github.com/typescript-eslint/typescript-eslint'; const presetClassicOptions: PresetClassicOptions = { blog: { blogSidebarCount: 'ALL', + // Allow Docusaurus TOC remark plugin to pick up the injected H2 + beforeDefaultRemarkPlugins: [blogFooter], remarkPlugins, }, docs: { diff --git a/packages/website/plugins/blog-footer.ts b/packages/website/plugins/blog-footer.ts new file mode 100644 index 00000000000..e943ea59328 --- /dev/null +++ b/packages/website/plugins/blog-footer.ts @@ -0,0 +1,52 @@ +import type * as mdast from 'mdast'; +import type { Plugin } from 'unified'; + +import { nodeIsParent } from './utils/nodes'; + +export const blogFooter: Plugin = () => { + return (root, file) => { + if ( + !nodeIsParent(root) || + !(file.value as string).includes('') + ) { + return; + } + + root.children.push( + { + children: [ + { + type: 'text', + value: 'Supporting typescript-eslint', + }, + ], + depth: 2, + type: 'heading', + } as mdast.Heading, + { + children: [ + { + type: 'text', + value: + 'If you enjoyed this blog post and/or use typescript-eslint, please consider ', + }, + { + children: [ + { + type: 'text', + value: 'supporting us on Open Collective', + }, + ], + url: 'https://opencollective.com/typescript-eslint', + type: 'link', + }, + { + type: 'text', + value: `. We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great. Thanks! 💖`, + }, + ], + type: 'paragraph', + } as mdast.Paragraph, + ); + }; +}; diff --git a/packages/website/plugins/generated-rule-docs/RuleDocsPage.ts b/packages/website/plugins/generated-rule-docs/RuleDocsPage.ts index 8c1d317bdc9..ea16781aec4 100644 --- a/packages/website/plugins/generated-rule-docs/RuleDocsPage.ts +++ b/packages/website/plugins/generated-rule-docs/RuleDocsPage.ts @@ -1,7 +1,7 @@ import type * as unist from 'unist'; -import type { RuleModuleWithMetaDocs, VFileWithStem } from './utils'; -import { findH2Index } from './utils'; +import type { RuleModuleWithMetaDocs, VFileWithStem } from '../utils/rules'; +import { findH2Index } from '../utils/rules'; export interface RequiredHeadingIndices { howToUse: number; diff --git a/packages/website/plugins/generated-rule-docs/addESLintHashToCodeBlocksMeta.ts b/packages/website/plugins/generated-rule-docs/addESLintHashToCodeBlocksMeta.ts index ac59bea5355..636a14aa30c 100644 --- a/packages/website/plugins/generated-rule-docs/addESLintHashToCodeBlocksMeta.ts +++ b/packages/website/plugins/generated-rule-docs/addESLintHashToCodeBlocksMeta.ts @@ -1,8 +1,9 @@ import type { MdxJsxFlowElement } from 'mdast-util-mdx'; import type * as unist from 'unist'; +import { nodeIsCode } from '../utils/nodes'; +import { convertToPlaygroundHash } from '../utils/rules'; import type { RuleDocsPage } from './RuleDocsPage'; -import { convertToPlaygroundHash, nodeIsCode } from './utils'; const optionRegex = /option='(?