diff --git a/packages/website/src/pages/styles.module.css b/packages/website/src/pages/styles.module.css
index 2e181af01382..4553800e8ad8 100644
--- a/packages/website/src/pages/styles.module.css
+++ b/packages/website/src/pages/styles.module.css
@@ -52,32 +52,3 @@
height: 7rem;
width: 7rem;
}
-
-.sponsorsTier {
- display: flex;
- flex-wrap: wrap;
- justify-content: center;
- align-items: center;
- max-width: 800px;
- margin: 10px auto;
- padding: 0;
-}
-
-.sponsorsTier li {
- list-style: none;
- margin: 5px;
-}
-
-.sponsorsTier a,
-.sponsorsTier a:hover {
- background: none;
- border: none;
-}
-.tier-sponsor img {
- max-height: 90px;
- width: 90px;
-}
-.tier-supporter img {
- max-height: 60px;
- width: 60px;
-}
diff --git a/tools/generate-contributors.ts b/tools/generate-contributors.ts
index c668ecf3da4a..69692cab586b 100644
--- a/tools/generate-contributors.ts
+++ b/tools/generate-contributors.ts
@@ -3,7 +3,7 @@
// this endpoint returns a list of contributors sorted by number of contributions
import * as fs from 'fs';
-import fetch from 'node-fetch';
+import fetch from 'cross-fetch';
import * as path from 'path';
const IGNORED_USERS = new Set([
diff --git a/tools/generate-sponsors.ts b/tools/generate-sponsors.ts
index 4d5d6f385c2a..79f472879a32 100644
--- a/tools/generate-sponsors.ts
+++ b/tools/generate-sponsors.ts
@@ -1,5 +1,5 @@
+import fetch from 'cross-fetch';
import * as fs from 'fs';
-import fetch from 'node-fetch';
import * as path from 'path';
const graphqlEndpoint = 'https://api.opencollective.com/graphql/v2';
@@ -13,6 +13,7 @@ const graphqlQuery = `{
slug
}
fromAccount {
+ id
name
slug
website
@@ -24,6 +25,10 @@ const graphqlQuery = `{
}
}`;
+const excludedIds = new Set([
+ '53kzxy4v-07wlr6mr-o9epmj9n-o8agdbe5', // Josh Goldberg
+]);
+
interface SponsorsData {
data: {
account: {
@@ -37,6 +42,7 @@ interface SponsorsData {
interface SponsorNode {
fromAccount: {
description: string;
+ id: string;
imageUrl: string;
name: string;
slug: string;
@@ -55,17 +61,27 @@ async function main(): Promise {
body: JSON.stringify({ query: graphqlQuery }),
});
const data = (await response.json()) as SponsorsData;
+ const uniqueIds = new Set(excludedIds);
const allSponsorsConfig = data.data.account.orders.nodes
.filter(node => !!node.tier)
.map(node => ({
description: node.fromAccount.description,
+ id: node.fromAccount.id,
image: node.fromAccount.imageUrl,
name: node.fromAccount.name,
slug: node.fromAccount.slug,
tier: node.tier.slug,
twitterHandle: node.fromAccount.twitterHandle,
website: node.fromAccount.website,
- }));
+ }))
+ .filter(({ id }) => {
+ if (uniqueIds.has(id)) {
+ return false;
+ }
+
+ uniqueIds.add(id);
+ return true;
+ });
const rcPath = path.resolve(
__dirname,
diff --git a/tools/generate-website-dts.ts b/tools/generate-website-dts.ts
index d0ac96c684c6..4a09e1b65263 100644
--- a/tools/generate-website-dts.ts
+++ b/tools/generate-website-dts.ts
@@ -1,5 +1,5 @@
import * as fs from 'fs';
-import fetch from 'node-fetch';
+import fetch from 'cross-fetch';
import * as path from 'path';
const baseHost = 'https://www.staging-typescript.org';
diff --git a/yarn.lock b/yarn.lock
index 0447f7d9a618..f343abe057d0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5861,7 +5861,7 @@ cross-env@^7.0.3:
dependencies:
cross-spawn "^7.0.1"
-cross-fetch@^3.0.4:
+cross-fetch@^3.0.4, cross-fetch@^3.1.4:
version "3.1.4"
resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39"
integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==
@@ -6184,11 +6184,6 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"
-data-uri-to-buffer@^4.0.0:
- version "4.0.0"
- resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.0.tgz#b5db46aea50f6176428ac05b73be39a57701a64b"
- integrity sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==
-
data-urls@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-2.0.0.tgz#156485a72963a970f5d5821aaf642bef2bf2db9b"
@@ -7362,13 +7357,6 @@ feed@^4.2.2:
dependencies:
xml-js "^1.6.11"
-fetch-blob@^3.1.2:
- version "3.1.2"
- resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.1.2.tgz#6bc438675f3851ecea51758ac91f6a1cd1bacabd"
- integrity sha512-hunJbvy/6OLjCD0uuhLdp0mMPzP/yd2ssd1t2FCJsaA7wkWhpbp9xfuNVpv7Ll4jFhzp6T4LAupSiV9uOeg0VQ==
- dependencies:
- web-streams-polyfill "^3.0.3"
-
figures@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962"
@@ -7570,13 +7558,6 @@ form-data@~2.3.2:
combined-stream "^1.0.6"
mime-types "^2.1.12"
-formdata-polyfill@^4.0.10:
- version "4.0.10"
- resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423"
- integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==
- dependencies:
- fetch-blob "^3.1.2"
-
forwarded@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811"
@@ -11015,15 +10996,6 @@ node-fetch@^2.6.0, node-fetch@^2.6.1:
dependencies:
whatwg-url "^5.0.0"
-node-fetch@^3.0.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.1.0.tgz#714f4922dc270239487654eaeeab86b8206cb52e"
- integrity sha512-QU0WbIfMUjd5+MUzQOYhenAazakV7Irh1SGkWCsRzBwvm4fAhzEUaHMJ6QLP7gWT6WO9/oH2zhKMMGMuIrDyKw==
- dependencies:
- data-uri-to-buffer "^4.0.0"
- fetch-blob "^3.1.2"
- formdata-polyfill "^4.0.10"
-
node-forge@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3"
@@ -14934,11 +14906,6 @@ web-namespaces@^1.0.0, web-namespaces@^1.1.2:
resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec"
integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==
-web-streams-polyfill@^3.0.3:
- version "3.1.1"
- resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz#1516f2d4ea8f1bdbfed15eb65cb2df87098c8364"
- integrity sha512-Czi3fG883e96T4DLEPRvufrF2ydhOOW1+1a6c3gNjH2aIh50DNFBdfwh2AKoOf1rXvpvavAoA11Qdq9+BKjE0Q==
-
webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
From bb8de2c157de8e5677aba320284a41033848fe33 Mon Sep 17 00:00:00 2001
From: Josh Goldberg
Date: Tue, 11 Jan 2022 02:35:42 -0500
Subject: [PATCH 03/29] docs(type-utils): remove duplicate line from issue
template (#4425)
---
.github/ISSUE_TEMPLATE/typescript-eslint-type-utils.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/ISSUE_TEMPLATE/typescript-eslint-type-utils.md b/.github/ISSUE_TEMPLATE/typescript-eslint-type-utils.md
index c2f8229829ce..33d3b7dd2bfb 100644
--- a/.github/ISSUE_TEMPLATE/typescript-eslint-type-utils.md
+++ b/.github/ISSUE_TEMPLATE/typescript-eslint-type-utils.md
@@ -67,6 +67,5 @@ i.e. eslint --ext ".ts,.js" src --debug
| package | version |
| ------------------------------- | ------- |
| `@typescript-eslint/type-utils` | `X.Y.Z` |
-| `@typescript-eslint/type-utils` | `X.Y.Z` |
| `TypeScript` | `X.Y.Z` |
| `node` | `X.Y.Z` |
From f53e07419e2e3575a43c11a6f836cc7498e01123 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 10 Jan 2022 23:36:55 -0800
Subject: [PATCH 04/29] chore: bump @commitlint/cli from 16.0.1 to 16.0.2
(#4427)
Bumps [@commitlint/cli](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli) from 16.0.1 to 16.0.2.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/cli/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/commits/v16.0.2/@commitlint/cli)
---
updated-dependencies:
- dependency-name: "@commitlint/cli"
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index f343abe057d0..d6266646920d 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1322,9 +1322,9 @@
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@commitlint/cli@^16.0.1":
- version "16.0.1"
- resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-16.0.1.tgz#21905c898ebece7da42277209022b1bc80c4fb39"
- integrity sha512-61gGRy65WiVDRsqP0dAR2fAgE3qrTBW3fgz9MySv32y5Ib3ZXXDDq6bGyQqi2dSaPuDYzNCRwwlC7mmQM73T/g==
+ version "16.0.2"
+ resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-16.0.2.tgz#393b03793fc59b93e5f4dd7dd535a6cc5a7413ca"
+ integrity sha512-Jt7iaBjoLGC5Nq4dHPTvTYnqPGkElFPBtTXTvBpTgatZApczyjI2plE0oG4GYWPp1suHIS/VdVDOMpPZjGVusg==
dependencies:
"@commitlint/format" "^16.0.0"
"@commitlint/lint" "^16.0.0"
From e61e388a9820fae393bb76f7e484079515166972 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 10 Jan 2022 23:37:03 -0800
Subject: [PATCH 05/29] chore: bump globby from 11.0.4 to 11.1.0 (#4426)
Bumps [globby](https://github.com/sindresorhus/globby) from 11.0.4 to 11.1.0.
- [Release notes](https://github.com/sindresorhus/globby/releases)
- [Commits](https://github.com/sindresorhus/globby/compare/v11.0.4...v11.1.0)
---
updated-dependencies:
- dependency-name: globby
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index d6266646920d..75934f3ea849 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7276,10 +7276,10 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
-fast-glob@^3.1.1, fast-glob@^3.2.7:
- version "3.2.7"
- resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
- integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==
+fast-glob@^3.2.7, fast-glob@^3.2.9:
+ version "3.2.10"
+ resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.10.tgz#2734f83baa7f43b7fd41e13bc34438f4ffe284ee"
+ integrity sha512-s9nFhFnvR63wls6/kM88kQqDhMu0AfdjqouE2l5GVQPbqLgyFjjU5ry/r2yKsJxpb9Py1EYNqieFrmMaX4v++A==
dependencies:
"@nodelib/fs.stat" "^2.0.2"
"@nodelib/fs.walk" "^1.2.3"
@@ -7911,15 +7911,15 @@ globals@^13.6.0, globals@^13.9.0:
type-fest "^0.20.2"
globby@^11.0.1, globby@^11.0.2, globby@^11.0.3, globby@^11.0.4:
- version "11.0.4"
- resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5"
- integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==
+ version "11.1.0"
+ resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
+ integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
dependencies:
array-union "^2.1.0"
dir-glob "^3.0.1"
- fast-glob "^3.1.1"
- ignore "^5.1.4"
- merge2 "^1.3.0"
+ fast-glob "^3.2.9"
+ ignore "^5.2.0"
+ merge2 "^1.4.1"
slash "^3.0.0"
got@^9.6.0:
@@ -8421,7 +8421,7 @@ ignore@^4.0.6:
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==
-ignore@^5.0.4, ignore@^5.0.5, ignore@^5.1.4, ignore@^5.1.8:
+ignore@^5.0.4, ignore@^5.0.5, ignore@^5.1.8, ignore@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a"
integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==
@@ -10652,7 +10652,7 @@ merge-stream@^2.0.0:
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==
-merge2@^1.3.0:
+merge2@^1.3.0, merge2@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
From 1d55a7511b38d8e2b2eabe59f639e0a865e6c93f Mon Sep 17 00:00:00 2001
From: Josh Goldberg
Date: Wed, 12 Jan 2022 18:26:42 -0500
Subject: [PATCH 06/29] feat: rename `experimental-utils` to `utils` and make
`experimental-utils` an alias to the new package (#4172)
---
.github/ISSUE_TEMPLATE.md | 20 +++---
.../ISSUE_TEMPLATE/typescript-eslint-utils.md | 25 ++++---
.github/workflows/ci.yml | 8 +--
.vscode/launch.json | 60 ++++++++--------
README.md | 2 +-
docs/development/CUSTOM_RULES.md | 38 +++++-----
docs/development/architecture/PACKAGES.md | 6 +-
packages/ast-spec/README.md | 2 +-
packages/eslint-plugin-internal/package.json | 2 +-
.../src/rules/no-poorly-typed-ts-props.ts | 6 +-
.../src/rules/no-typescript-default-import.ts | 5 +-
.../src/rules/no-typescript-estree-import.ts | 2 +-
.../src/rules/plugin-test-formatting.ts | 5 +-
.../src/rules/prefer-ast-types-enum.ts | 2 +-
.../src/util/createRule.ts | 2 +-
.../tests/RuleTester.ts | 2 +-
.../tests/rules/no-typescript-estree.test.ts | 18 ++---
.../tests/rules/prefer-ast-types-enum.test.ts | 5 +-
.../tsconfig.build.json | 2 +-
packages/eslint-plugin-internal/tsconfig.json | 2 +-
packages/eslint-plugin-tslint/package.json | 2 +-
.../eslint-plugin-tslint/src/rules/config.ts | 2 +-
.../eslint-plugin-tslint/tests/index.spec.ts | 2 +-
.../eslint-plugin-tslint/tsconfig.build.json | 2 +-
packages/eslint-plugin-tslint/tsconfig.json | 2 +-
packages/eslint-plugin/index.d.ts | 2 +-
packages/eslint-plugin/package.json | 2 +-
.../src/rules/adjacent-overload-signatures.ts | 5 +-
.../eslint-plugin/src/rules/array-type.ts | 5 +-
.../eslint-plugin/src/rules/ban-ts-comment.ts | 2 +-
.../src/rules/ban-tslint-comment.ts | 2 +-
packages/eslint-plugin/src/rules/ban-types.ts | 6 +-
.../eslint-plugin/src/rules/brace-style.ts | 2 +-
.../src/rules/class-literal-property-style.ts | 5 +-
.../eslint-plugin/src/rules/comma-dangle.ts | 5 +-
.../eslint-plugin/src/rules/comma-spacing.ts | 5 +-
.../rules/consistent-indexed-object-style.ts | 6 +-
.../src/rules/consistent-type-assertions.ts | 5 +-
.../src/rules/consistent-type-definitions.ts | 2 +-
.../src/rules/consistent-type-exports.ts | 2 +-
.../src/rules/consistent-type-imports.ts | 2 +-
.../src/rules/default-param-last.ts | 5 +-
.../eslint-plugin/src/rules/dot-notation.ts | 2 +-
.../rules/explicit-function-return-type.ts | 5 +-
.../rules/explicit-member-accessibility.ts | 2 +-
.../rules/explicit-module-boundary-types.ts | 5 +-
.../src/rules/func-call-spacing.ts | 2 +-
.../indent-new-do-not-use/BinarySearchTree.ts | 2 +-
.../indent-new-do-not-use/OffsetStorage.ts | 2 +-
.../rules/indent-new-do-not-use/TokenInfo.ts | 2 +-
.../src/rules/indent-new-do-not-use/index.ts | 2 +-
packages/eslint-plugin/src/rules/indent.ts | 5 +-
.../src/rules/init-declarations.ts | 5 +-
.../src/rules/keyword-spacing.ts | 2 +-
.../src/rules/lines-between-class-members.ts | 5 +-
.../src/rules/member-delimiter-style.ts | 6 +-
.../src/rules/member-ordering.ts | 2 +-
.../src/rules/method-signature-style.ts | 5 +-
.../rules/naming-convention-utils/schema.ts | 2 +-
.../rules/naming-convention-utils/types.ts | 2 +-
.../naming-convention-utils/validator.ts | 5 +-
.../src/rules/naming-convention.ts | 6 +-
.../src/rules/no-array-constructor.ts | 5 +-
.../src/rules/no-base-to-string.ts | 5 +-
.../rules/no-confusing-non-null-assertion.ts | 2 +-
.../src/rules/no-confusing-void-expression.ts | 6 +-
.../src/rules/no-dupe-class-members.ts | 5 +-
.../src/rules/no-duplicate-imports.ts | 5 +-
.../src/rules/no-dynamic-delete.ts | 6 +-
.../src/rules/no-empty-function.ts | 5 +-
.../src/rules/no-empty-interface.ts | 2 +-
.../src/rules/no-explicit-any.ts | 6 +-
.../src/rules/no-extra-non-null-assertion.ts | 2 +-
.../src/rules/no-extra-parens.ts | 6 +-
.../src/rules/no-extraneous-class.ts | 5 +-
.../src/rules/no-floating-promises.ts | 6 +-
.../src/rules/no-implicit-any-catch.ts | 5 +-
.../src/rules/no-implied-eval.ts | 5 +-
.../src/rules/no-inferrable-types.ts | 5 +-
.../src/rules/no-invalid-this.ts | 5 +-
.../src/rules/no-invalid-void-type.ts | 5 +-
.../eslint-plugin/src/rules/no-loop-func.ts | 6 +-
.../src/rules/no-loss-of-precision.ts | 2 +-
.../src/rules/no-magic-numbers.ts | 5 +-
.../src/rules/no-meaningless-void-operator.ts | 6 +-
.../eslint-plugin/src/rules/no-misused-new.ts | 5 +-
.../src/rules/no-misused-promises.ts | 6 +-
.../eslint-plugin/src/rules/no-namespace.ts | 5 +-
...no-non-null-asserted-nullish-coalescing.ts | 6 +-
.../no-non-null-asserted-optional-chain.ts | 6 +-
.../src/rules/no-non-null-assertion.ts | 5 +-
.../src/rules/no-parameter-properties.ts | 5 +-
.../eslint-plugin/src/rules/no-redeclare.ts | 6 +-
.../src/rules/no-require-imports.ts | 2 +-
.../src/rules/no-restricted-imports.ts | 2 +-
packages/eslint-plugin/src/rules/no-shadow.ts | 2 +-
.../eslint-plugin/src/rules/no-this-alias.ts | 5 +-
.../src/rules/no-throw-literal.ts | 5 +-
.../eslint-plugin/src/rules/no-type-alias.ts | 2 +-
.../no-unnecessary-boolean-literal-compare.ts | 5 +-
.../src/rules/no-unnecessary-condition.ts | 2 +-
.../src/rules/no-unnecessary-qualifier.ts | 5 +-
.../rules/no-unnecessary-type-arguments.ts | 2 +-
.../rules/no-unnecessary-type-assertion.ts | 5 +-
.../rules/no-unnecessary-type-constraint.ts | 5 +-
.../src/rules/no-unsafe-argument.ts | 5 +-
.../src/rules/no-unsafe-assignment.ts | 5 +-
.../eslint-plugin/src/rules/no-unsafe-call.ts | 2 +-
.../src/rules/no-unsafe-member-access.ts | 5 +-
.../src/rules/no-unsafe-return.ts | 5 +-
.../src/rules/no-unused-expressions.ts | 5 +-
.../eslint-plugin/src/rules/no-unused-vars.ts | 6 +-
.../src/rules/no-use-before-define.ts | 6 +-
.../src/rules/no-useless-constructor.ts | 5 +-
.../src/rules/no-var-requires.ts | 6 +-
.../non-nullable-type-assertion-style.ts | 5 +-
.../src/rules/object-curly-spacing.ts | 2 +-
.../rules/padding-line-between-statements.ts | 6 +-
.../src/rules/prefer-as-const.ts | 6 +-
.../src/rules/prefer-enum-initializers.ts | 2 +-
.../eslint-plugin/src/rules/prefer-for-of.ts | 6 +-
.../src/rules/prefer-function-type.ts | 2 +-
.../src/rules/prefer-includes.ts | 6 +-
.../src/rules/prefer-literal-enum-member.ts | 2 +-
.../src/rules/prefer-namespace-keyword.ts | 5 +-
.../src/rules/prefer-nullish-coalescing.ts | 2 +-
.../src/rules/prefer-optional-chain.ts | 6 +-
.../rules/prefer-readonly-parameter-types.ts | 5 +-
.../src/rules/prefer-readonly.ts | 6 +-
.../src/rules/prefer-reduce-type-parameter.ts | 5 +-
.../src/rules/prefer-regexp-exec.ts | 5 +-
.../src/rules/prefer-return-this-type.ts | 5 +-
.../rules/prefer-string-starts-ends-with.ts | 6 +-
.../src/rules/prefer-ts-expect-error.ts | 10 +--
.../src/rules/promise-function-async.ts | 2 +-
packages/eslint-plugin/src/rules/quotes.ts | 5 +-
.../src/rules/require-array-sort-compare.ts | 2 +-
.../eslint-plugin/src/rules/require-await.ts | 6 +-
.../src/rules/restrict-plus-operands.ts | 2 +-
.../rules/restrict-template-expressions.ts | 5 +-
.../eslint-plugin/src/rules/return-await.ts | 6 +-
packages/eslint-plugin/src/rules/semi.ts | 6 +-
.../sort-type-union-intersection-members.ts | 6 +-
.../src/rules/space-before-function-paren.ts | 5 +-
.../src/rules/space-infix-ops.ts | 5 +-
.../src/rules/strict-boolean-expressions.ts | 2 +-
.../src/rules/switch-exhaustiveness-check.ts | 2 +-
.../src/rules/triple-slash-reference.ts | 2 +-
.../src/rules/type-annotation-spacing.ts | 2 +-
packages/eslint-plugin/src/rules/typedef.ts | 5 +-
.../eslint-plugin/src/rules/unbound-method.ts | 5 +-
.../src/rules/unified-signatures.ts | 5 +-
packages/eslint-plugin/src/util/astUtils.ts | 4 +-
.../src/util/collectUnusedVariables.ts | 2 +-
packages/eslint-plugin/src/util/createRule.ts | 2 +-
.../src/util/explicitReturnTypeUtils.ts | 2 +-
.../src/util/getESLintCoreRule.ts | 2 +-
.../src/util/getFunctionHeadLoc.ts | 2 +-
.../src/util/getThisExpression.ts | 5 +-
.../src/util/getWrappingFixer.ts | 2 +-
packages/eslint-plugin/src/util/index.ts | 2 +-
packages/eslint-plugin/src/util/misc.ts | 6 +-
packages/eslint-plugin/tests/RuleTester.ts | 2 +-
.../tests/rules/array-type.test.ts | 2 +-
.../tests/rules/ban-types.test.ts | 2 +-
.../rules/consistent-type-exports.test.ts | 4 +-
.../tests/rules/func-call-spacing.test.ts | 2 +-
.../tests/rules/indent/indent-eslint.test.ts | 5 +-
.../tests/rules/indent/indent.test.ts | 5 +-
.../eslint-plugin/tests/rules/indent/utils.ts | 2 +-
.../tests/rules/init-declarations.test.ts | 2 +-
.../tests/rules/keyword-spacing.test.ts | 2 +-
...habetically-case-insensitive-order.test.ts | 2 +-
...mber-ordering-alphabetically-order.test.ts | 2 +-
.../tests/rules/member-ordering.test.ts | 2 +-
.../tests/rules/naming-convention.test.ts | 2 +-
.../tests/rules/no-array-constructor.test.ts | 2 +-
.../tests/rules/no-explicit-any.test.ts | 2 +-
.../tests/rules/no-extraneous-class.test.ts | 2 +-
.../tests/rules/no-for-in-array.test.ts | 2 +-
.../tests/rules/no-inferrable-types.test.ts | 2 +-
.../tests/rules/no-loop-func.test.ts | 2 +-
.../tests/rules/no-redeclare.test.ts | 5 +-
.../tests/rules/no-restricted-imports.test.ts | 6 +-
.../tests/rules/no-shadow.test.ts | 2 +-
.../tests/rules/no-this-alias.test.ts | 2 +-
.../rules/no-unnecessary-condition.test.ts | 2 +-
.../rules/no-unnecessary-qualifier.test.ts | 2 +-
.../no-unnecessary-type-assertion.test.ts | 2 +-
.../tests/rules/no-unsafe-assignment.test.ts | 2 +-
.../tests/rules/no-unused-expressions.test.ts | 2 +-
.../no-unused-vars-eslint.test.ts | 5 +-
.../tests/rules/no-use-before-define.test.ts | 2 +-
.../rules/no-useless-constructor.test.ts | 2 +-
.../tests/rules/object-curly-spacing.test.ts | 2 +-
.../tests/rules/prefer-function-type.test.ts | 2 +-
.../rules/prefer-nullish-coalescing.test.ts | 2 +-
.../tests/rules/prefer-optional-chain.test.ts | 2 +-
.../prefer-readonly-parameter-types.test.ts | 2 +-
.../prefer-string-starts-ends-with.test.ts | 2 +-
.../rules/promise-function-async.test.ts | 2 +-
.../eslint-plugin/tests/rules/semi.test.ts | 2 +-
...rt-type-union-intersection-members.test.ts | 2 +-
.../rules/space-before-function-paren.test.ts | 2 +-
.../rules/type-annotation-spacing.test.ts | 2 +-
.../tests/rules/unbound-method.test.ts | 2 +-
.../tests/util/getWrappingFixer.test.ts | 2 +-
.../eslint-plugin/tools/generate-configs.ts | 2 +-
packages/eslint-plugin/tsconfig.build.json | 2 +-
packages/eslint-plugin/tsconfig.json | 2 +-
.../eslint-plugin/typings/eslint-rules.d.ts | 72 +++++++++----------
packages/experimental-utils/CHANGELOG.md | 2 +
packages/experimental-utils/README.md | 30 +++-----
packages/experimental-utils/package.json | 15 +---
packages/experimental-utils/src/index.ts | 10 +--
packages/parser/tsconfig.build.json | 2 +-
packages/parser/tsconfig.json | 2 +-
packages/type-utils/README.md | 2 +-
packages/type-utils/package.json | 2 +-
packages/type-utils/src/isTypeReadonly.ts | 2 +-
packages/type-utils/src/isUnsafeAssignment.ts | 5 +-
.../tests/isUnsafeAssignment.test.ts | 2 +-
packages/type-utils/tsconfig.build.json | 2 +-
packages/type-utils/tsconfig.json | 2 +-
packages/types/README.md | 2 +-
packages/utils/CHANGELOG.md | 4 ++
packages/utils/LICENSE | 21 ++++++
packages/utils/README.md | 27 +++++++
packages/utils/jest.config.js | 21 ++++++
packages/utils/package.json | 66 +++++++++++++++++
packages/utils/project.json | 5 ++
.../ast-utils/eslint-utils/PatternMatcher.ts | 0
.../eslint-utils/ReferenceTracker.ts | 0
.../ast-utils/eslint-utils/astUtilities.ts | 0
.../src/ast-utils/eslint-utils/index.ts | 0
.../src/ast-utils/eslint-utils/predicates.ts | 0
.../ast-utils/eslint-utils/scopeAnalysis.ts | 0
.../src/ast-utils/helpers.ts | 0
.../src/ast-utils/index.ts | 0
.../src/ast-utils/misc.ts | 0
.../src/ast-utils/predicates.ts | 0
.../src/eslint-utils/InferTypesFromRule.ts | 0
.../src/eslint-utils/RuleCreator.ts | 0
.../src/eslint-utils/RuleTester.ts | 0
.../src/eslint-utils/applyDefault.ts | 0
.../eslint-utils/batchedSingleLineTests.ts | 0
.../src/eslint-utils/deepMerge.ts | 0
.../src/eslint-utils/getParserServices.ts | 0
.../src/eslint-utils/index.ts | 0
.../src/eslint-utils/nullThrows.ts | 0
packages/utils/src/index.ts | 8 +++
.../src/json-schema.ts | 0
.../src/ts-eslint-scope/Definition.ts | 0
.../src/ts-eslint-scope/Options.ts | 0
.../src/ts-eslint-scope/PatternVisitor.ts | 0
.../src/ts-eslint-scope/README.md | 0
.../src/ts-eslint-scope/Reference.ts | 0
.../src/ts-eslint-scope/Referencer.ts | 0
.../src/ts-eslint-scope/Scope.ts | 0
.../src/ts-eslint-scope/ScopeManager.ts | 0
.../src/ts-eslint-scope/Variable.ts | 0
.../src/ts-eslint-scope/analyze.ts | 0
.../src/ts-eslint-scope/index.ts | 0
.../src/ts-eslint/AST.ts | 0
.../src/ts-eslint/CLIEngine.ts | 0
.../src/ts-eslint/ESLint.ts | 0
.../src/ts-eslint/Linter.ts | 0
.../src/ts-eslint/ParserOptions.ts | 0
.../src/ts-eslint/Rule.ts | 0
.../src/ts-eslint/RuleTester.ts | 0
.../src/ts-eslint/Scope.ts | 0
.../src/ts-eslint/SourceCode.ts | 0
.../src/ts-eslint/index.ts | 0
.../src/ts-estree.ts | 0
.../tests/eslint-utils/RuleCreator.test.ts | 0
.../tests/eslint-utils/applyDefault.test.ts | 0
.../batchedSingleLineTests.test.ts | 0
.../tests/eslint-utils/deepMerge.test.ts | 0
packages/utils/tsconfig.build.json | 15 ++++
packages/utils/tsconfig.json | 13 ++++
.../typings/eslint-scope.d.ts | 0
.../typings/eslint-utils.d.ts | 0
.../typings/eslint.d.ts | 0
packages/website-eslint/package.json | 4 +-
packages/website-eslint/rollup.config.js | 8 +--
packages/website-eslint/types/index.d.ts | 2 +-
workspace.json | 3 +-
287 files changed, 541 insertions(+), 718 deletions(-)
create mode 100644 packages/utils/CHANGELOG.md
create mode 100644 packages/utils/LICENSE
create mode 100644 packages/utils/README.md
create mode 100644 packages/utils/jest.config.js
create mode 100644 packages/utils/package.json
create mode 100644 packages/utils/project.json
rename packages/{experimental-utils => utils}/src/ast-utils/eslint-utils/PatternMatcher.ts (100%)
rename packages/{experimental-utils => utils}/src/ast-utils/eslint-utils/ReferenceTracker.ts (100%)
rename packages/{experimental-utils => utils}/src/ast-utils/eslint-utils/astUtilities.ts (100%)
rename packages/{experimental-utils => utils}/src/ast-utils/eslint-utils/index.ts (100%)
rename packages/{experimental-utils => utils}/src/ast-utils/eslint-utils/predicates.ts (100%)
rename packages/{experimental-utils => utils}/src/ast-utils/eslint-utils/scopeAnalysis.ts (100%)
rename packages/{experimental-utils => utils}/src/ast-utils/helpers.ts (100%)
rename packages/{experimental-utils => utils}/src/ast-utils/index.ts (100%)
rename packages/{experimental-utils => utils}/src/ast-utils/misc.ts (100%)
rename packages/{experimental-utils => utils}/src/ast-utils/predicates.ts (100%)
rename packages/{experimental-utils => utils}/src/eslint-utils/InferTypesFromRule.ts (100%)
rename packages/{experimental-utils => utils}/src/eslint-utils/RuleCreator.ts (100%)
rename packages/{experimental-utils => utils}/src/eslint-utils/RuleTester.ts (100%)
rename packages/{experimental-utils => utils}/src/eslint-utils/applyDefault.ts (100%)
rename packages/{experimental-utils => utils}/src/eslint-utils/batchedSingleLineTests.ts (100%)
rename packages/{experimental-utils => utils}/src/eslint-utils/deepMerge.ts (100%)
rename packages/{experimental-utils => utils}/src/eslint-utils/getParserServices.ts (100%)
rename packages/{experimental-utils => utils}/src/eslint-utils/index.ts (100%)
rename packages/{experimental-utils => utils}/src/eslint-utils/nullThrows.ts (100%)
create mode 100644 packages/utils/src/index.ts
rename packages/{experimental-utils => utils}/src/json-schema.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint-scope/Definition.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint-scope/Options.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint-scope/PatternVisitor.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint-scope/README.md (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint-scope/Reference.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint-scope/Referencer.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint-scope/Scope.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint-scope/ScopeManager.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint-scope/Variable.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint-scope/analyze.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint-scope/index.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint/AST.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint/CLIEngine.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint/ESLint.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint/Linter.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint/ParserOptions.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint/Rule.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint/RuleTester.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint/Scope.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint/SourceCode.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-eslint/index.ts (100%)
rename packages/{experimental-utils => utils}/src/ts-estree.ts (100%)
rename packages/{experimental-utils => utils}/tests/eslint-utils/RuleCreator.test.ts (100%)
rename packages/{experimental-utils => utils}/tests/eslint-utils/applyDefault.test.ts (100%)
rename packages/{experimental-utils => utils}/tests/eslint-utils/batchedSingleLineTests.test.ts (100%)
rename packages/{experimental-utils => utils}/tests/eslint-utils/deepMerge.test.ts (100%)
create mode 100644 packages/utils/tsconfig.build.json
create mode 100644 packages/utils/tsconfig.json
rename packages/{experimental-utils => utils}/typings/eslint-scope.d.ts (100%)
rename packages/{experimental-utils => utils}/typings/eslint-utils.d.ts (100%)
rename packages/{experimental-utils => utils}/typings/eslint.d.ts (100%)
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index 67428be1e01e..5794d8565cb5 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -67,13 +67,13 @@ i.e. eslint --ext ".ts,.js" src --debug
**Versions**
-| package | version |
-| --------------------------------------- | ------- |
-| `@typescript-eslint/eslint-plugin` | `X.Y.Z` |
-| `@typescript-eslint/parser` | `X.Y.Z` |
-| `@typescript-eslint/typescript-estree` | `X.Y.Z` |
-| `@typescript-eslint/experimental-utils` | `X.Y.Z` |
-| `@typescript-eslint/type-utils` | `X.Y.Z` |
-| `TypeScript` | `X.Y.Z` |
-| `node` | `X.Y.Z` |
-| `npm` | `X.Y.Z` |
+| package | version |
+| -------------------------------------- | ------- |
+| `@typescript-eslint/eslint-plugin` | `X.Y.Z` |
+| `@typescript-eslint/parser` | `X.Y.Z` |
+| `@typescript-eslint/typescript-estree` | `X.Y.Z` |
+| `@typescript-eslint/type-utils` | `X.Y.Z` |
+| `@typescript-eslint/utils` | `X.Y.Z` |
+| `TypeScript` | `X.Y.Z` |
+| `node` | `X.Y.Z` |
+| `npm` | `X.Y.Z` |
diff --git a/.github/ISSUE_TEMPLATE/typescript-eslint-utils.md b/.github/ISSUE_TEMPLATE/typescript-eslint-utils.md
index 0d2ca8ccf2d3..f576997d56f1 100644
--- a/.github/ISSUE_TEMPLATE/typescript-eslint-utils.md
+++ b/.github/ISSUE_TEMPLATE/typescript-eslint-utils.md
@@ -1,9 +1,8 @@
---
-name: '@typescript-eslint/experimental-utils'
-about: Report an issue with the '@typescript-eslint/experimental-utils' package
-title: ''
-labels: 'package: utils, triage'
-assignees: ''
+name: '@typescript-eslint/utils'
+about: Report an issue with the 'typescript-eslint/utils' package
+title: '': 'package: utils, triage'
+: ''
---
- [ ] I have tried restarting my IDE and the issue persists.
@@ -64,8 +63,8 @@ i.e. eslint --ext ".ts,.js" src --debug
**Versions**
-| package | version |
-| --------------------------------------- | ------- |
-| `@typescript-eslint/experimental-utils` | `X.Y.Z` |
-| `TypeScript` | `X.Y.Z` |
-| `node` | `X.Y.Z` |
+| package | version |
+| ---------------------------| ------- |
+| `@typescript-eslint/utils` | `X.Y.Z` |
+| `TypeScript` | `X.Y.Z` |
+| `node` | `X.Y.Z` |
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f05912ef76a5..7e79299fdf03 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -111,8 +111,8 @@ jobs:
env:
CI: true
- - name: Run unit tests for experimental-utils
- run: npx nx test @typescript-eslint/experimental-utils
+ - name: Run unit tests for utils
+ run: npx nx test @typescript-eslint/utils
env:
CI: true
@@ -283,8 +283,8 @@ jobs:
env:
CI: true
- - name: Run unit tests for experimental-utils
- run: npx nx test @typescript-eslint/experimental-utils
+ - name: Run unit tests for utils
+ run: npx nx test @typescript-eslint/utils
env:
CI: true
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 0162b9ae8312..d61dbf50a74a 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -20,10 +20,10 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": [
- "${workspaceFolder}/packages/experimental-utils/src/index.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/index.js",
- "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js",
+ "${workspaceFolder}/packages/utils/src/index.ts",
+ "${workspaceFolder}/packages/utils/dist/index.js",
+ "${workspaceFolder}/packages/utils/src/ts-estree.ts",
+ "${workspaceFolder}/packages/utils/dist/ts-estree.js",
"${workspaceFolder}/packages/type-utils/src/index.ts",
"${workspaceFolder}/packages/type-utils/dist/index.js",
"${workspaceFolder}/packages/parser/src/index.ts",
@@ -54,10 +54,10 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": [
- "${workspaceFolder}/packages/experimental-utils/src/index.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/index.js",
- "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js",
+ "${workspaceFolder}/packages/utils/src/index.ts",
+ "${workspaceFolder}/packages/utils/dist/index.js",
+ "${workspaceFolder}/packages/utils/src/ts-estree.ts",
+ "${workspaceFolder}/packages/utils/dist/ts-estree.js",
"${workspaceFolder}/packages/type-utils/src/index.ts",
"${workspaceFolder}/packages/type-utils/dist/index.js",
"${workspaceFolder}/packages/parser/src/index.ts",
@@ -88,10 +88,10 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": [
- "${workspaceFolder}/packages/experimental-utils/src/index.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/index.js",
- "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js",
+ "${workspaceFolder}/packages/utils/src/index.ts",
+ "${workspaceFolder}/packages/utils/dist/index.js",
+ "${workspaceFolder}/packages/utils/src/ts-estree.ts",
+ "${workspaceFolder}/packages/utils/dist/ts-estree.js",
"${workspaceFolder}/packages/type-utils/src/ts-estree.ts",
"${workspaceFolder}/packages/type-utils/dist/ts-estree.js",
"${workspaceFolder}/packages/parser/src/index.ts",
@@ -122,10 +122,10 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": [
- "${workspaceFolder}/packages/experimental-utils/src/index.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/index.js",
- "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js",
+ "${workspaceFolder}/packages/utils/src/index.ts",
+ "${workspaceFolder}/packages/utils/dist/index.js",
+ "${workspaceFolder}/packages/utils/src/ts-estree.ts",
+ "${workspaceFolder}/packages/utils/dist/ts-estree.js",
"${workspaceFolder}/packages/type-utils/src/index.ts",
"${workspaceFolder}/packages/type-utils/dist/index.js",
"${workspaceFolder}/packages/parser/src/index.ts",
@@ -143,8 +143,8 @@
{
"type": "node",
"request": "launch",
- "name": "Run currently opened experimental-utils test",
- "cwd": "${workspaceFolder}/packages/experimental-utils/",
+ "name": "Run currently opened utils test",
+ "cwd": "${workspaceFolder}/packages/utils/",
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
"args": [
"--runInBand",
@@ -156,10 +156,10 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": [
- "${workspaceFolder}/packages/experimental-utils/src/index.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/index.js",
- "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js",
+ "${workspaceFolder}/packages/utils/src/index.ts",
+ "${workspaceFolder}/packages/utils/dist/index.js",
+ "${workspaceFolder}/packages/utils/src/ts-estree.ts",
+ "${workspaceFolder}/packages/utils/dist/ts-estree.js",
"${workspaceFolder}/packages/type-utils/src/index.ts",
"${workspaceFolder}/packages/type-utils/dist/index.js",
"${workspaceFolder}/packages/parser/src/index.ts",
@@ -190,10 +190,10 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": [
- "${workspaceFolder}/packages/experimental-utils/src/index.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/index.js",
- "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js",
+ "${workspaceFolder}/packages/utils/src/index.ts",
+ "${workspaceFolder}/packages/utils/dist/index.js",
+ "${workspaceFolder}/packages/utils/src/ts-estree.ts",
+ "${workspaceFolder}/packages/utils/dist/ts-estree.js",
"${workspaceFolder}/packages/type-utils/src/index.ts",
"${workspaceFolder}/packages/type-utils/dist/index.js",
"${workspaceFolder}/packages/parser/src/index.ts",
@@ -224,10 +224,10 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": [
- "${workspaceFolder}/packages/experimental-utils/src/index.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/index.js",
- "${workspaceFolder}/packages/experimental-utils/src/ts-estree.ts",
- "${workspaceFolder}/packages/experimental-utils/dist/ts-estree.js",
+ "${workspaceFolder}/packages/utils/src/index.ts",
+ "${workspaceFolder}/packages/utils/dist/index.js",
+ "${workspaceFolder}/packages/utils/src/ts-estree.ts",
+ "${workspaceFolder}/packages/utils/dist/ts-estree.js",
"${workspaceFolder}/packages/type-utils/src/index.ts",
"${workspaceFolder}/packages/type-utils/dist/index.js",
"${workspaceFolder}/packages/parser/src/index.ts",
diff --git a/README.md b/README.md
index bf858a9e6468..a3535cd83c38 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ See https://typescript-eslint.io/docs/development/architecture/packages for more
- [`@typescript-eslint/eslint-plugin`](./packages/eslint-plugin)
- [`@typescript-eslint/parser`](./packages/parser)
- [`@typescript-eslint/eslint-plugin-tslint`](./packages/eslint-plugin-tslint)
-- [`@typescript-eslint/experimental-utils`](./packages/experimental-utils)
+- [`@typescript-eslint/utils`](./packages/utils)
- [`@typescript-eslint/typescript-estree`](./packages/typescript-estree)
- [`@typescript-eslint/scope-manager`](./packages/scope-manager)
diff --git a/docs/development/CUSTOM_RULES.md b/docs/development/CUSTOM_RULES.md
index 692c08b4b1ec..f41cd7b72ca6 100644
--- a/docs/development/CUSTOM_RULES.md
+++ b/docs/development/CUSTOM_RULES.md
@@ -11,13 +11,13 @@ You should be familiar with [ESLint's developer guide](https://eslint.org/docs/d
As long as you are using `@typescript-eslint/parser` as the `parser` in your ESLint configuration, custom ESLint rules generally work the same way for JavaScript and TypeScript code.
The main three changes to custom rules writing are:
-- [Utils Package](#utils-package): we recommend using `@typescript-eslint/experimental-utils` to create custom rules
+- [Utils Package](#utils-package): we recommend using `@typescript-eslint/utils` to create custom rules
- [AST Extensions](#ast-extensions): targeting TypeScript-specific syntax in your rule selectors
- [Typed Rules](#typed-rules): using the TypeScript type checker to inform rule logic
## Utils Package
-The `@typescript-eslint/experimental-utils` package acts as a replacement package for `eslint` that exports all the same objects and types, but with typescript-eslint support.
+The `@typescript-eslint/utils` package acts as a replacement package for `eslint` that exports all the same objects and types, but with typescript-eslint support.
It also exports common utility functions and constants most custom typescript-eslint rules tend to use.
:::caution
@@ -27,7 +27,7 @@ You should generally not need to import from `eslint` when writing custom typesc
### `RuleCreator`
-The recommended way to create custom ESLint rules that make use of typescript-eslint features and/or syntax is with the `ESLintUtils.RuleCreator` function exported by `@typescript-eslint/experimental-utils`.
+The recommended way to create custom ESLint rules that make use of typescript-eslint features and/or syntax is with the `ESLintUtils.RuleCreator` function exported by `@typescript-eslint/utils`.
It takes in a function that transforms a rule name into its documentation URL, then returns a function that takes in a rule module object.
`RuleCreator` will infer the allowed message IDs the rule is allowed to emit from the provided `meta.messages` object.
@@ -35,7 +35,7 @@ It takes in a function that transforms a rule name into its documentation URL, t
This rule bans function declarations that start with a lower-case letter:
```ts
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
const createRule = ESLintUtils.RuleCreator(
name => `https://example.com/rule/${name}`,
@@ -70,7 +70,7 @@ export const rule = createRule({
});
```
-`RuleCreator` rule creator functions return rules typed as the `RuleModule` interface exported by `@typescript-eslint/experimental-utils`.
+`RuleCreator` rule creator functions return rules typed as the `RuleModule` interface exported by `@typescript-eslint/utils`.
It allows specifying generics for:
- `MessageIds`: a union of string literal message IDs that may be reported
@@ -79,7 +79,7 @@ It allows specifying generics for:
If the rule is able to take in rule options, declare them as a tuple type containing a single object of rule options:
```ts
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
type MessageIds = 'lowercase' | 'uppercase';
@@ -101,7 +101,7 @@ Although it is generally not recommended to create custom rules without document
It applies the same type inference as the `createRule`s above without enforcing a documentation URL.
```ts
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
export const rule = ESLintUtils.RuleCreator.withoutDocs({
create(context) {
@@ -126,7 +126,7 @@ You can query for them in your rule selectors.
This version of the above rule instead bans interface declaration names that start with a lower-case letter:
```ts
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
export const rule = createRule({
create(context) {
@@ -144,7 +144,7 @@ export const rule = createRule({
### Node Types
-TypeScript types for nodes exist in a `TSESTree` namespace exported by `@typescript-eslint/experimental-utils`.
+TypeScript types for nodes exist in a `TSESTree` namespace exported by `@typescript-eslint/utils`.
The above rule body could be better written in TypeScript with a type annotation on the `node`:
An `AST_NODE_TYPES` enum is exported as well to hold the values for AST node `type` properties.
@@ -153,10 +153,7 @@ An `AST_NODE_TYPES` enum is exported as well to hold the values for AST node `ty
For example, checking `node.type` can narrow down the type of the `node`:
```ts
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
export function describeNode(node: TSESTree.Node): string {
switch (node.type) {
@@ -180,10 +177,7 @@ In that case, it is best to add an explicit type declaration.
This rule snippet targets name nodes of both function and interface declarations:
```ts
-import {
- AST_NODE_TYPES,
- ESLintUtils,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils';
export const rule = createRule({
create(context) {
@@ -211,7 +205,7 @@ Read TypeScript's [Compiler APIs > Using the Type Checker](https://github.com/mi
The biggest addition typescript-eslint brings to ESLint rules is the ability to use TypeScript's type checker APIs.
-`@typescript-eslint/experimental-utils` exports an `ESLintUtils` namespace containing a `getParserServices` function that takes in an ESLint context and returns a `parserServices` object.
+`@typescript-eslint/utils` exports an `ESLintUtils` namespace containing a `getParserServices` function that takes in an ESLint context and returns a `parserServices` object.
That `parserServices` object contains:
@@ -224,7 +218,7 @@ By mapping from ESTree nodes to TypeScript nodes and retrieving the TypeScript p
This rule bans for-of looping over an enum by using the type-checker via typescript-eslint and TypeScript APIs:
```ts
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
import * as ts from 'typescript';
import * as tsutils from 'tsutils';
@@ -268,7 +262,7 @@ export const rule: eslint.Rule.RuleModule = {
## Testing
-`@typescript-eslint/experimental-utils` exports a `RuleTester` with a similar API to the built-in [ESLint `RuleTester`](https://eslint.org/docs/developer-guide/nodejs-api#ruletester).
+`@typescript-eslint/utils` exports a `RuleTester` with a similar API to the built-in [ESLint `RuleTester`](https://eslint.org/docs/developer-guide/nodejs-api#ruletester).
It should be provided with the same `parser` and `parserOptions` you would use in your ESLint configuration.
### Testing Untyped Rules
@@ -276,7 +270,7 @@ It should be provided with the same `parser` and `parserOptions` you would use i
For rules that don't need type information, passing just the `parser` will do:
```ts
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
import rule from './my-rule';
const ruleTester = new ESLintUtils.RuleTester({
@@ -295,7 +289,7 @@ For rules that do need type information, `parserOptions` must be passed in as we
Tests must have at least an absolute `tsconfigRootDir` path provided as well as a relative `project` path from that directory:
```ts
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
import rule from './my-typed-rule';
const ruleTester = new ESLintUtils.RuleTester({
diff --git a/docs/development/architecture/PACKAGES.md b/docs/development/architecture/PACKAGES.md
index 1dcff05a2574..461cc0218120 100644
--- a/docs/development/architecture/PACKAGES.md
+++ b/docs/development/architecture/PACKAGES.md
@@ -55,9 +55,9 @@ It works by:
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.
This form of static analysis allows you to understand and trace variables throughout the program, allowing you to access powerful information about a program without needing to drop into the much, much heavier type information.
-## `@typescript-eslint/experimental-utils`
+## `@typescript-eslint/utils`
-[`@typescript-eslint/experimental-utils`] contains public utilities for writing custom rules and plugins in TypeScript.
+[`@typescript-eslint/utils`] contains public utilities for writing custom rules and plugins in TypeScript.
Rules declared in `@typescript-eslint/eslint-plugin` are created using its utility functions.
Any custom rules you write generally will be as well.
@@ -71,7 +71,7 @@ Any custom rules you write generally will be as well.
[`@typescript-eslint/eslint-plugin-tslint`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin-tslint
[`@typescript-eslint/eslint-plugin`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin
-[`@typescript-eslint/experimental-utils`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/experimental-utils
+[`@typescript-eslint/utils`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/utils
[`@typescript-eslint/parser`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser
[`@typescript-eslint/scope-manager`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/scope-manager
[`@typescript-eslint/typescript-estree`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree
diff --git a/packages/ast-spec/README.md b/packages/ast-spec/README.md
index 6d29fecd24ec..388241c0061d 100644
--- a/packages/ast-spec/README.md
+++ b/packages/ast-spec/README.md
@@ -16,7 +16,7 @@ It includes:
**You probably don't want to use it directly.**
-If you're building an ESLint plugin, consider using [`@typescript-eslint/experimental-utils`](../experimental-utils) and [`@typescript-eslint/type-utils`](../type-utils).
+If you're building an ESLint plugin, consider using [`@typescript-eslint/utils`](../utils) and [`@typescript-eslint/type-utils`](../type-utils).
If you're parsing TypeScript code, consider using [`@typescript-eslint/typescript-estree`](../typescript-estree).
## Contributing
diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json
index 95b3dd94befc..3b9d0e8d47fc 100644
--- a/packages/eslint-plugin-internal/package.json
+++ b/packages/eslint-plugin-internal/package.json
@@ -14,8 +14,8 @@
},
"dependencies": {
"@types/prettier": "*",
- "@typescript-eslint/experimental-utils": "5.9.1",
"@typescript-eslint/scope-manager": "5.9.1",
+ "@typescript-eslint/utils": "5.9.1",
"prettier": "*"
}
}
diff --git a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
index f91068d9ffe0..456a17f7da1f 100644
--- a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
@@ -1,8 +1,4 @@
-import {
- ESLintUtils,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/utils';
import { createRule } from '../util';
/*
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 c82561312496..437e244b9dbf 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,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import { createRule } from '../util';
/*
diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
index 3cc96a0f6003..022fd98b7caa 100644
--- a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
@@ -2,7 +2,7 @@ import { createRule } from '../util';
const TSESTREE_NAME = '@typescript-eslint/typescript-estree';
const TYPES_NAME = '@typescript-eslint/types';
-const UTILS_NAME = '@typescript-eslint/experimental-utils';
+const UTILS_NAME = '@typescript-eslint/utils';
/*
Typescript will not error if people use typescript-estree within eslint-plugin.
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 81fcb8c41cf2..8b3ec8ffdb82 100644
--- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
+++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import { format, resolveConfig } from 'prettier';
import { createRule } from '../util';
diff --git a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
index e98d0904af52..d74104e5fcfd 100755
--- a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
+++ b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
@@ -2,7 +2,7 @@ import {
AST_NODE_TYPES,
AST_TOKEN_TYPES,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import { DefinitionType } from '@typescript-eslint/scope-manager';
import { createRule } from '../util';
diff --git a/packages/eslint-plugin-internal/src/util/createRule.ts b/packages/eslint-plugin-internal/src/util/createRule.ts
index 2ac52d199fc8..62f4e54b022e 100644
--- a/packages/eslint-plugin-internal/src/util/createRule.ts
+++ b/packages/eslint-plugin-internal/src/util/createRule.ts
@@ -1,4 +1,4 @@
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
diff --git a/packages/eslint-plugin-internal/tests/RuleTester.ts b/packages/eslint-plugin-internal/tests/RuleTester.ts
index 3b7d3afc554e..260e222194b0 100644
--- a/packages/eslint-plugin-internal/tests/RuleTester.ts
+++ b/packages/eslint-plugin-internal/tests/RuleTester.ts
@@ -1,4 +1,4 @@
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
import path from 'path';
function getFixturesRootDir(): string {
diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
index fe31f051a094..120c72def8cd 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
@@ -10,9 +10,9 @@ const ruleTester = new RuleTester({
ruleTester.run('no-typescript-estree-import', rule, {
valid: [
- "import { foo } from '@typescript-eslint/experimental-utils';",
- "import foo from '@typescript-eslint/experimental-utils';",
- "import * as foo from '@typescript-eslint/experimental-utils';",
+ "import { foo } from '@typescript-eslint/utils';",
+ "import foo from '@typescript-eslint/utils';",
+ "import * as foo from '@typescript-eslint/utils';",
],
invalid: batchedSingleLineTests({
code: `
@@ -24,12 +24,12 @@ import foo from '@typescript-eslint/types';
import * as foo from '@typescript-eslint/types';
`,
output: `
-import { foo } from '@typescript-eslint/experimental-utils';
-import foo from '@typescript-eslint/experimental-utils';
-import * as foo from '@typescript-eslint/experimental-utils';
-import { foo } from '@typescript-eslint/experimental-utils';
-import foo from '@typescript-eslint/experimental-utils';
-import * as foo from '@typescript-eslint/experimental-utils';
+import { foo } from '@typescript-eslint/utils';
+import foo from '@typescript-eslint/utils';
+import * as foo from '@typescript-eslint/utils';
+import { foo } from '@typescript-eslint/utils';
+import foo from '@typescript-eslint/utils';
+import * as foo from '@typescript-eslint/utils';
`,
errors: [
{
diff --git a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
index 94f8830a04ed..d418526db5f1 100644
--- a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- AST_TOKEN_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
import { DefinitionType } from '@typescript-eslint/scope-manager';
import rule from '../../src/rules/prefer-ast-types-enum';
import { batchedSingleLineTests, RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin-internal/tsconfig.build.json b/packages/eslint-plugin-internal/tsconfig.build.json
index b40961d2d9a1..744454d20b2c 100644
--- a/packages/eslint-plugin-internal/tsconfig.build.json
+++ b/packages/eslint-plugin-internal/tsconfig.build.json
@@ -9,5 +9,5 @@
"resolveJsonModule": true
},
"include": ["src", "typings"],
- "references": [{ "path": "../experimental-utils/tsconfig.build.json" }]
+ "references": [{ "path": "../utils/tsconfig.build.json" }]
}
diff --git a/packages/eslint-plugin-internal/tsconfig.json b/packages/eslint-plugin-internal/tsconfig.json
index 597a5eaee954..12e8b67a5a34 100644
--- a/packages/eslint-plugin-internal/tsconfig.json
+++ b/packages/eslint-plugin-internal/tsconfig.json
@@ -5,5 +5,5 @@
"rootDir": "."
},
"include": ["src", "typings", "tests"],
- "references": [{ "path": "../experimental-utils/tsconfig.build.json" }]
+ "references": [{ "path": "../utils/tsconfig.build.json" }]
}
diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json
index 9f487c75926b..3ef927ab65f5 100644
--- a/packages/eslint-plugin-tslint/package.json
+++ b/packages/eslint-plugin-tslint/package.json
@@ -38,7 +38,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/experimental-utils": "5.9.1",
+ "@typescript-eslint/utils": "5.9.1",
"lodash": "^4.17.21"
},
"peerDependencies": {
diff --git a/packages/eslint-plugin-tslint/src/rules/config.ts b/packages/eslint-plugin-tslint/src/rules/config.ts
index 7bf51826541f..0e4b29b50ccf 100644
--- a/packages/eslint-plugin-tslint/src/rules/config.ts
+++ b/packages/eslint-plugin-tslint/src/rules/config.ts
@@ -1,4 +1,4 @@
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
import memoize from 'lodash/memoize';
import { Configuration, RuleSeverity } from 'tslint';
import { CustomLinter } from '../custom-linter';
diff --git a/packages/eslint-plugin-tslint/tests/index.spec.ts b/packages/eslint-plugin-tslint/tests/index.spec.ts
index ab88970867ec..6c0d8cdf9941 100644
--- a/packages/eslint-plugin-tslint/tests/index.spec.ts
+++ b/packages/eslint-plugin-tslint/tests/index.spec.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import * as parser from '@typescript-eslint/parser';
import { readFileSync } from 'fs';
import rule, { Options } from '../src/rules/config';
diff --git a/packages/eslint-plugin-tslint/tsconfig.build.json b/packages/eslint-plugin-tslint/tsconfig.build.json
index 60cfdc79ee76..ce8f56e72947 100644
--- a/packages/eslint-plugin-tslint/tsconfig.build.json
+++ b/packages/eslint-plugin-tslint/tsconfig.build.json
@@ -6,5 +6,5 @@
"resolveJsonModule": true
},
"include": ["src"],
- "references": [{ "path": "../experimental-utils/tsconfig.build.json" }]
+ "references": [{ "path": "../utils/tsconfig.build.json" }]
}
diff --git a/packages/eslint-plugin-tslint/tsconfig.json b/packages/eslint-plugin-tslint/tsconfig.json
index d4bc6ebe57dd..b2f22d5b95db 100644
--- a/packages/eslint-plugin-tslint/tsconfig.json
+++ b/packages/eslint-plugin-tslint/tsconfig.json
@@ -6,5 +6,5 @@
},
"include": ["src", "tests"],
"exclude": ["tests/test-project", "tests/test-tslint-rules-directory"],
- "references": [{ "path": "../experimental-utils/tsconfig.build.json" }]
+ "references": [{ "path": "../utils/tsconfig.build.json" }]
}
diff --git a/packages/eslint-plugin/index.d.ts b/packages/eslint-plugin/index.d.ts
index 8092cabcc4b2..0a45db55e32c 100644
--- a/packages/eslint-plugin/index.d.ts
+++ b/packages/eslint-plugin/index.d.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
export const rules: Record>;
export const configs: Record;
diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json
index 0aa3d4fba704..7d62b026e81f 100644
--- a/packages/eslint-plugin/package.json
+++ b/packages/eslint-plugin/package.json
@@ -44,9 +44,9 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/experimental-utils": "5.9.1",
"@typescript-eslint/scope-manager": "5.9.1",
"@typescript-eslint/type-utils": "5.9.1",
+ "@typescript-eslint/utils": "5.9.1",
"debug": "^4.3.2",
"functional-red-black-tree": "^1.0.1",
"ignore": "^5.1.8",
diff --git a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts
index c0eec499ab3e..ab45274e1651 100644
--- a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts
+++ b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
type RuleNode =
diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts
index f6e601225cef..3c0cad93ed19 100644
--- a/packages/eslint-plugin/src/rules/array-type.ts
+++ b/packages/eslint-plugin/src/rules/array-type.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
/**
diff --git a/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/packages/eslint-plugin/src/rules/ban-ts-comment.ts
index 020b0a33a3b2..96b01d8efc2f 100644
--- a/packages/eslint-plugin/src/rules/ban-ts-comment.ts
+++ b/packages/eslint-plugin/src/rules/ban-ts-comment.ts
@@ -1,4 +1,4 @@
-import { AST_TOKEN_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_TOKEN_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
interface Options {
diff --git a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
index 14d32e72d889..99a427eead07 100644
--- a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
+++ b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
@@ -1,4 +1,4 @@
-import { AST_TOKEN_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_TOKEN_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
// tslint regex
diff --git a/packages/eslint-plugin/src/rules/ban-types.ts b/packages/eslint-plugin/src/rules/ban-types.ts
index ad0620f2185d..38224b15ce93 100644
--- a/packages/eslint-plugin/src/rules/ban-types.ts
+++ b/packages/eslint-plugin/src/rules/ban-types.ts
@@ -1,8 +1,4 @@
-import {
- TSESLint,
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESLint, TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
type Types = Record<
diff --git a/packages/eslint-plugin/src/rules/brace-style.ts b/packages/eslint-plugin/src/rules/brace-style.ts
index 6635303b3865..5d820b4c7e6d 100644
--- a/packages/eslint-plugin/src/rules/brace-style.ts
+++ b/packages/eslint-plugin/src/rules/brace-style.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import {
InferOptionsTypeFromRule,
diff --git a/packages/eslint-plugin/src/rules/class-literal-property-style.ts b/packages/eslint-plugin/src/rules/class-literal-property-style.ts
index b3f9fb401c2f..705485e00503 100644
--- a/packages/eslint-plugin/src/rules/class-literal-property-style.ts
+++ b/packages/eslint-plugin/src/rules/class-literal-property-style.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
type Options = ['fields' | 'getters'];
diff --git a/packages/eslint-plugin/src/rules/comma-dangle.ts b/packages/eslint-plugin/src/rules/comma-dangle.ts
index 298a3e92639c..241b35272846 100644
--- a/packages/eslint-plugin/src/rules/comma-dangle.ts
+++ b/packages/eslint-plugin/src/rules/comma-dangle.ts
@@ -1,9 +1,6 @@
import * as util from '../util';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
const baseRule = getESLintCoreRule('comma-dangle');
diff --git a/packages/eslint-plugin/src/rules/comma-spacing.ts b/packages/eslint-plugin/src/rules/comma-spacing.ts
index c78322be8ea3..2774324d259b 100644
--- a/packages/eslint-plugin/src/rules/comma-spacing.ts
+++ b/packages/eslint-plugin/src/rules/comma-spacing.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_TOKEN_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
import {
isClosingParenToken,
isCommaToken,
diff --git a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts
index 2c00dfd43eb3..bd511d0cd0ef 100644
--- a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts
+++ b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import { createRule } from '../util';
type MessageIds = 'preferRecord' | 'preferIndexSignature';
diff --git a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts
index 617381790665..4a75edd7bda9 100644
--- a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts
+++ b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts
@@ -1,8 +1,5 @@
import * as util from '../util';
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
// intentionally mirroring the options
type MessageIds =
diff --git a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts
index c71d812efd92..56581ef21fc6 100644
--- a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts
+++ b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts
@@ -3,7 +3,7 @@ import {
AST_TOKEN_TYPES,
TSESLint,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as util from '../util';
export default util.createRule({
diff --git a/packages/eslint-plugin/src/rules/consistent-type-exports.ts b/packages/eslint-plugin/src/rules/consistent-type-exports.ts
index 7ad52679226d..36fa561bcb3b 100644
--- a/packages/eslint-plugin/src/rules/consistent-type-exports.ts
+++ b/packages/eslint-plugin/src/rules/consistent-type-exports.ts
@@ -3,7 +3,7 @@ import {
ParserServices,
AST_NODE_TYPES,
TSESLint,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import { SymbolFlags } from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/packages/eslint-plugin/src/rules/consistent-type-imports.ts
index 538c89c3cf3b..6badf04d4dd6 100644
--- a/packages/eslint-plugin/src/rules/consistent-type-imports.ts
+++ b/packages/eslint-plugin/src/rules/consistent-type-imports.ts
@@ -3,7 +3,7 @@ import {
TSESTree,
AST_TOKEN_TYPES,
AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as util from '../util';
type Prefer = 'type-imports' | 'no-type-imports';
diff --git a/packages/eslint-plugin/src/rules/default-param-last.ts b/packages/eslint-plugin/src/rules/default-param-last.ts
index 9673d852dd1d..a701e3765dd6 100644
--- a/packages/eslint-plugin/src/rules/default-param-last.ts
+++ b/packages/eslint-plugin/src/rules/default-param-last.ts
@@ -1,8 +1,5 @@
import { createRule } from '../util';
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
export default createRule({
name: 'default-param-last',
diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts
index 01db4680cbec..29db2f3fe1e2 100644
--- a/packages/eslint-plugin/src/rules/dot-notation.ts
+++ b/packages/eslint-plugin/src/rules/dot-notation.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import * as ts from 'typescript';
import * as tsutils from 'tsutils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts
index e9a27b2b1fc0..233b07bbc6a5 100644
--- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts
+++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
import {
checkFunctionReturnType,
diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
index 8a8446ec0af6..b67221aee54f 100644
--- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
+++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
@@ -3,7 +3,7 @@ import {
AST_TOKEN_TYPES,
TSESLint,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as util from '../util';
type AccessibilityLevel =
diff --git a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts
index adaacaf363f6..5bbfa7ebbea1 100644
--- a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts
+++ b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import { DefinitionType } from '@typescript-eslint/scope-manager';
import * as util from '../util';
import {
diff --git a/packages/eslint-plugin/src/rules/func-call-spacing.ts b/packages/eslint-plugin/src/rules/func-call-spacing.ts
index 254f89396601..3817fe9af412 100644
--- a/packages/eslint-plugin/src/rules/func-call-spacing.ts
+++ b/packages/eslint-plugin/src/rules/func-call-spacing.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
export type Options = [
diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts
index 7c4b78f5b7b5..8c2db5cb18b5 100644
--- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts
+++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts
@@ -1,7 +1,7 @@
// The following code is adapted from the the code in eslint.
// License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import createTree from 'functional-red-black-tree';
export interface TreeValue {
diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts
index 6feea3d95ada..a5fb8d5a448f 100644
--- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts
+++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts
@@ -1,7 +1,7 @@
// The following code is adapted from the the code in eslint.
// License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import { BinarySearchTree, TreeValue } from './BinarySearchTree';
import { TokenInfo } from './TokenInfo';
diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/TokenInfo.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/TokenInfo.ts
index 7dd27346560b..831852d5e665 100644
--- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/TokenInfo.ts
+++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/TokenInfo.ts
@@ -1,7 +1,7 @@
// The following code is adapted from the the code in eslint.
// License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE
-import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESLint, TSESTree } from '@typescript-eslint/utils';
/**
* A helper class to get token-based info related to indentation
diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
index 58da2c044e10..fa7013b9837b 100644
--- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
+++ b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
@@ -7,7 +7,7 @@ import {
AST_TOKEN_TYPES,
TSESLint,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import { OffsetStorage } from './OffsetStorage';
import { TokenInfo } from './TokenInfo';
diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts
index e057ca9886b3..748d720f451a 100644
--- a/packages/eslint-plugin/src/rules/indent.ts
+++ b/packages/eslint-plugin/src/rules/indent.ts
@@ -5,10 +5,7 @@
*/
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/init-declarations.ts b/packages/eslint-plugin/src/rules/init-declarations.ts
index 6cd83e636f9e..611687b0e9f2 100644
--- a/packages/eslint-plugin/src/rules/init-declarations.ts
+++ b/packages/eslint-plugin/src/rules/init-declarations.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import {
createRule,
diff --git a/packages/eslint-plugin/src/rules/keyword-spacing.ts b/packages/eslint-plugin/src/rules/keyword-spacing.ts
index a5620fb7d530..e314ec9de0fc 100644
--- a/packages/eslint-plugin/src/rules/keyword-spacing.ts
+++ b/packages/eslint-plugin/src/rules/keyword-spacing.ts
@@ -1,4 +1,4 @@
-import { AST_TOKEN_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_TOKEN_TYPES } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/lines-between-class-members.ts b/packages/eslint-plugin/src/rules/lines-between-class-members.ts
index c78216b125fc..4446568e8745 100644
--- a/packages/eslint-plugin/src/rules/lines-between-class-members.ts
+++ b/packages/eslint-plugin/src/rules/lines-between-class-members.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/member-delimiter-style.ts b/packages/eslint-plugin/src/rules/member-delimiter-style.ts
index 5fa5a863a6fd..e35b6459de8a 100644
--- a/packages/eslint-plugin/src/rules/member-delimiter-style.ts
+++ b/packages/eslint-plugin/src/rules/member-delimiter-style.ts
@@ -1,8 +1,4 @@
-import {
- TSESLint,
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESLint, TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
type Delimiter = 'comma' | 'none' | 'semi';
diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts
index baaf32aa3553..ce2edabe058f 100644
--- a/packages/eslint-plugin/src/rules/member-ordering.ts
+++ b/packages/eslint-plugin/src/rules/member-ordering.ts
@@ -3,7 +3,7 @@ import {
TSESLint,
TSESTree,
JSONSchema,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as util from '../util';
export type MessageIds = 'incorrectGroupOrder' | 'incorrectOrder';
diff --git a/packages/eslint-plugin/src/rules/method-signature-style.ts b/packages/eslint-plugin/src/rules/method-signature-style.ts
index b05c4f9fbd18..d9dfbdac4bd6 100644
--- a/packages/eslint-plugin/src/rules/method-signature-style.ts
+++ b/packages/eslint-plugin/src/rules/method-signature-style.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
export type Options = [('property' | 'method')?];
diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts
index 4d16617f122e..4136f7186bf4 100644
--- a/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts
@@ -1,4 +1,4 @@
-import { JSONSchema } from '@typescript-eslint/experimental-utils';
+import { JSONSchema } from '@typescript-eslint/utils';
import {
IndividualAndMetaSelectorsString,
MetaSelectors,
diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts
index 9cff76129dba..9a45bc0aeef5 100644
--- a/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts
@@ -1,4 +1,4 @@
-import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESLint, TSESTree } from '@typescript-eslint/utils';
import {
IndividualAndMetaSelectorsString,
MetaSelectors,
diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts
index 374302f7f124..8e8c8711a59f 100644
--- a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as ts from 'typescript';
import {
MetaSelectors,
diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts
index db4463edd985..cc2fa807687e 100644
--- a/packages/eslint-plugin/src/rules/naming-convention.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import { PatternVisitor } from '@typescript-eslint/scope-manager';
import type { ScriptTarget } from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-array-constructor.ts b/packages/eslint-plugin/src/rules/no-array-constructor.ts
index c0eac4a75af8..dfa7656d19b9 100644
--- a/packages/eslint-plugin/src/rules/no-array-constructor.ts
+++ b/packages/eslint-plugin/src/rules/no-array-constructor.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
export default util.createRule({
diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts
index 644bb88152a5..09c4d8376f1e 100644
--- a/packages/eslint-plugin/src/rules/no-base-to-string.ts
+++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts
index 1535a6433978..5538781598aa 100644
--- a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts
+++ b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts
@@ -3,7 +3,7 @@ import {
AST_TOKEN_TYPES,
TSESLint,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as util from '../util';
export default util.createRule({
diff --git a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts
index 696c3d7af2dc..0fed18413bd8 100644
--- a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts
+++ b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-dupe-class-members.ts b/packages/eslint-plugin/src/rules/no-dupe-class-members.ts
index e9cb151d6d69..843a74118954 100644
--- a/packages/eslint-plugin/src/rules/no-dupe-class-members.ts
+++ b/packages/eslint-plugin/src/rules/no-dupe-class-members.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-duplicate-imports.ts b/packages/eslint-plugin/src/rules/no-duplicate-imports.ts
index f270e7600d1a..9a3ef4395e23 100644
--- a/packages/eslint-plugin/src/rules/no-duplicate-imports.ts
+++ b/packages/eslint-plugin/src/rules/no-duplicate-imports.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts
index 716590c66b66..8824095ab742 100644
--- a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts
+++ b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts
@@ -1,8 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
- TSESLint,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-empty-function.ts b/packages/eslint-plugin/src/rules/no-empty-function.ts
index 51ec13e3ff04..806312b21174 100644
--- a/packages/eslint-plugin/src/rules/no-empty-function.ts
+++ b/packages/eslint-plugin/src/rules/no-empty-function.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-empty-interface.ts b/packages/eslint-plugin/src/rules/no-empty-interface.ts
index ee472e703903..e89859190915 100644
--- a/packages/eslint-plugin/src/rules/no-empty-interface.ts
+++ b/packages/eslint-plugin/src/rules/no-empty-interface.ts
@@ -1,5 +1,5 @@
import * as util from '../util';
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
type Options = [
{
diff --git a/packages/eslint-plugin/src/rules/no-explicit-any.ts b/packages/eslint-plugin/src/rules/no-explicit-any.ts
index a41d443e9243..8617ab0bdbe7 100644
--- a/packages/eslint-plugin/src/rules/no-explicit-any.ts
+++ b/packages/eslint-plugin/src/rules/no-explicit-any.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
export type Options = [
diff --git a/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
index 1ea8970da2fe..6ffe529700ae 100644
--- a/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
+++ b/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
export default util.createRule({
diff --git a/packages/eslint-plugin/src/rules/no-extra-parens.ts b/packages/eslint-plugin/src/rules/no-extra-parens.ts
index 743c22596c18..24659aedfe4b 100644
--- a/packages/eslint-plugin/src/rules/no-extra-parens.ts
+++ b/packages/eslint-plugin/src/rules/no-extra-parens.ts
@@ -1,11 +1,7 @@
// any is required to work around manipulating the AST in weird ways
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */
-import {
- AST_NODE_TYPES,
- TSESTree,
- TSESLint,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree, TSESLint } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-extraneous-class.ts b/packages/eslint-plugin/src/rules/no-extraneous-class.ts
index 2686ab0f478d..aa2184c9b160 100644
--- a/packages/eslint-plugin/src/rules/no-extraneous-class.ts
+++ b/packages/eslint-plugin/src/rules/no-extraneous-class.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
type Options = [
diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts
index edd262253234..cdea51721e8f 100644
--- a/packages/eslint-plugin/src/rules/no-floating-promises.ts
+++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts
@@ -1,10 +1,6 @@
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
-import {
- TSESLint,
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { TSESLint, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts b/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts
index aa050794c4ae..b48d68fde451 100644
--- a/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts
+++ b/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts
@@ -1,8 +1,5 @@
import * as util from '../util';
-import {
- TSESLint,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils';
export type Options = [
{
diff --git a/packages/eslint-plugin/src/rules/no-implied-eval.ts b/packages/eslint-plugin/src/rules/no-implied-eval.ts
index f11a7f8d7b31..54938b9fd490 100644
--- a/packages/eslint-plugin/src/rules/no-implied-eval.ts
+++ b/packages/eslint-plugin/src/rules/no-implied-eval.ts
@@ -1,8 +1,5 @@
import * as ts from 'typescript';
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-inferrable-types.ts b/packages/eslint-plugin/src/rules/no-inferrable-types.ts
index 9c8a1a14c20b..dc3216f4f603 100644
--- a/packages/eslint-plugin/src/rules/no-inferrable-types.ts
+++ b/packages/eslint-plugin/src/rules/no-inferrable-types.ts
@@ -1,8 +1,5 @@
/* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
type Options = [
diff --git a/packages/eslint-plugin/src/rules/no-invalid-this.ts b/packages/eslint-plugin/src/rules/no-invalid-this.ts
index 1cd1be027b94..5884cc61dfa0 100644
--- a/packages/eslint-plugin/src/rules/no-invalid-this.ts
+++ b/packages/eslint-plugin/src/rules/no-invalid-this.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import {
InferOptionsTypeFromRule,
diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts
index dceffa6d893e..cd28cfa16da7 100644
--- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts
+++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
interface Options {
diff --git a/packages/eslint-plugin/src/rules/no-loop-func.ts b/packages/eslint-plugin/src/rules/no-loop-func.ts
index 4496dea91fc8..7d4a238f5f4c 100644
--- a/packages/eslint-plugin/src/rules/no-loop-func.ts
+++ b/packages/eslint-plugin/src/rules/no-loop-func.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-loss-of-precision.ts b/packages/eslint-plugin/src/rules/no-loss-of-precision.ts
index d095def03cc9..2e02b1878363 100644
--- a/packages/eslint-plugin/src/rules/no-loss-of-precision.ts
+++ b/packages/eslint-plugin/src/rules/no-loss-of-precision.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
import { maybeGetESLintCoreRule } from '../util/getESLintCoreRule';
diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts
index d989ac0eec12..772eaf49ea1a 100644
--- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts
+++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
diff --git a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts
index 28cc7b6b051d..a1dd87681304 100644
--- a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts
+++ b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts
@@ -1,8 +1,4 @@
-import {
- ESLintUtils,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as util from '../util';
import * as ts from 'typescript';
diff --git a/packages/eslint-plugin/src/rules/no-misused-new.ts b/packages/eslint-plugin/src/rules/no-misused-new.ts
index ae79c28a6f2e..da5f034c9653 100644
--- a/packages/eslint-plugin/src/rules/no-misused-new.ts
+++ b/packages/eslint-plugin/src/rules/no-misused-new.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
export default util.createRule({
diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts
index 353b7d4a8038..6e42e5474361 100644
--- a/packages/eslint-plugin/src/rules/no-misused-promises.ts
+++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
diff --git a/packages/eslint-plugin/src/rules/no-namespace.ts b/packages/eslint-plugin/src/rules/no-namespace.ts
index f7fb0ea1e328..c8c3ff213954 100644
--- a/packages/eslint-plugin/src/rules/no-namespace.ts
+++ b/packages/eslint-plugin/src/rules/no-namespace.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
type Options = [
diff --git a/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts
index 93431950c35d..db8b1cf860c7 100644
--- a/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts
+++ b/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts
@@ -1,8 +1,4 @@
-import {
- ASTUtils,
- TSESTree,
- TSESLint,
-} from '@typescript-eslint/experimental-utils';
+import { ASTUtils, TSESTree, TSESLint } from '@typescript-eslint/utils';
import { Definition, DefinitionType } from '@typescript-eslint/scope-manager';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts b/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts
index 9fdba130b97e..979b0af394cb 100644
--- a/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts
+++ b/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts
@@ -1,8 +1,4 @@
-import {
- TSESTree,
- TSESLint,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as ts from 'typescript';
import * as semver from 'semver';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts
index cd9f0dbb2552..296973999311 100644
--- a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts
+++ b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts
@@ -1,7 +1,4 @@
-import {
- TSESLint,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
type MessageIds = 'noNonNull' | 'suggestOptionalChain';
diff --git a/packages/eslint-plugin/src/rules/no-parameter-properties.ts b/packages/eslint-plugin/src/rules/no-parameter-properties.ts
index 613b839bbdfa..3ab01614e72c 100644
--- a/packages/eslint-plugin/src/rules/no-parameter-properties.ts
+++ b/packages/eslint-plugin/src/rules/no-parameter-properties.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
type Modifier =
diff --git a/packages/eslint-plugin/src/rules/no-redeclare.ts b/packages/eslint-plugin/src/rules/no-redeclare.ts
index 914dd074d33f..d81c5225d08b 100644
--- a/packages/eslint-plugin/src/rules/no-redeclare.ts
+++ b/packages/eslint-plugin/src/rules/no-redeclare.ts
@@ -1,8 +1,4 @@
-import {
- TSESTree,
- TSESLint,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
type MessageIds = 'redeclared' | 'redeclaredAsBuiltin' | 'redeclaredBySyntax';
diff --git a/packages/eslint-plugin/src/rules/no-require-imports.ts b/packages/eslint-plugin/src/rules/no-require-imports.ts
index 49bd5f237b06..3ef5ecc0df3a 100644
--- a/packages/eslint-plugin/src/rules/no-require-imports.ts
+++ b/packages/eslint-plugin/src/rules/no-require-imports.ts
@@ -1,4 +1,4 @@
-import { ASTUtils, TSESTree } from '@typescript-eslint/experimental-utils';
+import { ASTUtils, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
export default util.createRule({
diff --git a/packages/eslint-plugin/src/rules/no-restricted-imports.ts b/packages/eslint-plugin/src/rules/no-restricted-imports.ts
index 2429795240e4..ff2f8d77b4e3 100644
--- a/packages/eslint-plugin/src/rules/no-restricted-imports.ts
+++ b/packages/eslint-plugin/src/rules/no-restricted-imports.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import type {
ArrayOfStringOrObject,
ArrayOfStringOrObjectPatterns,
diff --git a/packages/eslint-plugin/src/rules/no-shadow.ts b/packages/eslint-plugin/src/rules/no-shadow.ts
index 68214ddd3383..3f13f587de16 100644
--- a/packages/eslint-plugin/src/rules/no-shadow.ts
+++ b/packages/eslint-plugin/src/rules/no-shadow.ts
@@ -3,7 +3,7 @@ import {
AST_NODE_TYPES,
TSESLint,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import {
Definition,
DefinitionType,
diff --git a/packages/eslint-plugin/src/rules/no-this-alias.ts b/packages/eslint-plugin/src/rules/no-this-alias.ts
index 82ab9b22b0fa..5c9c9f568811 100644
--- a/packages/eslint-plugin/src/rules/no-this-alias.ts
+++ b/packages/eslint-plugin/src/rules/no-this-alias.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
type Options = [
diff --git a/packages/eslint-plugin/src/rules/no-throw-literal.ts b/packages/eslint-plugin/src/rules/no-throw-literal.ts
index 152e93483785..f248ef9cb8d4 100644
--- a/packages/eslint-plugin/src/rules/no-throw-literal.ts
+++ b/packages/eslint-plugin/src/rules/no-throw-literal.ts
@@ -1,9 +1,6 @@
import * as ts from 'typescript';
import * as util from '../util';
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
type MessageIds = 'object' | 'undef';
diff --git a/packages/eslint-plugin/src/rules/no-type-alias.ts b/packages/eslint-plugin/src/rules/no-type-alias.ts
index 347e36f0a425..2d9847eb3094 100644
--- a/packages/eslint-plugin/src/rules/no-type-alias.ts
+++ b/packages/eslint-plugin/src/rules/no-type-alias.ts
@@ -2,7 +2,7 @@ import {
AST_NODE_TYPES,
AST_TOKEN_TYPES,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as util from '../util';
type Values =
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts
index 4474713b3ff1..e3768b28aa06 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
index 48a3a4d039de..4e18a9f631e4 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
@@ -2,7 +2,7 @@ import {
TSESTree,
AST_NODE_TYPES,
AST_TOKEN_TYPES,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as ts from 'typescript';
import {
unionTypeParts,
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
index 1f4652085bda..dae21746efc8 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as ts from 'typescript';
import * as tsutils from 'tsutils';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts
index 9f7d718c2d92..67244961bca6 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts
index cd5bce1845d5..38c9b267ac8a 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import {
isObjectType,
isObjectFlagSet,
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
index 68895c01e71d..c3d8e6fbb390 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as semver from 'semver';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-unsafe-argument.ts b/packages/eslint-plugin/src/rules/no-unsafe-argument.ts
index 3df1e6a486c0..ff823638a94d 100644
--- a/packages/eslint-plugin/src/rules/no-unsafe-argument.ts
+++ b/packages/eslint-plugin/src/rules/no-unsafe-argument.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts
index cb4b8e7c636a..d40c06f624be 100644
--- a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts
+++ b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-unsafe-call.ts b/packages/eslint-plugin/src/rules/no-unsafe-call.ts
index 781908f9497b..d062aa28cadc 100644
--- a/packages/eslint-plugin/src/rules/no-unsafe-call.ts
+++ b/packages/eslint-plugin/src/rules/no-unsafe-call.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as util from '../util';
import { getThisExpression } from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
index 6e9555a5a3e4..4a930890d881 100644
--- a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
+++ b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as util from '../util';
import { getThisExpression } from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-unsafe-return.ts b/packages/eslint-plugin/src/rules/no-unsafe-return.ts
index e226d526bca0..8e9e4099cada 100644
--- a/packages/eslint-plugin/src/rules/no-unsafe-return.ts
+++ b/packages/eslint-plugin/src/rules/no-unsafe-return.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as util from '../util';
import { getThisExpression } from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-unused-expressions.ts b/packages/eslint-plugin/src/rules/no-unused-expressions.ts
index 91d9f4e4a384..56eb1521a0d9 100644
--- a/packages/eslint-plugin/src/rules/no-unused-expressions.ts
+++ b/packages/eslint-plugin/src/rules/no-unused-expressions.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts
index 7cce473557c4..139089a74486 100644
--- a/packages/eslint-plugin/src/rules/no-unused-vars.ts
+++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import { PatternVisitor } from '@typescript-eslint/scope-manager';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts
index 83cf552fda52..3a5b51938b79 100644
--- a/packages/eslint-plugin/src/rules/no-use-before-define.ts
+++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import { DefinitionType } from '@typescript-eslint/scope-manager';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-useless-constructor.ts b/packages/eslint-plugin/src/rules/no-useless-constructor.ts
index f656af264818..0bbe2f6f64ce 100644
--- a/packages/eslint-plugin/src/rules/no-useless-constructor.ts
+++ b/packages/eslint-plugin/src/rules/no-useless-constructor.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-var-requires.ts b/packages/eslint-plugin/src/rules/no-var-requires.ts
index 1bf51efe8102..36f0e7515d1f 100644
--- a/packages/eslint-plugin/src/rules/no-var-requires.ts
+++ b/packages/eslint-plugin/src/rules/no-var-requires.ts
@@ -1,8 +1,4 @@
-import {
- ASTUtils,
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { ASTUtils, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
type Options = [];
diff --git a/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts b/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts
index 1577c3b94489..69fc21736ded 100644
--- a/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts
+++ b/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
diff --git a/packages/eslint-plugin/src/rules/object-curly-spacing.ts b/packages/eslint-plugin/src/rules/object-curly-spacing.ts
index fe74c8f7da40..c64ca54ba177 100644
--- a/packages/eslint-plugin/src/rules/object-curly-spacing.ts
+++ b/packages/eslint-plugin/src/rules/object-curly-spacing.ts
@@ -2,7 +2,7 @@ import {
AST_NODE_TYPES,
AST_TOKEN_TYPES,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import {
createRule,
diff --git a/packages/eslint-plugin/src/rules/padding-line-between-statements.ts b/packages/eslint-plugin/src/rules/padding-line-between-statements.ts
index aab53cbba4ac..bc5f30aa7512 100644
--- a/packages/eslint-plugin/src/rules/padding-line-between-statements.ts
+++ b/packages/eslint-plugin/src/rules/padding-line-between-statements.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
/**
diff --git a/packages/eslint-plugin/src/rules/prefer-as-const.ts b/packages/eslint-plugin/src/rules/prefer-as-const.ts
index 93bcce50889d..09bd8423c22f 100644
--- a/packages/eslint-plugin/src/rules/prefer-as-const.ts
+++ b/packages/eslint-plugin/src/rules/prefer-as-const.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
export default util.createRule({
diff --git a/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts b/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts
index 5ad6dccd7cce..c6247abd7390 100644
--- a/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts
+++ b/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts
@@ -1,4 +1,4 @@
-import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
type MessageIds = 'defineInitializer' | 'defineInitializerSuggestion';
diff --git a/packages/eslint-plugin/src/rules/prefer-for-of.ts b/packages/eslint-plugin/src/rules/prefer-for-of.ts
index 453d126c813e..3355fda2ec60 100644
--- a/packages/eslint-plugin/src/rules/prefer-for-of.ts
+++ b/packages/eslint-plugin/src/rules/prefer-for-of.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
export default util.createRule({
diff --git a/packages/eslint-plugin/src/rules/prefer-function-type.ts b/packages/eslint-plugin/src/rules/prefer-function-type.ts
index ceeafcd841c3..d13d187276e6 100644
--- a/packages/eslint-plugin/src/rules/prefer-function-type.ts
+++ b/packages/eslint-plugin/src/rules/prefer-function-type.ts
@@ -3,7 +3,7 @@ import {
AST_TOKEN_TYPES,
TSESLint,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as util from '../util';
export const phrases = {
diff --git a/packages/eslint-plugin/src/rules/prefer-includes.ts b/packages/eslint-plugin/src/rules/prefer-includes.ts
index f15a756abc4a..0e12b4ca259f 100644
--- a/packages/eslint-plugin/src/rules/prefer-includes.ts
+++ b/packages/eslint-plugin/src/rules/prefer-includes.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST as RegExpAST, parseRegExpLiteral } from 'regexpp';
import * as ts from 'typescript';
import {
diff --git a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts
index 8f10eb9be369..f64482a06f5c 100644
--- a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts
+++ b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import { createRule } from '../util';
export default createRule({
diff --git a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts
index 4af7c9812534..769a0cd6e39a 100644
--- a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts
+++ b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- AST_TOKEN_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
export default util.createRule({
diff --git a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts
index 6975576edcaa..b492287d4bbe 100644
--- a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts
+++ b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts
@@ -3,7 +3,7 @@ import {
AST_TOKEN_TYPES,
TSESLint,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as util from '../util';
export type Options = [
diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
index 84c2e15e3975..109deaa6d60d 100644
--- a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
+++ b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
- TSESLint,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree, TSESLint } from '@typescript-eslint/utils';
import * as util from '../util';
type ValidChainTarget =
diff --git a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts
index ed3e4ba284b1..23e2752a7afb 100644
--- a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts
+++ b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
type Options = [
diff --git a/packages/eslint-plugin/src/rules/prefer-readonly.ts b/packages/eslint-plugin/src/rules/prefer-readonly.ts
index 7b0fbfee3af7..19597264bbcb 100644
--- a/packages/eslint-plugin/src/rules/prefer-readonly.ts
+++ b/packages/eslint-plugin/src/rules/prefer-readonly.ts
@@ -2,11 +2,7 @@ import * as tsutils from 'tsutils';
import * as ts from 'typescript';
import * as util from '../util';
import { typeIsOrHasBaseType } from '../util';
-import {
- ASTUtils,
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { ASTUtils, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
type MessageIds = 'preferReadonly';
type Options = [
diff --git a/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts b/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts
index a797bfdf48f3..d9fe3a3071a5 100644
--- a/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts
+++ b/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
type MemberExpressionWithCallExpressionParent = TSESTree.MemberExpression & {
diff --git a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts
index bb91f3408460..07c98a69240a 100644
--- a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts
+++ b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
import {
diff --git a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts
index 15faf74d1ed3..0368300bbd6d 100644
--- a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts
+++ b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as ts from 'typescript';
import { createRule, forEachReturnStatement, getParserServices } from '../util';
diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts
index 9bf63c08431a..501693efc50b 100644
--- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts
+++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST as RegExpAST, RegExpParser } from 'regexpp';
import {
createRule,
diff --git a/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts b/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts
index 15c070298cb1..17f1c465f1a8 100644
--- a/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts
+++ b/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts
@@ -1,12 +1,6 @@
import * as util from '../util';
-import {
- AST_TOKEN_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
-import {
- RuleFixer,
- RuleFix,
-} from '@typescript-eslint/experimental-utils/dist/ts-eslint';
+import { AST_TOKEN_TYPES, TSESTree } from '@typescript-eslint/utils';
+import { RuleFixer, RuleFix } from '@typescript-eslint/utils/dist/ts-eslint';
type MessageIds = 'preferExpectErrorComment';
diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts
index 083afcebe712..bf49764a6818 100644
--- a/packages/eslint-plugin/src/rules/promise-function-async.ts
+++ b/packages/eslint-plugin/src/rules/promise-function-async.ts
@@ -2,7 +2,7 @@ import {
AST_NODE_TYPES,
AST_TOKEN_TYPES,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/quotes.ts b/packages/eslint-plugin/src/rules/quotes.ts
index a22782cc08ea..d24ac0995333 100644
--- a/packages/eslint-plugin/src/rules/quotes.ts
+++ b/packages/eslint-plugin/src/rules/quotes.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts
index 25476314d73f..ae9ea48a4fac 100644
--- a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts
+++ b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
export type Options = [
diff --git a/packages/eslint-plugin/src/rules/require-await.ts b/packages/eslint-plugin/src/rules/require-await.ts
index f0935b202ea9..56067fe554a4 100644
--- a/packages/eslint-plugin/src/rules/require-await.ts
+++ b/packages/eslint-plugin/src/rules/require-await.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts
index afcbf9abf2f3..5ccae1aca105 100644
--- a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts
+++ b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/restrict-template-expressions.ts b/packages/eslint-plugin/src/rules/restrict-template-expressions.ts
index f39bc88cfe59..b4d70ab53502 100644
--- a/packages/eslint-plugin/src/rules/restrict-template-expressions.ts
+++ b/packages/eslint-plugin/src/rules/restrict-template-expressions.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/return-await.ts b/packages/eslint-plugin/src/rules/return-await.ts
index 93b863757a0b..dfdb75fa30d7 100644
--- a/packages/eslint-plugin/src/rules/return-await.ts
+++ b/packages/eslint-plugin/src/rules/return-await.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/semi.ts b/packages/eslint-plugin/src/rules/semi.ts
index a923310915c6..8df56137311f 100644
--- a/packages/eslint-plugin/src/rules/semi.ts
+++ b/packages/eslint-plugin/src/rules/semi.ts
@@ -1,8 +1,4 @@
-import {
- TSESTree,
- TSESLint,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts
index 942cae423df9..fcdaa00152de 100644
--- a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts
+++ b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts
@@ -1,8 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
import { getEnumNames } from '../util';
diff --git a/packages/eslint-plugin/src/rules/space-before-function-paren.ts b/packages/eslint-plugin/src/rules/space-before-function-paren.ts
index 8f848f92742a..6c6995db02f6 100644
--- a/packages/eslint-plugin/src/rules/space-before-function-paren.ts
+++ b/packages/eslint-plugin/src/rules/space-before-function-paren.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
type Option = 'never' | 'always';
diff --git a/packages/eslint-plugin/src/rules/space-infix-ops.ts b/packages/eslint-plugin/src/rules/space-infix-ops.ts
index fddeaac6fb6f..a38b57825f2f 100644
--- a/packages/eslint-plugin/src/rules/space-infix-ops.ts
+++ b/packages/eslint-plugin/src/rules/space-infix-ops.ts
@@ -1,7 +1,4 @@
-import {
- AST_TOKEN_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_TOKEN_TYPES, TSESTree } from '@typescript-eslint/utils';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts
index bf8d67098402..0a91b2fca950 100644
--- a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts
+++ b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts
@@ -2,7 +2,7 @@ import {
AST_NODE_TYPES,
ParserServices,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts b/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts
index 08f21e3364ca..49ed2d905b69 100644
--- a/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts
+++ b/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts
@@ -1,4 +1,4 @@
-import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESLint, TSESTree } from '@typescript-eslint/utils';
import * as ts from 'typescript';
import {
createRule,
diff --git a/packages/eslint-plugin/src/rules/triple-slash-reference.ts b/packages/eslint-plugin/src/rules/triple-slash-reference.ts
index ba8bce5ae8a7..cf769237fff9 100644
--- a/packages/eslint-plugin/src/rules/triple-slash-reference.ts
+++ b/packages/eslint-plugin/src/rules/triple-slash-reference.ts
@@ -2,7 +2,7 @@ import {
AST_NODE_TYPES,
AST_TOKEN_TYPES,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import * as util from '../util';
type Options = [
diff --git a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts
index d02b8777d5ff..d10040fdf8df 100644
--- a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts
+++ b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
import {
isClassOrTypeElement,
diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts
index 700fd347c778..ed78693d48b7 100644
--- a/packages/eslint-plugin/src/rules/typedef.ts
+++ b/packages/eslint-plugin/src/rules/typedef.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
const enum OptionKeys {
diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts
index 15ddf8b89109..2dd6aafaebf1 100644
--- a/packages/eslint-plugin/src/rules/unbound-method.ts
+++ b/packages/eslint-plugin/src/rules/unbound-method.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'tsutils';
import * as ts from 'typescript';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts
index 7481dcd70312..b5a1d8a97ba3 100644
--- a/packages/eslint-plugin/src/rules/unified-signatures.ts
+++ b/packages/eslint-plugin/src/rules/unified-signatures.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
interface Failure {
diff --git a/packages/eslint-plugin/src/util/astUtils.ts b/packages/eslint-plugin/src/util/astUtils.ts
index 67bdfca5aa19..e9ac5c51f34d 100644
--- a/packages/eslint-plugin/src/util/astUtils.ts
+++ b/packages/eslint-plugin/src/util/astUtils.ts
@@ -1,9 +1,9 @@
-import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { escapeRegExp } from './escapeRegExp';
import * as ts from 'typescript';
// deeply re-export, for convenience
-export * from '@typescript-eslint/experimental-utils/dist/ast-utils';
+export * from '@typescript-eslint/utils/dist/ast-utils';
// The following is copied from `eslint`'s source code since it doesn't exist in eslint@5.
// https://github.com/eslint/eslint/blob/145aec1ab9052fbca96a44d04927c595951b1536/lib/rules/utils/ast-utils.js#L1751-L1779
diff --git a/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/packages/eslint-plugin/src/util/collectUnusedVariables.ts
index fe44354fc30d..6fe14b0d2725 100644
--- a/packages/eslint-plugin/src/util/collectUnusedVariables.ts
+++ b/packages/eslint-plugin/src/util/collectUnusedVariables.ts
@@ -4,7 +4,7 @@ import {
ASTUtils,
TSESTree,
ESLintUtils,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import { ImplicitLibVariable } from '@typescript-eslint/scope-manager';
import { Visitor } from '@typescript-eslint/scope-manager/dist/referencer/Visitor';
diff --git a/packages/eslint-plugin/src/util/createRule.ts b/packages/eslint-plugin/src/util/createRule.ts
index 3d2f75aeba91..1008ffcc11bd 100644
--- a/packages/eslint-plugin/src/util/createRule.ts
+++ b/packages/eslint-plugin/src/util/createRule.ts
@@ -1,4 +1,4 @@
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
export const createRule = ESLintUtils.RuleCreator(
name => `https://typescript-eslint.io/rules/${name}`,
diff --git a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts
index c69f8591ae7b..3b737ad4f41f 100644
--- a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts
+++ b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts
@@ -3,7 +3,7 @@ import {
AST_NODE_TYPES,
ESLintUtils,
TSESLint,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import { isTypeAssertion, isConstructor, isSetter } from './astUtils';
import { getFunctionHeadLoc } from './getFunctionHeadLoc';
diff --git a/packages/eslint-plugin/src/util/getESLintCoreRule.ts b/packages/eslint-plugin/src/util/getESLintCoreRule.ts
index 7c2427c8fcb9..f61bdb0c3094 100644
--- a/packages/eslint-plugin/src/util/getESLintCoreRule.ts
+++ b/packages/eslint-plugin/src/util/getESLintCoreRule.ts
@@ -1,4 +1,4 @@
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
import { version } from 'eslint/package.json';
import * as semver from 'semver';
diff --git a/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts b/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts
index 7604a8d496fc..a9d30838d2dd 100644
--- a/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts
+++ b/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts
@@ -3,7 +3,7 @@ import {
AST_TOKEN_TYPES,
TSESLint,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
type FunctionNode =
| TSESTree.ArrowFunctionExpression
diff --git a/packages/eslint-plugin/src/util/getThisExpression.ts b/packages/eslint-plugin/src/util/getThisExpression.ts
index 5e2772aebaec..73405464b3fd 100644
--- a/packages/eslint-plugin/src/util/getThisExpression.ts
+++ b/packages/eslint-plugin/src/util/getThisExpression.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
export function getThisExpression(
node: TSESTree.Node,
diff --git a/packages/eslint-plugin/src/util/getWrappingFixer.ts b/packages/eslint-plugin/src/util/getWrappingFixer.ts
index aa01520fdbd5..af7885efc41a 100644
--- a/packages/eslint-plugin/src/util/getWrappingFixer.ts
+++ b/packages/eslint-plugin/src/util/getWrappingFixer.ts
@@ -3,7 +3,7 @@ import {
TSESLint,
ASTUtils,
TSESTree,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
interface WrappingFixerParams {
/** Source code. */
diff --git a/packages/eslint-plugin/src/util/index.ts b/packages/eslint-plugin/src/util/index.ts
index 48641babf289..a83198807a67 100644
--- a/packages/eslint-plugin/src/util/index.ts
+++ b/packages/eslint-plugin/src/util/index.ts
@@ -1,4 +1,4 @@
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
export * from './astUtils';
export * from './collectUnusedVariables';
diff --git a/packages/eslint-plugin/src/util/misc.ts b/packages/eslint-plugin/src/util/misc.ts
index 4c6b71d2a4de..eb62a029b154 100644
--- a/packages/eslint-plugin/src/util/misc.ts
+++ b/packages/eslint-plugin/src/util/misc.ts
@@ -2,11 +2,7 @@
* @fileoverview Really small utility functions that didn't deserve their own files
*/
-import {
- AST_NODE_TYPES,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils';
import { requiresQuoting } from '@typescript-eslint/type-utils';
/**
diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts
index dad454369c19..7479d99f29a8 100644
--- a/packages/eslint-plugin/tests/RuleTester.ts
+++ b/packages/eslint-plugin/tests/RuleTester.ts
@@ -1,4 +1,4 @@
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
import * as path from 'path';
function getFixturesRootDir(): string {
diff --git a/packages/eslint-plugin/tests/rules/array-type.test.ts b/packages/eslint-plugin/tests/rules/array-type.test.ts
index cfdfb80ec1a6..a00f72cdba1b 100644
--- a/packages/eslint-plugin/tests/rules/array-type.test.ts
+++ b/packages/eslint-plugin/tests/rules/array-type.test.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import * as parser from '@typescript-eslint/parser';
import rule, { OptionString } from '../../src/rules/array-type';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/ban-types.test.ts b/packages/eslint-plugin/tests/rules/ban-types.test.ts
index 64e6bcd33086..a200336e0aa1 100644
--- a/packages/eslint-plugin/tests/rules/ban-types.test.ts
+++ b/packages/eslint-plugin/tests/rules/ban-types.test.ts
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule, {
MessageIds,
Options,
diff --git a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts
index 561660a7f456..da5068753cab 100644
--- a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts
+++ b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts
@@ -17,8 +17,8 @@ ruleTester.run('consistent-type-exports', rule, {
valid: [
"export { Foo } from 'foo';",
"export type { AnalyzeOptions } from '@typescript-eslint/scope-manager';",
- "export { BlockScope } from '@typescript-eslint/experimental-utils';",
- "export type { BlockScope } from '@typescript-eslint/experimental-utils';",
+ "export { BlockScope } from '@typescript-eslint/utils';",
+ "export type { BlockScope } from '@typescript-eslint/utils';",
`
const variable = 1;
class Class {}
diff --git a/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts b/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts
index 2c5d0e577764..11650e2b014c 100644
--- a/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts
+++ b/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts
@@ -3,7 +3,7 @@
/* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */
/* eslint-enable eslint-comments/no-use */
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule, { MessageIds, Options } from '../../src/rules/func-call-spacing';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts b/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts
index d03ee3ea9dc8..e6483ce5deea 100644
--- a/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts
+++ b/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts
@@ -9,10 +9,7 @@
/* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */
/* eslint-enable eslint-comments/no-use */
-import {
- AST_TOKEN_TYPES,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { AST_TOKEN_TYPES, AST_NODE_TYPES } from '@typescript-eslint/utils';
import fs from 'fs';
import path from 'path';
import rule from '../../../src/rules/indent-new-do-not-use';
diff --git a/packages/eslint-plugin/tests/rules/indent/indent.test.ts b/packages/eslint-plugin/tests/rules/indent/indent.test.ts
index 3d6b58725f8b..32b1f91fae0f 100644
--- a/packages/eslint-plugin/tests/rules/indent/indent.test.ts
+++ b/packages/eslint-plugin/tests/rules/indent/indent.test.ts
@@ -3,10 +3,7 @@
/* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */
/* eslint-enable eslint-comments/no-use */
-import {
- AST_NODE_TYPES,
- TSESLint,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils';
import { RuleTester } from '../../RuleTester';
import rule from '../../../src/rules/indent';
import {
diff --git a/packages/eslint-plugin/tests/rules/indent/utils.ts b/packages/eslint-plugin/tests/rules/indent/utils.ts
index badfbc1c3c6f..628389a451ed 100644
--- a/packages/eslint-plugin/tests/rules/indent/utils.ts
+++ b/packages/eslint-plugin/tests/rules/indent/utils.ts
@@ -5,7 +5,7 @@ import {
AST_NODE_TYPES,
AST_TOKEN_TYPES,
TSESLint,
-} from '@typescript-eslint/experimental-utils';
+} from '@typescript-eslint/utils';
import rule from '../../../src/rules/indent';
import { InferMessageIdsTypeFromRule } from '../../../src/util';
diff --git a/packages/eslint-plugin/tests/rules/init-declarations.test.ts b/packages/eslint-plugin/tests/rules/init-declarations.test.ts
index 1d5dc73655f2..95d9a08799aa 100644
--- a/packages/eslint-plugin/tests/rules/init-declarations.test.ts
+++ b/packages/eslint-plugin/tests/rules/init-declarations.test.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/init-declarations';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts b/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts
index ec94928c1c59..a2a92ad42ae4 100644
--- a/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts
+++ b/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts
@@ -2,7 +2,7 @@
// this rule tests the spacing, which prettier will want to fix and break the tests
/* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */
/* eslint-enable eslint-comments/no-use */
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule, { MessageIds, Options } from '../../src/rules/keyword-spacing';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-case-insensitive-order.test.ts b/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-case-insensitive-order.test.ts
index db62c3151010..24907a8d8f43 100644
--- a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-case-insensitive-order.test.ts
+++ b/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-case-insensitive-order.test.ts
@@ -4,7 +4,7 @@ import rule, {
Options,
} from '../../src/rules/member-ordering';
import { RuleTester } from '../RuleTester';
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
diff --git a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-order.test.ts b/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-order.test.ts
index 1386aee7909e..dfd5f0de83cd 100644
--- a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-order.test.ts
+++ b/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-order.test.ts
@@ -4,7 +4,7 @@ import rule, {
Options,
} from '../../src/rules/member-ordering';
import { RuleTester } from '../RuleTester';
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
diff --git a/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/packages/eslint-plugin/tests/rules/member-ordering.test.ts
index cbab8ced2a37..c9c1090c7348 100644
--- a/packages/eslint-plugin/tests/rules/member-ordering.test.ts
+++ b/packages/eslint-plugin/tests/rules/member-ordering.test.ts
@@ -1,6 +1,6 @@
import rule, { MessageIds, Options } from '../../src/rules/member-ordering';
import { RuleTester } from '../RuleTester';
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
diff --git a/packages/eslint-plugin/tests/rules/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention.test.ts
index b8ad03a53a61..ef1235008809 100644
--- a/packages/eslint-plugin/tests/rules/naming-convention.test.ts
+++ b/packages/eslint-plugin/tests/rules/naming-convention.test.ts
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule, { MessageIds, Options } from '../../src/rules/naming-convention';
import {
PredefinedFormatsString,
diff --git a/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts
index af760d299992..439cd85731c3 100644
--- a/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-array-constructor';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts b/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts
index cb99564c943d..37d6b99b29f1 100644
--- a/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts
@@ -1,6 +1,6 @@
import rule, { MessageIds, Options } from '../../src/rules/no-explicit-any';
import { RuleTester } from '../RuleTester';
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
type InvalidTestCase = TSESLint.InvalidTestCase;
type SuggestionOutput = TSESLint.SuggestionOutput;
diff --git a/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts b/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts
index 44d32490a102..799410971f27 100644
--- a/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-extraneous-class';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts b/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts
index 7c3ec3091859..0fd7679a6505 100644
--- a/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-for-in-array';
import { RuleTester, getFixturesRootDir } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts b/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
index fc216c6c4764..d85806b69c4e 100644
--- a/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-inferrable-types';
import { RuleTester } from '../RuleTester';
import {
diff --git a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts
index be22ae267c0f..4ad0153cc20e 100644
--- a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-loop-func';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts
index c371a738755e..bd3384b36315 100644
--- a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts
@@ -1,7 +1,4 @@
-import {
- AST_NODE_TYPES,
- AST_TOKEN_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
import { RuleTester } from '../RuleTester';
import rule from '../../src/rules/no-redeclare';
diff --git a/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts b/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts
index 059a7d1cad8f..8e4ea58c55af 100644
--- a/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-restricted-imports';
import { RuleTester } from '../RuleTester';
@@ -536,10 +536,10 @@ ruleTester.run('no-restricted-imports', rule, {
],
},
{
- code: "import type { InvalidTestCase } from '@typescript-eslint/experimental-utils/dist/ts-eslint';",
+ code: "import type { InvalidTestCase } from '@typescript-eslint/utils/dist/ts-eslint';",
options: [
{
- patterns: ['@typescript-eslint/experimental-utils/dist/*'],
+ patterns: ['@typescript-eslint/utils/dist/*'],
},
],
errors: [
diff --git a/packages/eslint-plugin/tests/rules/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow.test.ts
index 929ddf9d389e..635dff307e1f 100644
--- a/packages/eslint-plugin/tests/rules/no-shadow.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-shadow.test.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-shadow';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts
index 43806a67fd9c..0a8f7340bca8 100644
--- a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-this-alias';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts
index 82196fbc8a1e..3e86749956c2 100644
--- a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts
@@ -1,7 +1,7 @@
import {
TestCaseError,
InvalidTestCase,
-} from '@typescript-eslint/experimental-utils/dist/ts-eslint';
+} from '@typescript-eslint/utils/dist/ts-eslint';
import * as path from 'path';
import rule, {
Options,
diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts
index a03cdc7d7479..7dd7fd2747d2 100644
--- a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-unnecessary-qualifier';
import { RuleTester, getFixturesRootDir } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts
index 7cd169601392..3b6c8168ce8e 100644
--- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts
@@ -15,7 +15,7 @@ const ruleTester = new RuleTester({
ruleTester.run('no-unnecessary-type-assertion', rule, {
valid: [
`
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
declare const member: TSESTree.TSEnumMember;
if (
member.id.type === AST_NODE_TYPES.Literal &&
diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts
index f9594fc93481..78ef7e78b38b 100644
--- a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-unsafe-assignment';
import {
RuleTester,
diff --git a/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts
index 06d9019f38a6..cf9082af764a 100644
--- a/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-unused-expressions';
import { noFormat, RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts
index 8ef68ae781ce..9ddde4e9f24e 100644
--- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts
@@ -4,10 +4,7 @@
'use strict';
-import {
- AST_NODE_TYPES,
- TSESLint,
-} from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils';
import rule, { MessageIds } from '../../../src/rules/no-unused-vars';
import { RuleTester } from '../../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts
index e585b66e3ac1..32924973a5c2 100644
--- a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts
@@ -1,6 +1,6 @@
import rule from '../../src/rules/no-use-before-define';
import { RuleTester } from '../RuleTester';
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
diff --git a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts
index 0730f280dc2f..7cedb9151e3e 100644
--- a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/no-useless-constructor';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts b/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts
index 7b917a673086..c64a7e17b9a0 100644
--- a/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts
+++ b/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts
@@ -3,7 +3,7 @@
/* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */
/* eslint-enable eslint-comments/no-use */
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/object-curly-spacing';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts b/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts
index 51aa85234890..50fb8370b187 100644
--- a/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts
+++ b/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts
@@ -1,4 +1,4 @@
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule, { phrases } from '../../src/rules/prefer-function-type';
import { noFormat, RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts
index a984484edd51..8096df94c329 100644
--- a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts
+++ b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule, {
MessageIds,
Options,
diff --git a/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts b/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
index feb7f9bd524d..d6ac19abb896 100644
--- a/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
+++ b/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts
@@ -1,6 +1,6 @@
import rule from '../../src/rules/prefer-optional-chain';
import { RuleTester, noFormat } from '../RuleTester';
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import {
InferMessageIdsTypeFromRule,
InferOptionsTypeFromRule,
diff --git a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts
index be50f096963a..f17a19f1f6d6 100644
--- a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts
+++ b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import { RuleTester, getFixturesRootDir } from '../RuleTester';
import rule from '../../src/rules/prefer-readonly-parameter-types';
import {
diff --git a/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts b/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
index aefb7cd8d2d9..d1e76250d571 100644
--- a/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
+++ b/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule from '../../src/rules/prefer-string-starts-ends-with';
import { RuleTester, getFixturesRootDir } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts
index 6a0451ed8580..53ba5cb81a0b 100644
--- a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts
+++ b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts
@@ -1,4 +1,4 @@
-import { noFormat } from '@typescript-eslint/experimental-utils/src/eslint-utils';
+import { noFormat } from '@typescript-eslint/utils/src/eslint-utils';
import rule from '../../src/rules/promise-function-async';
import { getFixturesRootDir, RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/semi.test.ts b/packages/eslint-plugin/tests/rules/semi.test.ts
index 48c68a2f059e..b5d88f77a932 100644
--- a/packages/eslint-plugin/tests/rules/semi.test.ts
+++ b/packages/eslint-plugin/tests/rules/semi.test.ts
@@ -3,7 +3,7 @@
/* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */
/* eslint-enable eslint-comments/no-use */
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule, { MessageIds, Options } from '../../src/rules/semi';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts b/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts
index a0cf2d71dd59..a5eeb2f2fa48 100644
--- a/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts
+++ b/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule, {
MessageIds,
Options,
diff --git a/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts
index 13c68b88bc79..72405cf35d6b 100644
--- a/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts
+++ b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts
@@ -3,7 +3,7 @@
/* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */
/* eslint-enable eslint-comments/no-use */
-import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/space-before-function-paren';
import { RuleTester } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts b/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts
index 19349a808898..17ae884c72f1 100644
--- a/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts
+++ b/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts
@@ -3,7 +3,7 @@
/* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */
/* eslint-enable eslint-comments/no-use */
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import { RuleTester } from '../RuleTester';
import rule from '../../src/rules/type-annotation-spacing';
import {
diff --git a/packages/eslint-plugin/tests/rules/unbound-method.test.ts b/packages/eslint-plugin/tests/rules/unbound-method.test.ts
index 3075e93fe67a..524f64a47a44 100644
--- a/packages/eslint-plugin/tests/rules/unbound-method.test.ts
+++ b/packages/eslint-plugin/tests/rules/unbound-method.test.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import rule, { MessageIds, Options } from '../../src/rules/unbound-method';
import { RuleTester, getFixturesRootDir } from '../RuleTester';
diff --git a/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts b/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts
index bcbb4c6d5fbb..8e2b48e4bed9 100644
--- a/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts
+++ b/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts
@@ -1,4 +1,4 @@
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import { getFixturesRootDir, RuleTester } from '../RuleTester';
import { createRule, getWrappingFixer } from '../../src/util';
diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts
index ed84f286496b..f1da74b67c76 100644
--- a/packages/eslint-plugin/tools/generate-configs.ts
+++ b/packages/eslint-plugin/tools/generate-configs.ts
@@ -1,4 +1,4 @@
-import { TSESLint } from '@typescript-eslint/experimental-utils';
+import { TSESLint } from '@typescript-eslint/utils';
import chalk from 'chalk';
import fs from 'fs';
import path from 'path';
diff --git a/packages/eslint-plugin/tsconfig.build.json b/packages/eslint-plugin/tsconfig.build.json
index fc60d9a85a78..af60c77e84f4 100644
--- a/packages/eslint-plugin/tsconfig.build.json
+++ b/packages/eslint-plugin/tsconfig.build.json
@@ -10,7 +10,7 @@
},
"include": ["src", "typings"],
"references": [
- { "path": "../experimental-utils/tsconfig.build.json" },
+ { "path": "../utils/tsconfig.build.json" },
{ "path": "../parser/tsconfig.build.json" },
{ "path": "../scope-manager/tsconfig.build.json" },
{ "path": "../type-utils/tsconfig.build.json" }
diff --git a/packages/eslint-plugin/tsconfig.json b/packages/eslint-plugin/tsconfig.json
index 31db855dad82..7801773b539b 100644
--- a/packages/eslint-plugin/tsconfig.json
+++ b/packages/eslint-plugin/tsconfig.json
@@ -6,7 +6,7 @@
},
"include": ["src", "typings", "tests", "tools", "index.d.ts"],
"references": [
- { "path": "../experimental-utils/tsconfig.build.json" },
+ { "path": "../utils/tsconfig.build.json" },
{ "path": "../parser/tsconfig.build.json" },
{ "path": "../scope-manager/tsconfig.build.json" },
{ "path": "../type-utils/tsconfig.build.json" }
diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts
index 44b679281fbd..a279276e91b0 100644
--- a/packages/eslint-plugin/typings/eslint-rules.d.ts
+++ b/packages/eslint-plugin/typings/eslint-rules.d.ts
@@ -5,7 +5,7 @@
// }
declare module 'eslint/lib/rules/arrow-parens' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
| 'unexpectedParens'
@@ -26,7 +26,7 @@ declare module 'eslint/lib/rules/arrow-parens' {
}
declare module 'eslint/lib/rules/camelcase' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'notCamelCase',
@@ -46,7 +46,7 @@ declare module 'eslint/lib/rules/camelcase' {
}
declare module 'eslint/lib/rules/indent' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
type ElementList = number | 'first' | 'off';
const rule: TSESLint.RuleModule<
@@ -142,8 +142,8 @@ declare module 'eslint/lib/rules/indent' {
}
declare module 'eslint/lib/rules/keyword-spacing' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
- import { RuleFunction } from '@typescript-eslint/experimental-utils/dist/ts-eslint';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
+ import { RuleFunction } from '@typescript-eslint/utils/dist/ts-eslint';
type Options = [
{
@@ -221,7 +221,7 @@ declare module 'eslint/lib/rules/keyword-spacing' {
}
declare module 'eslint/lib/rules/no-dupe-class-members' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'unexpected',
@@ -242,7 +242,7 @@ declare module 'eslint/lib/rules/no-dupe-class-members' {
}
declare module 'eslint/lib/rules/no-dupe-args' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'unexpected',
@@ -256,7 +256,7 @@ declare module 'eslint/lib/rules/no-dupe-args' {
}
declare module 'eslint/lib/rules/no-empty-function' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'unexpected',
@@ -274,7 +274,7 @@ declare module 'eslint/lib/rules/no-empty-function' {
}
declare module 'eslint/lib/rules/no-implicit-globals' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
| 'globalNonLexicalBinding'
@@ -291,7 +291,7 @@ declare module 'eslint/lib/rules/no-implicit-globals' {
}
declare module 'eslint/lib/rules/no-loop-func' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'unsafeRefs',
@@ -306,7 +306,7 @@ declare module 'eslint/lib/rules/no-loop-func' {
}
declare module 'eslint/lib/rules/no-magic-numbers' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'noMagic',
@@ -329,7 +329,7 @@ declare module 'eslint/lib/rules/no-magic-numbers' {
}
declare module 'eslint/lib/rules/no-redeclare' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'redeclared' | 'redeclaredAsBuiltin' | 'redeclaredBySyntax',
@@ -346,7 +346,7 @@ declare module 'eslint/lib/rules/no-redeclare' {
}
declare module 'eslint/lib/rules/no-restricted-globals' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'defaultMessage' | 'customMessage',
@@ -365,7 +365,7 @@ declare module 'eslint/lib/rules/no-restricted-globals' {
}
declare module 'eslint/lib/rules/no-shadow' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'noShadow',
@@ -384,7 +384,7 @@ declare module 'eslint/lib/rules/no-shadow' {
}
declare module 'eslint/lib/rules/no-undef' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'undef',
@@ -401,7 +401,7 @@ declare module 'eslint/lib/rules/no-undef' {
}
declare module 'eslint/lib/rules/no-unused-vars' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'unusedVar',
@@ -426,7 +426,7 @@ declare module 'eslint/lib/rules/no-unused-vars' {
}
declare module 'eslint/lib/rules/no-unused-expressions' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'expected',
@@ -445,7 +445,7 @@ declare module 'eslint/lib/rules/no-unused-expressions' {
}
declare module 'eslint/lib/rules/no-use-before-define' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'usedBeforeDefine',
@@ -465,7 +465,7 @@ declare module 'eslint/lib/rules/no-use-before-define' {
}
declare module 'eslint/lib/rules/strict' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
| 'function'
@@ -487,7 +487,7 @@ declare module 'eslint/lib/rules/strict' {
}
declare module 'eslint/lib/rules/no-useless-constructor' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'noUselessConstructor',
@@ -500,7 +500,7 @@ declare module 'eslint/lib/rules/no-useless-constructor' {
}
declare module 'eslint/lib/rules/no-extra-parens' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'unexpected',
@@ -557,7 +557,7 @@ declare module 'eslint/lib/rules/no-extra-parens' {
}
declare module 'eslint/lib/rules/semi' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'missingSemi' | 'extraSemi',
@@ -587,7 +587,7 @@ declare module 'eslint/lib/rules/semi' {
}
declare module 'eslint/lib/rules/quotes' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'wrongQuotes',
@@ -607,7 +607,7 @@ declare module 'eslint/lib/rules/quotes' {
}
declare module 'eslint/lib/rules/brace-style' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
| 'nextLineOpen'
@@ -634,7 +634,7 @@ declare module 'eslint/lib/rules/brace-style' {
}
declare module 'eslint/lib/rules/no-extra-semi' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'unexpected',
@@ -654,7 +654,7 @@ declare module 'eslint/lib/rules/no-extra-semi' {
}
declare module 'eslint/lib/rules/lines-between-class-members' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'always' | 'never',
@@ -673,7 +673,7 @@ declare module 'eslint/lib/rules/lines-between-class-members' {
}
declare module 'eslint/lib/rules/init-declarations' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'initialized' | 'notInitialized',
@@ -691,7 +691,7 @@ declare module 'eslint/lib/rules/init-declarations' {
}
declare module 'eslint/lib/rules/no-invalid-this' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'unexpectedThis',
@@ -713,7 +713,7 @@ declare module 'eslint/lib/rules/no-invalid-this' {
export = rule;
}
declare module 'eslint/lib/rules/dot-notation' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'useDot' | 'useBrackets',
@@ -734,7 +734,7 @@ declare module 'eslint/lib/rules/dot-notation' {
}
declare module 'eslint/lib/rules/no-loss-of-precision' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'noLossOfPrecision',
@@ -747,7 +747,7 @@ declare module 'eslint/lib/rules/no-loss-of-precision' {
}
declare module 'eslint/lib/rules/comma-dangle' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
type StringOptions =
| 'always-multiline'
@@ -780,7 +780,7 @@ declare module 'eslint/lib/rules/comma-dangle' {
}
declare module 'eslint/lib/rules/no-duplicate-imports' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
| 'import'
@@ -806,7 +806,7 @@ declare module 'eslint/lib/rules/no-duplicate-imports' {
}
declare module 'eslint/lib/rules/space-infix-ops' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'missingSpace',
@@ -828,7 +828,7 @@ declare module 'eslint/lib/rules/space-infix-ops' {
}
declare module 'eslint/lib/rules/prefer-const' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
'useConst',
@@ -847,7 +847,7 @@ declare module 'eslint/lib/rules/prefer-const' {
}
declare module 'eslint/lib/rules/object-curly-spacing' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
const rule: TSESLint.RuleModule<
| 'requireSpaceBefore'
@@ -872,7 +872,7 @@ declare module 'eslint/lib/rules/object-curly-spacing' {
}
declare module 'eslint/lib/rules/no-restricted-imports' {
- import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+ import { TSESLint, TSESTree } from '@typescript-eslint/utils';
namespace rule {
export type ArrayOfStringOrObject = (
diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md
index eecafe20025a..a1fce3cc9eb1 100644
--- a/packages/experimental-utils/CHANGELOG.md
+++ b/packages/experimental-utils/CHANGELOG.md
@@ -1,5 +1,7 @@
# Change Log
+> ⚠ Changes for version 6.0 onwards are documented in the `@typescript-eslint/utils` changelog.
+
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
diff --git a/packages/experimental-utils/README.md b/packages/experimental-utils/README.md
index 7f9f6b242078..3073308c16bb 100644
--- a/packages/experimental-utils/README.md
+++ b/packages/experimental-utils/README.md
@@ -4,33 +4,21 @@
-
-
+
+
## Note
-This package has inherited its version number from the `@typescript-eslint` project.
-Meaning that even though this package is `2.x.y`, you shouldn't expect 100% stability between minor version bumps.
-i.e. treat it as a `0.x.y` package.
+**This package is purely a re-export of `@typescript-eslint/utils`.**
+You should switch to importing from that non-experimental package instead.
-Feel free to use it now, and let us know what utilities you need or send us PRs with utilities you build on top of it.
+```diff
+- import { RuleCreator } from '@typescript-eslint/experimental-utils';
++ import { RuleCreator } from '@typescript-eslint/utils';
+```
-Once it is stable, it will be renamed to `@typescript-eslint/util` for a `6.0.0` release.
-
-## Exports
-
-| Name | Description |
-| -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| [`ASTUtils`](./src/ast-utils) | Tools for operating on the ESTree AST. Also includes the [`eslint-utils`](https://www.npmjs.com/package/eslint-utils) package, correctly typed to work with the types found in `TSESTree` |
-| [`ESLintUtils`](./src/eslint-utils) | Tools for creating ESLint rules with TypeScript. |
-| `JSONSchema` | Types from the [`@types/json-schema`](https://www.npmjs.com/package/@types/json-schema) package, re-exported to save you having to manually import them. Also ensures you're using the same version of the types as this package. |
-| [`TSESLint`](./src/ts-eslint) | Types for ESLint, correctly typed to work with the types found in `TSESTree`. |
-| [`TSESLintScope`](./src/ts-eslint-scope) | The [`eslint-scope`](https://www.npmjs.com/package/eslint-scope) package, correctly typed to work with the types found in both `TSESTree` and `TSESLint` |
-| [`TSESTree`](../types/src/ts-estree.ts) | Types for the TypeScript flavor of ESTree created by `@typescript-eslint/typescript-estree`. |
-| [`AST_NODE_TYPES`](../types/src/ast-node-types.ts) | An enum with the names of every single _node_ found in `TSESTree`. |
-| [`AST_TOKEN_TYPES`](../types/src/ast-token-types.ts) | An enum with the names of every single _token_ found in `TSESTree`. |
-| [`ParserServices`](../typescript-estree/src/parser-options.ts) | Typing for the parser services provided when parsing a file using `@typescript-eslint/typescript-estree`. |
+> ⚠ A future major version of this old package will `console.warn` to ask you to switch.
## Contributing
diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json
index fc09b4f2d8bc..342f8955f1be 100644
--- a/packages/experimental-utils/package.json
+++ b/packages/experimental-utils/package.json
@@ -35,16 +35,10 @@
"postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
- "test": "jest --coverage",
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@types/json-schema": "^7.0.9",
- "@typescript-eslint/scope-manager": "5.9.1",
- "@typescript-eslint/types": "5.9.1",
- "@typescript-eslint/typescript-estree": "5.9.1",
- "eslint-scope": "^5.1.1",
- "eslint-utils": "^3.0.0"
+ "@typescript-eslint/utils": "5.9.1"
},
"peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
@@ -55,12 +49,5 @@
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
- },
- "typesVersions": {
- "<3.8": {
- "*": [
- "_ts3.4/*"
- ]
- }
}
}
diff --git a/packages/experimental-utils/src/index.ts b/packages/experimental-utils/src/index.ts
index 31328386269a..ae481e0310b2 100644
--- a/packages/experimental-utils/src/index.ts
+++ b/packages/experimental-utils/src/index.ts
@@ -1,8 +1,2 @@
-import * as ASTUtils from './ast-utils';
-import * as ESLintUtils from './eslint-utils';
-import * as JSONSchema from './json-schema';
-import * as TSESLint from './ts-eslint';
-import * as TSESLintScope from './ts-eslint-scope';
-
-export { ASTUtils, ESLintUtils, JSONSchema, TSESLint, TSESLintScope };
-export * from './ts-estree';
+// TODO (#4139): Once typescript-eslint hits v7, this package will console.warn to switch...
+export * from '@typescript-eslint/utils';
diff --git a/packages/parser/tsconfig.build.json b/packages/parser/tsconfig.build.json
index 1725797310b0..8556d0307225 100644
--- a/packages/parser/tsconfig.build.json
+++ b/packages/parser/tsconfig.build.json
@@ -8,7 +8,7 @@
},
"include": ["src"],
"references": [
- { "path": "../experimental-utils/tsconfig.build.json" },
+ { "path": "../utils/tsconfig.build.json" },
{ "path": "../scope-manager/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../typescript-estree/tsconfig.build.json" }
diff --git a/packages/parser/tsconfig.json b/packages/parser/tsconfig.json
index f69f9ce10787..ae4f11eded6e 100644
--- a/packages/parser/tsconfig.json
+++ b/packages/parser/tsconfig.json
@@ -7,7 +7,7 @@
"include": ["src", "tests", "tools"],
"exclude": ["tests/fixtures"],
"references": [
- { "path": "../experimental-utils/tsconfig.build.json" },
+ { "path": "../utils/tsconfig.build.json" },
{ "path": "../scope-manager/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../typescript-estree/tsconfig.build.json" }
diff --git a/packages/type-utils/README.md b/packages/type-utils/README.md
index 099067095a41..19a4bf7e964d 100644
--- a/packages/type-utils/README.md
+++ b/packages/type-utils/README.md
@@ -8,7 +8,7 @@
-This utilities in this package are separated from `@typescript-eslint/experimental-utils` so that that package does not require a dependency on `typescript`.
+This utilities in this package are separated from `@typescript-eslint/utils` so that that package does not require a dependency on `typescript`.
## Contributing
diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json
index 924b71ccbe1b..cd0c1209d8d6 100644
--- a/packages/type-utils/package.json
+++ b/packages/type-utils/package.json
@@ -39,7 +39,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/experimental-utils": "5.9.1",
+ "@typescript-eslint/utils": "5.9.1",
"debug": "^4.3.2",
"tsutils": "^3.21.0"
},
diff --git a/packages/type-utils/src/isTypeReadonly.ts b/packages/type-utils/src/isTypeReadonly.ts
index 7f689b5b7df1..d5d05e94a0e8 100644
--- a/packages/type-utils/src/isTypeReadonly.ts
+++ b/packages/type-utils/src/isTypeReadonly.ts
@@ -1,4 +1,4 @@
-import { ESLintUtils } from '@typescript-eslint/experimental-utils';
+import { ESLintUtils } from '@typescript-eslint/utils';
import {
isObjectType,
isUnionType,
diff --git a/packages/type-utils/src/isUnsafeAssignment.ts b/packages/type-utils/src/isUnsafeAssignment.ts
index 32dc84b0c306..926e215ae087 100644
--- a/packages/type-utils/src/isUnsafeAssignment.ts
+++ b/packages/type-utils/src/isUnsafeAssignment.ts
@@ -1,7 +1,4 @@
-import {
- TSESTree,
- AST_NODE_TYPES,
-} from '@typescript-eslint/experimental-utils';
+import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils';
import { isTypeReference } from 'tsutils';
import * as ts from 'typescript';
import { isTypeAnyType, isTypeUnknownType } from './predicates';
diff --git a/packages/type-utils/tests/isUnsafeAssignment.test.ts b/packages/type-utils/tests/isUnsafeAssignment.test.ts
index 060dc880e53a..6b794705751b 100644
--- a/packages/type-utils/tests/isUnsafeAssignment.test.ts
+++ b/packages/type-utils/tests/isUnsafeAssignment.test.ts
@@ -1,5 +1,5 @@
import * as ts from 'typescript';
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import { parseForESLint } from '@typescript-eslint/parser';
import { isUnsafeAssignment } from '../src/isUnsafeAssignment';
import path from 'path';
diff --git a/packages/type-utils/tsconfig.build.json b/packages/type-utils/tsconfig.build.json
index 3b5743aaf5d9..782f14402ae4 100644
--- a/packages/type-utils/tsconfig.build.json
+++ b/packages/type-utils/tsconfig.build.json
@@ -7,5 +7,5 @@
"resolveJsonModule": true
},
"include": ["src", "typings"],
- "references": [{ "path": "../experimental-utils/tsconfig.build.json" }]
+ "references": [{ "path": "../utils/tsconfig.build.json" }]
}
diff --git a/packages/type-utils/tsconfig.json b/packages/type-utils/tsconfig.json
index 9c0c2ac4ba52..93bec73e74ac 100644
--- a/packages/type-utils/tsconfig.json
+++ b/packages/type-utils/tsconfig.json
@@ -5,5 +5,5 @@
"rootDir": "."
},
"include": ["src", "typings", "tests", "tools"],
- "references": [{ "path": "../experimental-utils/tsconfig.build.json" }]
+ "references": [{ "path": "../utils/tsconfig.build.json" }]
}
diff --git a/packages/types/README.md b/packages/types/README.md
index 5c91f1687d22..273ac71a9368 100644
--- a/packages/types/README.md
+++ b/packages/types/README.md
@@ -9,7 +9,7 @@
This package exists to help us reduce cycles and provide lighter-weight packages at runtime.
You probably don't want to use it directly.
-If you're building an ESLint plugin, consider using [`@typescript-eslint/experimental-utils`](../experimental-utils).
+If you're building an ESLint plugin, consider using [`@typescript-eslint/utils`](../utils).
If you're parsing TypeScript code, consider using [`@typescript-eslint/typescript-estree`](../typescript-estree).
## Contributing
diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md
new file mode 100644
index 000000000000..e4d87c4d45c4
--- /dev/null
+++ b/packages/utils/CHANGELOG.md
@@ -0,0 +1,4 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
diff --git a/packages/utils/LICENSE b/packages/utils/LICENSE
new file mode 100644
index 000000000000..7e7370143b26
--- /dev/null
+++ b/packages/utils/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 TypeScript ESLint and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/packages/utils/README.md b/packages/utils/README.md
new file mode 100644
index 000000000000..d517cc457a53
--- /dev/null
+++ b/packages/utils/README.md
@@ -0,0 +1,27 @@
+
Utils for ESLint Plugins
+
+
Utilities for working with TypeScript + ESLint together.
+
+
+
+
+
+
+
+## Exports
+
+| Name | Description |
+| -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| [`ASTUtils`](./src/ast-utils) | Tools for operating on the ESTree AST. Also includes the [`eslint-utils`](https://www.npmjs.com/package/eslint-utils) package, correctly typed to work with the types found in `TSESTree` |
+| [`ESLintUtils`](./src/eslint-utils) | Tools for creating ESLint rules with TypeScript. |
+| `JSONSchema` | Types from the [`@types/json-schema`](https://www.npmjs.com/package/@types/json-schema) package, re-exported to save you having to manually import them. Also ensures you're using the same version of the types as this package. |
+| [`TSESLint`](./src/ts-eslint) | Types for ESLint, correctly typed to work with the types found in `TSESTree`. |
+| [`TSESLintScope`](./src/ts-eslint-scope) | The [`eslint-scope`](https://www.npmjs.com/package/eslint-scope) package, correctly typed to work with the types found in both `TSESTree` and `TSESLint` |
+| [`TSESTree`](../types/src/ts-estree.ts) | Types for the TypeScript flavor of ESTree created by `@typescript-eslint/typescript-estree`. |
+| [`AST_NODE_TYPES`](../types/src/ast-node-types.ts) | An enum with the names of every single _node_ found in `TSESTree`. |
+| [`AST_TOKEN_TYPES`](../types/src/ast-token-types.ts) | An enum with the names of every single _token_ found in `TSESTree`. |
+| [`ParserServices`](../typescript-estree/src/parser-options.ts) | Typing for the parser services provided when parsing a file using `@typescript-eslint/typescript-estree`. |
+
+## Contributing
+
+[See the contributing guide here](../../CONTRIBUTING.md)
diff --git a/packages/utils/jest.config.js b/packages/utils/jest.config.js
new file mode 100644
index 000000000000..bf4e270e3760
--- /dev/null
+++ b/packages/utils/jest.config.js
@@ -0,0 +1,21 @@
+'use strict';
+
+// @ts-check
+/** @type {import('@jest/types').Config.InitialOptions} */
+module.exports = {
+ resolver: '/../../tests/jest-resolver.js',
+ globals: {
+ 'ts-jest': {
+ isolatedModules: true,
+ },
+ },
+ testEnvironment: 'node',
+ transform: {
+ '^.+\\.tsx?$': 'ts-jest',
+ },
+ testRegex: './tests/.+\\.test\\.ts$',
+ collectCoverage: false,
+ collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
+ coverageReporters: ['text-summary', 'lcov'],
+};
diff --git a/packages/utils/package.json b/packages/utils/package.json
new file mode 100644
index 000000000000..be1a712fff32
--- /dev/null
+++ b/packages/utils/package.json
@@ -0,0 +1,66 @@
+{
+ "name": "@typescript-eslint/utils",
+ "version": "5.9.1",
+ "description": "Utilities for working with TypeScript + ESLint together",
+ "keywords": [
+ "eslint",
+ "typescript",
+ "estree"
+ ],
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "files": [
+ "dist",
+ "_ts3.4",
+ "package.json",
+ "README.md",
+ "LICENSE"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/typescript-eslint/typescript-eslint.git",
+ "directory": "packages/utils"
+ },
+ "bugs": {
+ "url": "https://github.com/typescript-eslint/typescript-eslint/issues"
+ },
+ "license": "MIT",
+ "main": "dist/index.js",
+ "types": "dist/index.d.ts",
+ "scripts": {
+ "build": "tsc -b tsconfig.build.json",
+ "postbuild": "downlevel-dts dist _ts3.4/dist",
+ "clean": "tsc -b tsconfig.build.json --clean",
+ "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage",
+ "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
+ "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
+ "test": "jest --coverage",
+ "typecheck": "tsc -p tsconfig.json --noEmit"
+ },
+ "dependencies": {
+ "@types/json-schema": "^7.0.9",
+ "@typescript-eslint/scope-manager": "5.9.1",
+ "@typescript-eslint/types": "5.9.1",
+ "@typescript-eslint/typescript-estree": "5.9.1",
+ "eslint-scope": "^5.1.1",
+ "eslint-utils": "^3.0.0"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ },
+ "devDependencies": {
+ "typescript": "*"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "typesVersions": {
+ "<3.8": {
+ "*": [
+ "_ts3.4/*"
+ ]
+ }
+ }
+}
diff --git a/packages/utils/project.json b/packages/utils/project.json
new file mode 100644
index 000000000000..b55a371ba33e
--- /dev/null
+++ b/packages/utils/project.json
@@ -0,0 +1,5 @@
+{
+ "root": "packages/utils",
+ "type": "library",
+ "implicitDependencies": []
+}
diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/PatternMatcher.ts b/packages/utils/src/ast-utils/eslint-utils/PatternMatcher.ts
similarity index 100%
rename from packages/experimental-utils/src/ast-utils/eslint-utils/PatternMatcher.ts
rename to packages/utils/src/ast-utils/eslint-utils/PatternMatcher.ts
diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/ReferenceTracker.ts b/packages/utils/src/ast-utils/eslint-utils/ReferenceTracker.ts
similarity index 100%
rename from packages/experimental-utils/src/ast-utils/eslint-utils/ReferenceTracker.ts
rename to packages/utils/src/ast-utils/eslint-utils/ReferenceTracker.ts
diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/astUtilities.ts b/packages/utils/src/ast-utils/eslint-utils/astUtilities.ts
similarity index 100%
rename from packages/experimental-utils/src/ast-utils/eslint-utils/astUtilities.ts
rename to packages/utils/src/ast-utils/eslint-utils/astUtilities.ts
diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/index.ts b/packages/utils/src/ast-utils/eslint-utils/index.ts
similarity index 100%
rename from packages/experimental-utils/src/ast-utils/eslint-utils/index.ts
rename to packages/utils/src/ast-utils/eslint-utils/index.ts
diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts b/packages/utils/src/ast-utils/eslint-utils/predicates.ts
similarity index 100%
rename from packages/experimental-utils/src/ast-utils/eslint-utils/predicates.ts
rename to packages/utils/src/ast-utils/eslint-utils/predicates.ts
diff --git a/packages/experimental-utils/src/ast-utils/eslint-utils/scopeAnalysis.ts b/packages/utils/src/ast-utils/eslint-utils/scopeAnalysis.ts
similarity index 100%
rename from packages/experimental-utils/src/ast-utils/eslint-utils/scopeAnalysis.ts
rename to packages/utils/src/ast-utils/eslint-utils/scopeAnalysis.ts
diff --git a/packages/experimental-utils/src/ast-utils/helpers.ts b/packages/utils/src/ast-utils/helpers.ts
similarity index 100%
rename from packages/experimental-utils/src/ast-utils/helpers.ts
rename to packages/utils/src/ast-utils/helpers.ts
diff --git a/packages/experimental-utils/src/ast-utils/index.ts b/packages/utils/src/ast-utils/index.ts
similarity index 100%
rename from packages/experimental-utils/src/ast-utils/index.ts
rename to packages/utils/src/ast-utils/index.ts
diff --git a/packages/experimental-utils/src/ast-utils/misc.ts b/packages/utils/src/ast-utils/misc.ts
similarity index 100%
rename from packages/experimental-utils/src/ast-utils/misc.ts
rename to packages/utils/src/ast-utils/misc.ts
diff --git a/packages/experimental-utils/src/ast-utils/predicates.ts b/packages/utils/src/ast-utils/predicates.ts
similarity index 100%
rename from packages/experimental-utils/src/ast-utils/predicates.ts
rename to packages/utils/src/ast-utils/predicates.ts
diff --git a/packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts b/packages/utils/src/eslint-utils/InferTypesFromRule.ts
similarity index 100%
rename from packages/experimental-utils/src/eslint-utils/InferTypesFromRule.ts
rename to packages/utils/src/eslint-utils/InferTypesFromRule.ts
diff --git a/packages/experimental-utils/src/eslint-utils/RuleCreator.ts b/packages/utils/src/eslint-utils/RuleCreator.ts
similarity index 100%
rename from packages/experimental-utils/src/eslint-utils/RuleCreator.ts
rename to packages/utils/src/eslint-utils/RuleCreator.ts
diff --git a/packages/experimental-utils/src/eslint-utils/RuleTester.ts b/packages/utils/src/eslint-utils/RuleTester.ts
similarity index 100%
rename from packages/experimental-utils/src/eslint-utils/RuleTester.ts
rename to packages/utils/src/eslint-utils/RuleTester.ts
diff --git a/packages/experimental-utils/src/eslint-utils/applyDefault.ts b/packages/utils/src/eslint-utils/applyDefault.ts
similarity index 100%
rename from packages/experimental-utils/src/eslint-utils/applyDefault.ts
rename to packages/utils/src/eslint-utils/applyDefault.ts
diff --git a/packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts b/packages/utils/src/eslint-utils/batchedSingleLineTests.ts
similarity index 100%
rename from packages/experimental-utils/src/eslint-utils/batchedSingleLineTests.ts
rename to packages/utils/src/eslint-utils/batchedSingleLineTests.ts
diff --git a/packages/experimental-utils/src/eslint-utils/deepMerge.ts b/packages/utils/src/eslint-utils/deepMerge.ts
similarity index 100%
rename from packages/experimental-utils/src/eslint-utils/deepMerge.ts
rename to packages/utils/src/eslint-utils/deepMerge.ts
diff --git a/packages/experimental-utils/src/eslint-utils/getParserServices.ts b/packages/utils/src/eslint-utils/getParserServices.ts
similarity index 100%
rename from packages/experimental-utils/src/eslint-utils/getParserServices.ts
rename to packages/utils/src/eslint-utils/getParserServices.ts
diff --git a/packages/experimental-utils/src/eslint-utils/index.ts b/packages/utils/src/eslint-utils/index.ts
similarity index 100%
rename from packages/experimental-utils/src/eslint-utils/index.ts
rename to packages/utils/src/eslint-utils/index.ts
diff --git a/packages/experimental-utils/src/eslint-utils/nullThrows.ts b/packages/utils/src/eslint-utils/nullThrows.ts
similarity index 100%
rename from packages/experimental-utils/src/eslint-utils/nullThrows.ts
rename to packages/utils/src/eslint-utils/nullThrows.ts
diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts
new file mode 100644
index 000000000000..31328386269a
--- /dev/null
+++ b/packages/utils/src/index.ts
@@ -0,0 +1,8 @@
+import * as ASTUtils from './ast-utils';
+import * as ESLintUtils from './eslint-utils';
+import * as JSONSchema from './json-schema';
+import * as TSESLint from './ts-eslint';
+import * as TSESLintScope from './ts-eslint-scope';
+
+export { ASTUtils, ESLintUtils, JSONSchema, TSESLint, TSESLintScope };
+export * from './ts-estree';
diff --git a/packages/experimental-utils/src/json-schema.ts b/packages/utils/src/json-schema.ts
similarity index 100%
rename from packages/experimental-utils/src/json-schema.ts
rename to packages/utils/src/json-schema.ts
diff --git a/packages/experimental-utils/src/ts-eslint-scope/Definition.ts b/packages/utils/src/ts-eslint-scope/Definition.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint-scope/Definition.ts
rename to packages/utils/src/ts-eslint-scope/Definition.ts
diff --git a/packages/experimental-utils/src/ts-eslint-scope/Options.ts b/packages/utils/src/ts-eslint-scope/Options.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint-scope/Options.ts
rename to packages/utils/src/ts-eslint-scope/Options.ts
diff --git a/packages/experimental-utils/src/ts-eslint-scope/PatternVisitor.ts b/packages/utils/src/ts-eslint-scope/PatternVisitor.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint-scope/PatternVisitor.ts
rename to packages/utils/src/ts-eslint-scope/PatternVisitor.ts
diff --git a/packages/experimental-utils/src/ts-eslint-scope/README.md b/packages/utils/src/ts-eslint-scope/README.md
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint-scope/README.md
rename to packages/utils/src/ts-eslint-scope/README.md
diff --git a/packages/experimental-utils/src/ts-eslint-scope/Reference.ts b/packages/utils/src/ts-eslint-scope/Reference.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint-scope/Reference.ts
rename to packages/utils/src/ts-eslint-scope/Reference.ts
diff --git a/packages/experimental-utils/src/ts-eslint-scope/Referencer.ts b/packages/utils/src/ts-eslint-scope/Referencer.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint-scope/Referencer.ts
rename to packages/utils/src/ts-eslint-scope/Referencer.ts
diff --git a/packages/experimental-utils/src/ts-eslint-scope/Scope.ts b/packages/utils/src/ts-eslint-scope/Scope.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint-scope/Scope.ts
rename to packages/utils/src/ts-eslint-scope/Scope.ts
diff --git a/packages/experimental-utils/src/ts-eslint-scope/ScopeManager.ts b/packages/utils/src/ts-eslint-scope/ScopeManager.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint-scope/ScopeManager.ts
rename to packages/utils/src/ts-eslint-scope/ScopeManager.ts
diff --git a/packages/experimental-utils/src/ts-eslint-scope/Variable.ts b/packages/utils/src/ts-eslint-scope/Variable.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint-scope/Variable.ts
rename to packages/utils/src/ts-eslint-scope/Variable.ts
diff --git a/packages/experimental-utils/src/ts-eslint-scope/analyze.ts b/packages/utils/src/ts-eslint-scope/analyze.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint-scope/analyze.ts
rename to packages/utils/src/ts-eslint-scope/analyze.ts
diff --git a/packages/experimental-utils/src/ts-eslint-scope/index.ts b/packages/utils/src/ts-eslint-scope/index.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint-scope/index.ts
rename to packages/utils/src/ts-eslint-scope/index.ts
diff --git a/packages/experimental-utils/src/ts-eslint/AST.ts b/packages/utils/src/ts-eslint/AST.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint/AST.ts
rename to packages/utils/src/ts-eslint/AST.ts
diff --git a/packages/experimental-utils/src/ts-eslint/CLIEngine.ts b/packages/utils/src/ts-eslint/CLIEngine.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint/CLIEngine.ts
rename to packages/utils/src/ts-eslint/CLIEngine.ts
diff --git a/packages/experimental-utils/src/ts-eslint/ESLint.ts b/packages/utils/src/ts-eslint/ESLint.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint/ESLint.ts
rename to packages/utils/src/ts-eslint/ESLint.ts
diff --git a/packages/experimental-utils/src/ts-eslint/Linter.ts b/packages/utils/src/ts-eslint/Linter.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint/Linter.ts
rename to packages/utils/src/ts-eslint/Linter.ts
diff --git a/packages/experimental-utils/src/ts-eslint/ParserOptions.ts b/packages/utils/src/ts-eslint/ParserOptions.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint/ParserOptions.ts
rename to packages/utils/src/ts-eslint/ParserOptions.ts
diff --git a/packages/experimental-utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint/Rule.ts
rename to packages/utils/src/ts-eslint/Rule.ts
diff --git a/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/packages/utils/src/ts-eslint/RuleTester.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint/RuleTester.ts
rename to packages/utils/src/ts-eslint/RuleTester.ts
diff --git a/packages/experimental-utils/src/ts-eslint/Scope.ts b/packages/utils/src/ts-eslint/Scope.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint/Scope.ts
rename to packages/utils/src/ts-eslint/Scope.ts
diff --git a/packages/experimental-utils/src/ts-eslint/SourceCode.ts b/packages/utils/src/ts-eslint/SourceCode.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint/SourceCode.ts
rename to packages/utils/src/ts-eslint/SourceCode.ts
diff --git a/packages/experimental-utils/src/ts-eslint/index.ts b/packages/utils/src/ts-eslint/index.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-eslint/index.ts
rename to packages/utils/src/ts-eslint/index.ts
diff --git a/packages/experimental-utils/src/ts-estree.ts b/packages/utils/src/ts-estree.ts
similarity index 100%
rename from packages/experimental-utils/src/ts-estree.ts
rename to packages/utils/src/ts-estree.ts
diff --git a/packages/experimental-utils/tests/eslint-utils/RuleCreator.test.ts b/packages/utils/tests/eslint-utils/RuleCreator.test.ts
similarity index 100%
rename from packages/experimental-utils/tests/eslint-utils/RuleCreator.test.ts
rename to packages/utils/tests/eslint-utils/RuleCreator.test.ts
diff --git a/packages/experimental-utils/tests/eslint-utils/applyDefault.test.ts b/packages/utils/tests/eslint-utils/applyDefault.test.ts
similarity index 100%
rename from packages/experimental-utils/tests/eslint-utils/applyDefault.test.ts
rename to packages/utils/tests/eslint-utils/applyDefault.test.ts
diff --git a/packages/experimental-utils/tests/eslint-utils/batchedSingleLineTests.test.ts b/packages/utils/tests/eslint-utils/batchedSingleLineTests.test.ts
similarity index 100%
rename from packages/experimental-utils/tests/eslint-utils/batchedSingleLineTests.test.ts
rename to packages/utils/tests/eslint-utils/batchedSingleLineTests.test.ts
diff --git a/packages/experimental-utils/tests/eslint-utils/deepMerge.test.ts b/packages/utils/tests/eslint-utils/deepMerge.test.ts
similarity index 100%
rename from packages/experimental-utils/tests/eslint-utils/deepMerge.test.ts
rename to packages/utils/tests/eslint-utils/deepMerge.test.ts
diff --git a/packages/utils/tsconfig.build.json b/packages/utils/tsconfig.build.json
new file mode 100644
index 000000000000..e5c1077c5e5c
--- /dev/null
+++ b/packages/utils/tsconfig.build.json
@@ -0,0 +1,15 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ "outDir": "./dist",
+ "rootDir": "./src",
+ "resolveJsonModule": true
+ },
+ "include": ["src", "typings"],
+ "references": [
+ { "path": "../scope-manager/tsconfig.build.json" },
+ { "path": "../types/tsconfig.build.json" },
+ { "path": "../typescript-estree/tsconfig.build.json" }
+ ]
+}
diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json
new file mode 100644
index 000000000000..20ea2496c6b0
--- /dev/null
+++ b/packages/utils/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "extends": "./tsconfig.build.json",
+ "compilerOptions": {
+ "composite": false,
+ "rootDir": "."
+ },
+ "include": ["src", "typings", "tests", "tools"],
+ "references": [
+ { "path": "../scope-manager/tsconfig.build.json" },
+ { "path": "../types/tsconfig.build.json" },
+ { "path": "../typescript-estree/tsconfig.build.json" }
+ ]
+}
diff --git a/packages/experimental-utils/typings/eslint-scope.d.ts b/packages/utils/typings/eslint-scope.d.ts
similarity index 100%
rename from packages/experimental-utils/typings/eslint-scope.d.ts
rename to packages/utils/typings/eslint-scope.d.ts
diff --git a/packages/experimental-utils/typings/eslint-utils.d.ts b/packages/utils/typings/eslint-utils.d.ts
similarity index 100%
rename from packages/experimental-utils/typings/eslint-utils.d.ts
rename to packages/utils/typings/eslint-utils.d.ts
diff --git a/packages/experimental-utils/typings/eslint.d.ts b/packages/utils/typings/eslint.d.ts
similarity index 100%
rename from packages/experimental-utils/typings/eslint.d.ts
rename to packages/utils/typings/eslint.d.ts
diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json
index 9f7102dc3a73..aa38a0bc01d4 100644
--- a/packages/website-eslint/package.json
+++ b/packages/website-eslint/package.json
@@ -16,8 +16,8 @@
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore"
},
"dependencies": {
- "@typescript-eslint/experimental-utils": "5.9.1",
- "@typescript-eslint/types": "5.9.1"
+ "@typescript-eslint/types": "5.9.1",
+ "@typescript-eslint/utils": "5.9.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.1",
diff --git a/packages/website-eslint/rollup.config.js b/packages/website-eslint/rollup.config.js
index f1edc2885126..2941ec568f68 100644
--- a/packages/website-eslint/rollup.config.js
+++ b/packages/website-eslint/rollup.config.js
@@ -21,13 +21,13 @@ module.exports = {
match: [
/eslint\/lib\/(rule-tester|eslint|cli-engine|init)\//u,
/eslint\/lib\/cli\.js$/,
- /experimental-utils\/dist\/eslint-utils\/RuleTester\.js$/,
- /experimental-utils\/dist\/ts-eslint\/CLIEngine\.js$/,
- /experimental-utils\/dist\/ts-eslint\/RuleTester\.js$/,
+ /utils\/dist\/eslint-utils\/RuleTester\.js$/,
+ /utils\/dist\/ts-eslint\/CLIEngine\.js$/,
+ /utils\/dist\/ts-eslint\/RuleTester\.js$/,
/typescript-estree\/dist\/create-program\/createWatchProgram\.js/,
/typescript-estree\/dist\/create-program\/createProjectProgram\.js/,
/typescript-estree\/dist\/create-program\/createIsolatedProgram\.js/,
- /experimental-utils\/dist\/ts-eslint\/ESLint\.js/,
+ /utils\/dist\/ts-eslint\/ESLint\.js/,
// 'eslint/lib/shared/ajv.js',
// 'eslint/lib/shared/runtime-info.js',
],
diff --git a/packages/website-eslint/types/index.d.ts b/packages/website-eslint/types/index.d.ts
index 4e923c2fef1c..ed3e1e2422f8 100644
--- a/packages/website-eslint/types/index.d.ts
+++ b/packages/website-eslint/types/index.d.ts
@@ -1,4 +1,4 @@
-import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
+import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import type { ParserOptions } from '@typescript-eslint/types';
import type { SourceFile } from 'typescript';
diff --git a/workspace.json b/workspace.json
index 6fbf76fb0786..152f3d9f6d07 100644
--- a/workspace.json
+++ b/workspace.json
@@ -9,9 +9,10 @@
"@typescript-eslint/parser": "packages/parser",
"@typescript-eslint/scope-manager": "packages/scope-manager",
"@typescript-eslint/shared-fixtures": "packages/shared-fixtures",
- "@typescript-eslint/types": "packages/types",
"@typescript-eslint/type-utils": "packages/type-utils",
+ "@typescript-eslint/types": "packages/types",
"@typescript-eslint/typescript-estree": "packages/typescript-estree",
+ "@typescript-eslint/utils": "packages/utils",
"@typescript-eslint/visitor-keys": "packages/visitor-keys",
"@typescript-eslint/website-eslint": "packages/website-eslint",
"website": "packages/website"
From 9eb0a5b3d760d467ae43e6281cace9bee6ca54e9 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed, 12 Jan 2022 18:22:59 -0800
Subject: [PATCH 07/29] chore: bump follow-redirects from 1.14.5 to 1.14.7
(#4437)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.5 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.5...v1.14.7)
---
updated-dependencies:
- dependency-name: follow-redirects
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index 75934f3ea849..e8e2ea3737b3 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7512,9 +7512,9 @@ flux@^4.0.1:
fbjs "^3.0.0"
follow-redirects@^1.0.0, follow-redirects@^1.14.0:
- version "1.14.5"
- resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.5.tgz#f09a5848981d3c772b5392309778523f8d85c381"
- integrity sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==
+ version "1.14.7"
+ resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685"
+ integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==
forever-agent@~0.6.1:
version "0.6.1"
From 4bda6ec778eb47f744d09882ae5055299ff09899 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 15 Jan 2022 00:00:30 -0800
Subject: [PATCH 08/29] chore: bump shelljs from 0.8.4 to 0.8.5 (#4442)
Bumps [shelljs](https://github.com/shelljs/shelljs) from 0.8.4 to 0.8.5.
- [Release notes](https://github.com/shelljs/shelljs/releases)
- [Changelog](https://github.com/shelljs/shelljs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/shelljs/shelljs/compare/v0.8.4...v0.8.5)
---
updated-dependencies:
- dependency-name: shelljs
dependency-type: indirect
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 33 +++++++++++++++++++++++++++------
1 file changed, 27 insertions(+), 6 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index e8e2ea3737b3..a7004b0d49f6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -8672,13 +8672,20 @@ is-ci@^3.0.0:
dependencies:
ci-info "^3.1.1"
-is-core-module@^2.1.0, is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.8.0:
+is-core-module@^2.1.0, is-core-module@^2.2.0, is-core-module@^2.5.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548"
integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw==
dependencies:
has "^1.0.3"
+is-core-module@^2.8.0:
+ version "2.8.1"
+ resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211"
+ integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==
+ dependencies:
+ has "^1.0.3"
+
is-date-object@^1.0.1:
version "1.0.5"
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f"
@@ -11750,7 +11757,7 @@ path-key@^3.0.0, path-key@^3.1.0:
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
-path-parse@^1.0.6:
+path-parse@^1.0.6, path-parse@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
@@ -13031,7 +13038,16 @@ resolve.exports@^1.1.0:
resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9"
integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==
-resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.3.2:
+resolve@^1.1.6:
+ version "1.21.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.21.0.tgz#b51adc97f3472e6a5cf4444d34bc9d6b9037591f"
+ integrity sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA==
+ dependencies:
+ is-core-module "^2.8.0"
+ path-parse "^1.0.7"
+ supports-preserve-symlinks-flag "^1.0.0"
+
+resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.3.2:
version "1.20.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
@@ -13437,9 +13453,9 @@ shell-quote@^1.6.1, shell-quote@^1.7.2:
integrity sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw==
shelljs@^0.8.3, shelljs@^0.8.4:
- version "0.8.4"
- resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
- integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
+ version "0.8.5"
+ resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c"
+ integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==
dependencies:
glob "^7.0.0"
interpret "^1.0.0"
@@ -13992,6 +14008,11 @@ supports-hyperlinks@^2.0.0:
has-flag "^4.0.0"
supports-color "^7.0.0"
+supports-preserve-symlinks-flag@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
+ integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
+
svg-parser@^2.0.2:
version "2.0.4"
resolved "https://registry.yarnpkg.com/svg-parser/-/svg-parser-2.0.4.tgz#fdc2e29e13951736140b76cb122c8ee6630eb6b5"
From 253bfa37326de3ef7ac5f8542e21d52789f0cb13 Mon Sep 17 00:00:00 2001
From: pushkine
Date: Mon, 17 Jan 2022 05:30:54 +0100
Subject: [PATCH 09/29] docs: fix typo in comment (#4445)
---
packages/scope-manager/src/scope/FunctionScope.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/scope-manager/src/scope/FunctionScope.ts b/packages/scope-manager/src/scope/FunctionScope.ts
index 18e123213746..a26b272fd025 100644
--- a/packages/scope-manager/src/scope/FunctionScope.ts
+++ b/packages/scope-manager/src/scope/FunctionScope.ts
@@ -44,7 +44,7 @@ class FunctionScope extends ScopeBase<
// console.log(a)
// }
protected isValidResolution(ref: Reference, variable: Variable): boolean {
- // If `options.gloablReturn` is true, `this.block` becomes a Program node.
+ // If `options.globalReturn` is true, `this.block` becomes a Program node.
if (this.block.type === AST_NODE_TYPES.Program) {
return true;
}
From c8e650f0c124d24b24beaeb376eaf61ee8d9e6fb Mon Sep 17 00:00:00 2001
From: Oleksandr T
Date: Mon, 17 Jan 2022 08:46:34 +0200
Subject: [PATCH 10/29] fix(eslint-plugin): [no-magic-numbers] handle bigint in
class props (#4411)
---
packages/eslint-plugin/src/rules/no-magic-numbers.ts | 2 +-
.../eslint-plugin/tests/rules/no-magic-numbers.test.ts | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts
index 772eaf49ea1a..2bab38f752d0 100644
--- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts
+++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts
@@ -69,7 +69,7 @@ export default util.createRule({
// Check if the node is a readonly class property
if (
- typeof node.value === 'number' &&
+ (typeof node.value === 'number' || typeof node.value === 'bigint') &&
isParentTSReadonlyPropertyDefinition(node)
) {
if (options.ignoreReadonlyClassProperties) {
diff --git a/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts b/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts
index 0c220805085f..2bf16e997964 100644
--- a/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts
+++ b/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts
@@ -53,6 +53,7 @@ class Foo {
static readonly D = 1;
readonly E = -1;
readonly F = +1;
+ private readonly G = 100n;
}
`,
options: [{ ignoreReadonlyClassProperties: true }],
@@ -204,6 +205,7 @@ class Foo {
static readonly D = 4;
readonly E = -5;
readonly F = +6;
+ private readonly G = 100n;
}
`,
options: [{ ignoreReadonlyClassProperties: false }],
@@ -256,6 +258,14 @@ class Foo {
line: 8,
column: 17,
},
+ {
+ messageId: 'noMagic',
+ data: {
+ raw: '100n',
+ },
+ line: 9,
+ column: 24,
+ },
],
},
],
From ea85ddaff8320e727f99c4d46850e6872ca17407 Mon Sep 17 00:00:00 2001
From: Rebecca Stevens
Date: Mon, 17 Jan 2022 19:52:54 +1300
Subject: [PATCH 11/29] test(type-utils): add basic tests for isTypeReadonly
(#4416)
* fix(type-utils): make isTypeReadonly's options param optional
fix #4410
* test(type-utils): add basic tests for isTypeReadonly
---
.../type-utils/tests/isTypeReadonly.test.ts | 138 ++++++++++++++++++
1 file changed, 138 insertions(+)
create mode 100644 packages/type-utils/tests/isTypeReadonly.test.ts
diff --git a/packages/type-utils/tests/isTypeReadonly.test.ts b/packages/type-utils/tests/isTypeReadonly.test.ts
new file mode 100644
index 000000000000..5ecfc078f988
--- /dev/null
+++ b/packages/type-utils/tests/isTypeReadonly.test.ts
@@ -0,0 +1,138 @@
+import * as ts from 'typescript';
+import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { parseForESLint } from '@typescript-eslint/parser';
+import {
+ isTypeReadonly,
+ type ReadonlynessOptions,
+} from '../src/isTypeReadonly';
+import path from 'path';
+
+describe('isTypeReadonly', () => {
+ const rootDir = path.join(__dirname, 'fixtures');
+
+ describe('TSTypeAliasDeclaration ', () => {
+ function getType(code: string): {
+ type: ts.Type;
+ checker: ts.TypeChecker;
+ } {
+ const { ast, services } = parseForESLint(code, {
+ project: './tsconfig.json',
+ filePath: path.join(rootDir, 'file.ts'),
+ tsconfigRootDir: rootDir,
+ });
+ const checker = services.program.getTypeChecker();
+ const esTreeNodeToTSNodeMap = services.esTreeNodeToTSNodeMap;
+
+ const declaration = ast.body[0] as TSESTree.TSTypeAliasDeclaration;
+ return {
+ type: checker.getTypeAtLocation(
+ esTreeNodeToTSNodeMap.get(declaration.id),
+ ),
+ checker,
+ };
+ }
+
+ function runTestForAliasDeclaration(
+ code: string,
+ options: ReadonlynessOptions | undefined,
+ expected: boolean,
+ ): void {
+ const { type, checker } = getType(code);
+
+ const result = isTypeReadonly(checker, type, options);
+ expect(result).toBe(expected);
+ }
+
+ describe('default options', () => {
+ const options = undefined;
+
+ function runTestIsReadonly(code: string): void {
+ runTestForAliasDeclaration(code, options, true);
+ }
+
+ function runTestIsNotReadonly(code: string): void {
+ runTestForAliasDeclaration(code, options, false);
+ }
+
+ describe('basics', () => {
+ describe('is readonly', () => {
+ const runTests = runTestIsReadonly;
+
+ // Record.
+ it.each([
+ ['type Test = { readonly bar: string; };'],
+ ['type Test = Readonly<{ bar: string; }>;'],
+ ])('handles fully readonly records', runTests);
+
+ // Array.
+ it.each([
+ ['type Test = Readonly;'],
+ ['type Test = Readonly>;'],
+ ])('handles fully readonly arrays', runTests);
+
+ // Array - special case.
+ // Note: Methods are mutable but arrays are treated special; hence no failure.
+ it.each([
+ ['type Test = readonly string[];'],
+ ['type Test = ReadonlyArray;'],
+ ])('treats readonly arrays as fully readonly', runTests);
+
+ // Set and Map.
+ it.each([
+ ['type Test = Readonly>;'],
+ ['type Test = Readonly>;'],
+ ])('handles fully readonly sets and maps', runTests);
+ });
+
+ describe('is not readonly', () => {
+ const runTests = runTestIsNotReadonly;
+
+ // Record.
+ it.each([
+ ['type Test = { foo: string; };'],
+ ['type Test = { foo: string; readonly bar: number; };'],
+ ])('handles non fully readonly records', runTests);
+
+ // Array.
+ it.each([['type Test = string[]'], ['type Test = Array']])(
+ 'handles non fully readonly arrays',
+ runTests,
+ );
+
+ // Set and Map.
+ // Note: Methods are mutable for ReadonlySet and ReadonlyMet; hence failure.
+ it.each([
+ ['type Test = Set;'],
+ ['type Test = Map;'],
+ ['type Test = ReadonlySet;'],
+ ['type Test = ReadonlyMap;'],
+ ])('handles non fully readonly sets and maps', runTests);
+ });
+ });
+ });
+
+ describe('treatMethodsAsReadonly', () => {
+ const options: ReadonlynessOptions = {
+ treatMethodsAsReadonly: true,
+ };
+
+ function runTestIsReadonly(code: string): void {
+ runTestForAliasDeclaration(code, options, true);
+ }
+
+ // function runTestIsNotReadonly(code: string): void {
+ // runTestForAliasDeclaration(code, options, false);
+ // }
+
+ describe('is readonly', () => {
+ const runTests = runTestIsReadonly;
+
+ // Set and Map.
+ it.each([
+ ['type Test = ReadonlySet;'],
+ ['type Test = ReadonlyMap;'],
+ ])('handles non fully readonly sets and maps', runTests);
+ });
+ });
+ });
+});
From 95aea18f30c49ef402289abbeec38a93a659bf6f Mon Sep 17 00:00:00 2001
From: Taeheon Kim
Date: Mon, 17 Jan 2022 16:26:23 +0900
Subject: [PATCH 12/29] refactor(eslint-plugin): [restrict-plus-operands] add
better error messages (#4332)
---
.../src/rules/restrict-plus-operands.ts | 27 +++++++++++++------
.../rules/restrict-plus-operands.test.ts | 22 +++++++--------
2 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts
index 5ccae1aca105..d126dc42bfb0 100644
--- a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts
+++ b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts
@@ -8,7 +8,12 @@ type Options = [
allowAny?: boolean;
},
];
-type MessageIds = 'notNumbers' | 'notStrings' | 'notBigInts';
+type MessageIds =
+ | 'notNumbers'
+ | 'notStrings'
+ | 'notBigInts'
+ | 'notValidAnys'
+ | 'notValidTypes';
export default util.createRule({
name: 'restrict-plus-operands',
@@ -26,6 +31,10 @@ export default util.createRule({
notStrings:
"Operands of '+' operation must either be both strings or both numbers. Consider using a template literal.",
notBigInts: "Operands of '+' operation must be both bigints.",
+ notValidAnys:
+ "Operands of '+' operation with any is possible only with string, number, bigint or any",
+ notValidTypes:
+ "Operands of '+' operation must either be one of string, number, bigint or any (if allowed by option)",
},
schema: [
{
@@ -118,14 +127,14 @@ export default util.createRule({
if (leftType === 'invalid') {
context.report({
node,
- messageId: 'notNumbers',
+ messageId: 'notValidTypes',
});
}
if (!allowAny && leftType === 'any') {
context.report({
node,
- messageId: 'notNumbers',
+ messageId: 'notValidAnys',
});
}
@@ -136,7 +145,7 @@ export default util.createRule({
if (!allowAny || leftType === 'invalid' || rightType === 'invalid') {
context.report({
node,
- messageId: 'notNumbers',
+ messageId: 'notValidAnys',
});
}
@@ -157,10 +166,12 @@ export default util.createRule({
});
}
- context.report({
- node,
- messageId: 'notNumbers',
- });
+ if (leftType === 'number' || rightType === 'number') {
+ return context.report({
+ node,
+ messageId: 'notNumbers',
+ });
+ }
}
return {
diff --git a/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts b/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts
index 12b7e44657ea..ec14f26db7b3 100644
--- a/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts
+++ b/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts
@@ -195,7 +195,7 @@ export const f = (a: any, b: number) => a + b;
code: 'var foo = [] + {};',
errors: [
{
- messageId: 'notNumbers',
+ messageId: 'notValidTypes',
line: 1,
column: 11,
},
@@ -225,7 +225,7 @@ export const f = (a: any, b: number) => a + b;
code: 'var foo = [] + [];',
errors: [
{
- messageId: 'notNumbers',
+ messageId: 'notValidTypes',
line: 1,
column: 11,
},
@@ -368,7 +368,7 @@ var foo = pair + pair;
`,
errors: [
{
- messageId: 'notNumbers',
+ messageId: 'notValidTypes',
line: 3,
column: 11,
},
@@ -555,7 +555,7 @@ function foo(a: T) {
`,
errors: [
{
- messageId: 'notNumbers',
+ messageId: 'notValidAnys',
line: 4,
column: 19,
},
@@ -622,7 +622,7 @@ const f = (a: any, b: boolean) => a + b;
],
errors: [
{
- messageId: 'notNumbers',
+ messageId: 'notValidAnys',
line: 2,
column: 35,
},
@@ -639,7 +639,7 @@ const f = (a: any, b: []) => a + b;
],
errors: [
{
- messageId: 'notNumbers',
+ messageId: 'notValidAnys',
line: 2,
column: 30,
},
@@ -657,7 +657,7 @@ const f = (a: any, b: any) => a + b;
],
errors: [
{
- messageId: 'notNumbers',
+ messageId: 'notValidAnys',
line: 2,
column: 31,
},
@@ -674,7 +674,7 @@ const f = (a: any, b: string) => a + b;
],
errors: [
{
- messageId: 'notNumbers',
+ messageId: 'notValidAnys',
line: 2,
column: 34,
},
@@ -691,7 +691,7 @@ const f = (a: any, b: bigint) => a + b;
],
errors: [
{
- messageId: 'notNumbers',
+ messageId: 'notValidAnys',
line: 2,
column: 34,
},
@@ -708,7 +708,7 @@ const f = (a: any, b: number) => a + b;
],
errors: [
{
- messageId: 'notNumbers',
+ messageId: 'notValidAnys',
line: 2,
column: 34,
},
@@ -725,7 +725,7 @@ const f = (a: any, b: boolean) => a + b;
],
errors: [
{
- messageId: 'notNumbers',
+ messageId: 'notValidAnys',
line: 2,
column: 35,
},
From ff05dd8e51aed89c223313d45cd425e63a0ec427 Mon Sep 17 00:00:00 2001
From: Yosuke Ota
Date: Mon, 17 Jan 2022 16:41:00 +0900
Subject: [PATCH 13/29] test(type-utils): fix incorrect utils import (#4453)
---
packages/type-utils/tests/isTypeReadonly.test.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/type-utils/tests/isTypeReadonly.test.ts b/packages/type-utils/tests/isTypeReadonly.test.ts
index 5ecfc078f988..5afc3b6e59ca 100644
--- a/packages/type-utils/tests/isTypeReadonly.test.ts
+++ b/packages/type-utils/tests/isTypeReadonly.test.ts
@@ -1,5 +1,5 @@
import * as ts from 'typescript';
-import { TSESTree } from '@typescript-eslint/experimental-utils';
+import { TSESTree } from '@typescript-eslint/utils';
import { parseForESLint } from '@typescript-eslint/parser';
import {
isTypeReadonly,
From 4cb46ff81fb36c2d5bdec494f51d48d45267738f Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 16 Jan 2022 23:43:34 -0800
Subject: [PATCH 14/29] chore: bump downlevel-dts from 0.7.0 to 0.8.0 (#4447)
Bumps [downlevel-dts](https://github.com/sandersn/downlevel-dts) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/sandersn/downlevel-dts/releases)
- [Commits](https://github.com/sandersn/downlevel-dts/commits)
---
updated-dependencies:
- dependency-name: downlevel-dts
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package.json | 2 +-
yarn.lock | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index b908b05fdc75..7a872962710f 100644
--- a/package.json
+++ b/package.json
@@ -83,7 +83,7 @@
"cross-env": "^7.0.3",
"cspell": "^5.12.3",
"cz-conventional-changelog": "^3.3.0",
- "downlevel-dts": "^0.7.0",
+ "downlevel-dts": "^0.8.0",
"enhanced-resolve": "^5.8.3",
"eslint": "^8.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
diff --git a/yarn.lock b/yarn.lock
index a7004b0d49f6..6640b0b0355c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6588,10 +6588,10 @@ dotenv@~10.0.0:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==
-downlevel-dts@^0.7.0:
- version "0.7.0"
- resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.7.0.tgz#155c24310dad8a4820ad077e64b15a8c461aa932"
- integrity sha512-tcjGqElN0/oad/LJBlaxmZ3zOYEQOBbGuirKzif8s1jeRiWBdNX9H6OBFlRjOQkosXgV+qSjs4osuGCivyZ4Jw==
+downlevel-dts@^0.8.0:
+ version "0.8.0"
+ resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.8.0.tgz#bed86768357824b1a04f60df79d8b0867b83a382"
+ integrity sha512-wBy+Q0Ya/1XRz9MMaj3BXH95E8aSckY3lppmUnf8Qv7dUg0wbWm3szDiVL4PdAvwcS7JbBBDPhCXeAGNT3ttFQ==
dependencies:
semver "^7.3.2"
shelljs "^0.8.3"
From daf799050861cd76ef81f59e1820b60550387725 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 16 Jan 2022 23:43:42 -0800
Subject: [PATCH 15/29] chore: bump @types/prettier from 2.4.2 to 2.4.3 (#4451)
Bumps [@types/prettier](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prettier) from 2.4.2 to 2.4.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/prettier)
---
updated-dependencies:
- dependency-name: "@types/prettier"
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index 6640b0b0355c..33ba64296f69 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4006,9 +4006,9 @@
integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw==
"@types/prettier@*", "@types/prettier@^2.1.5", "@types/prettier@^2.4.2":
- version "2.4.2"
- resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.2.tgz#4c62fae93eb479660c3bd93f9d24d561597a8281"
- integrity sha512-ekoj4qOQYp7CvjX8ZDBgN86w3MqQhLE1hczEJbEIjgFEumDy+na/4AJAbLXfgEWFNB2pKadM5rPFtuSGMWK7xA==
+ version "2.4.3"
+ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.3.tgz#a3c65525b91fca7da00ab1a3ac2b5a2a4afbffbf"
+ integrity sha512-QzSuZMBuG5u8HqYz01qtMdg/Jfctlnvj1z/lYnIDXs/golxw0fxtRAHd9KrzjR7Yxz1qVeI00o0kiO3PmVdJ9w==
"@types/prop-types@*":
version "15.7.4"
From 377cbcf0cb2c64afa679983add2cbfbfe9db70c7 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 16 Jan 2022 23:43:53 -0800
Subject: [PATCH 16/29] chore: bump rollup from 2.63.0 to 2.64.0 (#4450)
Bumps [rollup](https://github.com/rollup/rollup) from 2.63.0 to 2.64.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.63.0...v2.64.0)
---
updated-dependencies:
- dependency-name: rollup
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index 33ba64296f69..a609f35dce39 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -13136,9 +13136,9 @@ rimraf@^2.6.3:
glob "^7.1.3"
rollup@^2.59.0:
- version "2.63.0"
- resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.63.0.tgz#fe2f7fec2133f3fab9e022b9ac245628d817c6bb"
- integrity sha512-nps0idjmD+NXl6OREfyYXMn/dar3WGcyKn+KBzPdaLecub3x/LrId0wUcthcr8oZUAcZAR8NKcfGGFlNgGL1kQ==
+ version "2.64.0"
+ resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.64.0.tgz#f0f59774e21fbb56de438a37d06a2189632b207a"
+ integrity sha512-+c+lbw1lexBKSMb1yxGDVfJ+vchJH3qLbmavR+awDinTDA2C5Ug9u7lkOzj62SCu0PKUExsW36tpgW7Fmpn3yQ==
optionalDependencies:
fsevents "~2.3.2"
From 8a3010848b9bf97846929461213872de916bb2d4 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 16 Jan 2022 23:44:04 -0800
Subject: [PATCH 17/29] chore: bump eslint-visitor-keys from 3.1.0 to 3.2.0
(#4452)
Bumps [eslint-visitor-keys](https://github.com/eslint/eslint-visitor-keys) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/eslint/eslint-visitor-keys/releases)
- [Changelog](https://github.com/eslint/eslint-visitor-keys/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint-visitor-keys/compare/v3.1.0...v3.2.0)
---
updated-dependencies:
- dependency-name: eslint-visitor-keys
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index a609f35dce39..9019ac2a0fd9 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6967,9 +6967,9 @@ eslint-visitor-keys@^2.0.0:
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
eslint-visitor-keys@^3.0.0:
- version "3.1.0"
- resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz#eee4acea891814cda67a7d8812d9647dd0179af2"
- integrity sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1"
+ integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==
eslint@*, eslint@^8.1.0:
version "8.1.0"
From d053cde3e8b5bf9ba1c22fd64a7456d672ef77ca Mon Sep 17 00:00:00 2001
From: Taeheon Kim
Date: Mon, 17 Jan 2022 16:54:27 +0900
Subject: [PATCH 18/29] fix(eslint-plugin): [explicit-function-return-type]
support AllowTypedFunctionExpression within AllowHigherOrderFunction (#4250)
* refactor: move function to be used more widely
* feat: find if the ancestor(top level) is typed
* test: add more test cases
* fix: lint fail on test case
* fix: make working with option combos
* chore: remove unnecessary comment
---
.../rules/explicit-function-return-type.ts | 17 ++-
.../rules/explicit-module-boundary-types.ts | 50 +-------
.../src/util/explicitReturnTypeUtils.ts | 46 +++++++
.../explicit-function-return-type.test.ts | 120 ++++++++++++++++++
4 files changed, 182 insertions(+), 51 deletions(-)
diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts
index 233b07bbc6a5..d9302a7775f3 100644
--- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts
+++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts
@@ -2,7 +2,8 @@ import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
import {
checkFunctionReturnType,
- checkFunctionExpressionReturnType,
+ isValidFunctionExpressionReturnType,
+ ancestorHasReturnType,
} from '../util/explicitReturnTypeUtils';
type Options = [
@@ -78,7 +79,15 @@ export default util.createRule({
return;
}
- checkFunctionExpressionReturnType(node, options, sourceCode, loc =>
+ if (
+ options.allowTypedFunctionExpressions &&
+ (isValidFunctionExpressionReturnType(node, options) ||
+ ancestorHasReturnType(node))
+ ) {
+ return;
+ }
+
+ checkFunctionReturnType(node, options, sourceCode, loc =>
context.report({
node,
loc,
@@ -87,6 +96,10 @@ export default util.createRule({
);
},
FunctionDeclaration(node): void {
+ if (options.allowTypedFunctionExpressions && node.returnType) {
+ return;
+ }
+
checkFunctionReturnType(node, options, sourceCode, loc =>
context.report({
node,
diff --git a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts
index 5bbfa7ebbea1..30509bb660ed 100644
--- a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts
+++ b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts
@@ -8,6 +8,7 @@ import {
FunctionExpression,
FunctionNode,
isTypedFunctionExpression,
+ ancestorHasReturnType,
} from '../util/explicitReturnTypeUtils';
type Options = [
@@ -387,55 +388,6 @@ export default util.createRule({
}
}
- /**
- * Check whether any ancestor of the provided function has a valid return type.
- * This function assumes that the function either:
- * - belongs to an exported function chain validated by isExportedHigherOrderFunction
- * - is directly exported itself
- */
- function ancestorHasReturnType(node: FunctionNode): boolean {
- let ancestor = node.parent;
-
- if (ancestor?.type === AST_NODE_TYPES.Property) {
- ancestor = ancestor.value;
- }
-
- // if the ancestor is not a return, then this function was not returned at all, so we can exit early
- const isReturnStatement =
- ancestor?.type === AST_NODE_TYPES.ReturnStatement;
- const isBodylessArrow =
- ancestor?.type === AST_NODE_TYPES.ArrowFunctionExpression &&
- ancestor.body.type !== AST_NODE_TYPES.BlockStatement;
- if (!isReturnStatement && !isBodylessArrow) {
- return false;
- }
-
- while (ancestor) {
- switch (ancestor.type) {
- case AST_NODE_TYPES.ArrowFunctionExpression:
- case AST_NODE_TYPES.FunctionExpression:
- case AST_NODE_TYPES.FunctionDeclaration:
- if (ancestor.returnType) {
- return true;
- }
- // assume
- break;
-
- // const x: Foo = () => {};
- // Assume that a typed variable types the function expression
- case AST_NODE_TYPES.VariableDeclarator:
- if (ancestor.id.typeAnnotation) {
- return true;
- }
- break;
- }
-
- ancestor = ancestor.parent;
- }
-
- return false;
- }
-
function checkEmptyBodyFunctionExpression(
node: TSESTree.TSEmptyBodyFunctionExpression,
): void {
diff --git a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts
index 3b737ad4f41f..4d4ec6023a77 100644
--- a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts
+++ b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts
@@ -293,6 +293,50 @@ function checkFunctionExpressionReturnType(
checkFunctionReturnType(node, options, sourceCode, report);
}
+/**
+ * Check whether any ancestor of the provided function has a valid return type.
+ */
+function ancestorHasReturnType(node: FunctionNode): boolean {
+ let ancestor = node.parent;
+
+ if (ancestor?.type === AST_NODE_TYPES.Property) {
+ ancestor = ancestor.value;
+ }
+
+ // if the ancestor is not a return, then this function was not returned at all, so we can exit early
+ const isReturnStatement = ancestor?.type === AST_NODE_TYPES.ReturnStatement;
+ const isBodylessArrow =
+ ancestor?.type === AST_NODE_TYPES.ArrowFunctionExpression &&
+ ancestor.body.type !== AST_NODE_TYPES.BlockStatement;
+ if (!isReturnStatement && !isBodylessArrow) {
+ return false;
+ }
+
+ while (ancestor) {
+ switch (ancestor.type) {
+ case AST_NODE_TYPES.ArrowFunctionExpression:
+ case AST_NODE_TYPES.FunctionExpression:
+ case AST_NODE_TYPES.FunctionDeclaration:
+ if (ancestor.returnType) {
+ return true;
+ }
+ break;
+
+ // const x: Foo = () => {};
+ // Assume that a typed variable types the function expression
+ case AST_NODE_TYPES.VariableDeclarator:
+ if (ancestor.id.typeAnnotation) {
+ return true;
+ }
+ break;
+ }
+
+ ancestor = ancestor.parent;
+ }
+
+ return false;
+}
+
export {
checkFunctionExpressionReturnType,
checkFunctionReturnType,
@@ -300,4 +344,6 @@ export {
FunctionExpression,
FunctionNode,
isTypedFunctionExpression,
+ isValidFunctionExpressionReturnType,
+ ancestorHasReturnType,
};
diff --git a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts
index ab98b4be27c5..e1fae3cd116c 100644
--- a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts
+++ b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts
@@ -400,6 +400,68 @@ new Foo(1, () => {});
code: 'const log = (message: string) => void console.log(message);',
options: [{ allowConciseArrowFunctionExpressionsStartingWithVoid: true }],
},
+ {
+ filename: 'test.ts',
+ code: `
+type HigherOrderType = () => (arg1: string) => (arg2: number) => string;
+const x: HigherOrderType = () => arg1 => arg2 => 'foo';
+ `,
+ options: [
+ {
+ allowTypedFunctionExpressions: true,
+ allowHigherOrderFunctions: true,
+ },
+ ],
+ },
+ {
+ filename: 'test.ts',
+ code: `
+type HigherOrderType = () => (arg1: string) => (arg2: number) => string;
+const x: HigherOrderType = () => arg1 => arg2 => 'foo';
+ `,
+ options: [
+ {
+ allowTypedFunctionExpressions: true,
+ allowHigherOrderFunctions: false,
+ },
+ ],
+ },
+ {
+ filename: 'test.ts',
+ code: `
+interface Foo {
+ foo: string;
+ arrowFn: () => string;
+}
+
+function foo(): Foo {
+ return {
+ foo: 'foo',
+ arrowFn: () => 'test',
+ };
+}
+ `,
+ options: [
+ {
+ allowTypedFunctionExpressions: true,
+ allowHigherOrderFunctions: true,
+ },
+ ],
+ },
+ {
+ filename: 'test.ts',
+ code: `
+type Foo = (arg1: string) => string;
+type Bar = (arg2: string) => T;
+const x: Bar = arg1 => arg2 => arg1 + arg2;
+ `,
+ options: [
+ {
+ allowTypedFunctionExpressions: true,
+ allowHigherOrderFunctions: true,
+ },
+ ],
+ },
],
invalid: [
{
@@ -1027,6 +1089,64 @@ foo({
{
filename: 'test.ts',
code: `
+type HigherOrderType = () => (arg1: string) => (arg2: number) => string;
+const x: HigherOrderType = () => arg1 => arg2 => 'foo';
+ `,
+ options: [
+ {
+ allowTypedFunctionExpressions: false,
+ allowHigherOrderFunctions: true,
+ },
+ ],
+ errors: [
+ {
+ messageId: 'missingReturnType',
+ line: 3,
+ endLine: 3,
+ column: 42,
+ endColumn: 49,
+ },
+ ],
+ },
+ {
+ filename: 'test.ts',
+ code: `
+type HigherOrderType = () => (arg1: string) => (arg2: number) => string;
+const x: HigherOrderType = () => arg1 => arg2 => 'foo';
+ `,
+ options: [
+ {
+ allowTypedFunctionExpressions: false,
+ allowHigherOrderFunctions: false,
+ },
+ ],
+ errors: [
+ {
+ messageId: 'missingReturnType',
+ line: 3,
+ endLine: 3,
+ column: 28,
+ endColumn: 33,
+ },
+ {
+ messageId: 'missingReturnType',
+ line: 3,
+ endLine: 3,
+ column: 34,
+ endColumn: 41,
+ },
+ {
+ messageId: 'missingReturnType',
+ line: 3,
+ endLine: 3,
+ column: 42,
+ endColumn: 49,
+ },
+ ],
+ },
+ {
+ filename: 'test.ts',
+ code: `
const func = (value: number) => ({ type: 'X', value } as any);
const func = (value: number) => ({ type: 'X', value } as Action);
`,
From d8e296d792bde091c98c8539400f96fc47418486 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 17 Jan 2022 00:52:38 -0800
Subject: [PATCH 19/29] chore: bump webpack from 5.65.0 to 5.66.0 (#4455)
Bumps [webpack](https://github.com/webpack/webpack) from 5.65.0 to 5.66.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.65.0...v5.66.0)
---
updated-dependencies:
- dependency-name: webpack
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index 9019ac2a0fd9..e39d75eb9ab6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7939,10 +7939,10 @@ got@^9.6.0:
to-readable-stream "^1.0.0"
url-parse-lax "^3.0.0"
-graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4, graceful-fs@^4.2.6:
- version "4.2.8"
- resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a"
- integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==
+graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.3, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9:
+ version "4.2.9"
+ resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96"
+ integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==
gray-matter@^4.0.3:
version "4.0.3"
@@ -15021,9 +15021,9 @@ webpack-sources@^3.2.2:
integrity sha512-cp5qdmHnu5T8wRg2G3vZZHoJPN14aqQ89SyQ11NpGH5zEMDCclt49rzo+MaRazk7/UeILhAI+/sEtcM+7Fr0nw==
webpack@^5.61.0, webpack@^5.64.0:
- version "5.65.0"
- resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.65.0.tgz#ed2891d9145ba1f0d318e4ea4f89c3fa18e6f9be"
- integrity sha512-Q5or2o6EKs7+oKmJo7LaqZaMOlDWQse9Tm5l1WAfU/ujLGN5Pb0SqGeVkN/4bpPmEqEP5RnVhiqsOtWtUVwGRw==
+ version "5.66.0"
+ resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.66.0.tgz#789bf36287f407fc92b3e2d6f978ddff1bfc2dbb"
+ integrity sha512-NJNtGT7IKpGzdW7Iwpn/09OXz9inIkeIQ/ibY6B+MdV1x6+uReqz/5z1L89ezWnpPDWpXF0TY5PCYKQdWVn8Vg==
dependencies:
"@types/eslint-scope" "^3.7.0"
"@types/estree" "^0.0.50"
@@ -15039,7 +15039,7 @@ webpack@^5.61.0, webpack@^5.64.0:
eslint-scope "5.1.1"
events "^3.2.0"
glob-to-regexp "^0.4.1"
- graceful-fs "^4.2.4"
+ graceful-fs "^4.2.9"
json-parse-better-errors "^1.0.2"
loader-runner "^4.2.0"
mime-types "^2.1.27"
From 04cb5d869411159d7eb53b952e2bef208f88e112 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 17 Jan 2022 00:52:52 -0800
Subject: [PATCH 20/29] chore: bump ts-jest from 27.1.2 to 27.1.3 (#4457)
Bumps [ts-jest](https://github.com/kulshekhar/ts-jest) from 27.1.2 to 27.1.3.
- [Release notes](https://github.com/kulshekhar/ts-jest/releases)
- [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kulshekhar/ts-jest/compare/v27.1.2...v27.1.3)
---
updated-dependencies:
- dependency-name: ts-jest
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index e39d75eb9ab6..d5f04e304cf0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -14300,9 +14300,9 @@ ts-essentials@^2.0.3:
integrity sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w==
ts-jest@^27.0.5:
- version "27.1.2"
- resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.2.tgz#5991d6eb3fd8e1a8d4b8f6de3ec0a3cc567f3151"
- integrity sha512-eSOiJOWq6Hhs6Khzk5wKC5sgWIXgXqOCiIl1+3lfnearu58Hj4QpE5tUhQcA3xtZrELbcvAGCsd6HB8OsaVaTA==
+ version "27.1.3"
+ resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.3.tgz#1f723e7e74027c4da92c0ffbd73287e8af2b2957"
+ integrity sha512-6Nlura7s6uM9BVUAoqLH7JHyMXjz8gluryjpPXxr3IxZdAXnU6FhjvVLHFtfd1vsE1p8zD1OJfskkc0jhTSnkA==
dependencies:
bs-logger "0.x"
fast-json-stable-stringify "2.x"
From ba3d3a3b580cbd015b7968ffb762a24b17fa6ad6 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 17 Jan 2022 00:52:59 -0800
Subject: [PATCH 21/29] chore: bump eslint-plugin-jest from 25.3.4 to 25.7.0
(#4456)
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 25.3.4 to 25.7.0.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v25.3.4...v25.7.0)
---
updated-dependencies:
- dependency-name: eslint-plugin-jest
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index d5f04e304cf0..6d1fad15160b 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -6872,9 +6872,9 @@ eslint-plugin-import@^2.25.2:
tsconfig-paths "^3.12.0"
eslint-plugin-jest@^25.0.5:
- version "25.3.4"
- resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-25.3.4.tgz#2031dfe495be1463330f8b80096ddc91f8e6387f"
- integrity sha512-CCnwG71wvabmwq/qkz0HWIqBHQxw6pXB1uqt24dxqJ9WB34pVg49bL1sjXphlJHgTMWGhBjN1PicdyxDxrfP5A==
+ version "25.7.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-25.7.0.tgz#ff4ac97520b53a96187bad9c9814e7d00de09a6a"
+ integrity sha512-PWLUEXeeF7C9QGKqvdSbzLOiLTx+bno7/HC9eefePfEb257QFHg7ye3dh80AZVkaa/RQsBB1Q/ORQvg2X7F0NQ==
dependencies:
"@typescript-eslint/experimental-utils" "^5.0.0"
From e56f1e5d52fcbf3caae43034872e0b3181871689 Mon Sep 17 00:00:00 2001
From: Yosuke Ota
Date: Mon, 17 Jan 2022 17:56:46 +0900
Subject: [PATCH 22/29] fix(eslint-plugin): [no-invalid-this] crash when used
with eslint 8.7.0 (#4448)
* fix(eslint-plugin): [no-invalid-this] crash when used with eslint 8.7.0
* revert eslint version
---
.../src/rules/no-invalid-this.ts | 8 ++++----
.../eslint-plugin/typings/eslint-rules.d.ts | 20 +++++++++++++------
2 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/packages/eslint-plugin/src/rules/no-invalid-this.ts b/packages/eslint-plugin/src/rules/no-invalid-this.ts
index 5884cc61dfa0..0ea8692e64a8 100644
--- a/packages/eslint-plugin/src/rules/no-invalid-this.ts
+++ b/packages/eslint-plugin/src/rules/no-invalid-this.ts
@@ -64,12 +64,12 @@ export default createRule({
),
);
// baseRule's work
- rules.FunctionDeclaration(node);
+ rules.FunctionDeclaration?.(node);
},
'FunctionDeclaration:exit'(node: TSESTree.FunctionDeclaration): void {
thisIsValidStack.pop();
// baseRule's work
- rules['FunctionDeclaration:exit'](node);
+ rules['FunctionDeclaration:exit']?.(node);
},
FunctionExpression(node: TSESTree.FunctionExpression): void {
thisIsValidStack.push(
@@ -79,12 +79,12 @@ export default createRule({
),
);
// baseRule's work
- rules.FunctionExpression(node);
+ rules.FunctionExpression?.(node);
},
'FunctionExpression:exit'(node: TSESTree.FunctionExpression): void {
thisIsValidStack.pop();
// baseRule's work
- rules['FunctionExpression:exit'](node);
+ rules['FunctionExpression:exit']?.(node);
},
ThisExpression(node: TSESTree.ThisExpression): void {
const thisIsValidHere = thisIsValidStack[thisIsValidStack.length - 1];
diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts
index a279276e91b0..fc2491d67c85 100644
--- a/packages/eslint-plugin/typings/eslint-rules.d.ts
+++ b/packages/eslint-plugin/typings/eslint-rules.d.ts
@@ -701,12 +701,20 @@ declare module 'eslint/lib/rules/no-invalid-this' {
}?,
],
{
- Program(node: TSESTree.Program): void;
- 'Program:exit'(node: TSESTree.Program): void;
- FunctionDeclaration(node: TSESTree.FunctionDeclaration): void;
- 'FunctionDeclaration:exit'(node: TSESTree.FunctionDeclaration): void;
- FunctionExpression(node: TSESTree.FunctionExpression): void;
- 'FunctionExpression:exit'(node: TSESTree.FunctionExpression): void;
+ // for ESLint < v8.7.0
+ Program?: (node: TSESTree.Program) => void;
+ 'Program:exit'?: (node: TSESTree.Program) => void;
+ FunctionDeclaration?: (node: TSESTree.FunctionDeclaration) => void;
+ 'FunctionDeclaration:exit'?: (node: TSESTree.FunctionDeclaration) => void;
+ FunctionExpression?: (node: TSESTree.FunctionExpression) => void;
+ 'FunctionExpression:exit'?: (node: TSESTree.FunctionExpression) => void;
+
+ // for ESLint >= v8.7.0
+ // We don't use it and we don't have the CodePath types, so comment out it.
+ // onCodePathStart?: (codePath: unknown, node: TSESTree.Node) => void
+ // onCodePathEnd?: (codePath: unknown, node: TSESTree.Node) => void
+
+ // Common
ThisExpression(node: TSESTree.ThisExpression): void;
}
>;
From 3061ea9f83f3208ce092cb4e8d96a087a0c273e3 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 17 Jan 2022 00:57:01 -0800
Subject: [PATCH 23/29] chore: bump @babel/types from 7.16.7 to 7.16.8 (#4454)
Bumps [@babel/types](https://github.com/babel/babel/tree/HEAD/packages/babel-types) from 7.16.7 to 7.16.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.8/packages/babel-types)
---
updated-dependencies:
- dependency-name: "@babel/types"
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
yarn.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/yarn.lock b/yarn.lock
index 6d1fad15160b..e27212405071 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1309,9 +1309,9 @@
globals "^11.1.0"
"@babel/types@*", "@babel/types@^7.0.0", "@babel/types@^7.12.7", "@babel/types@^7.15.6", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4":
- version "7.16.7"
- resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.7.tgz#4ed19d51f840ed4bd5645be6ce40775fecf03159"
- integrity sha512-E8HuV7FO9qLpx6OtoGfUQ2cjIYnbFwvZWYBS+87EwtdMvmUPJSwykpovFB+8insbpF0uJcpr8KMUi64XZntZcg==
+ version "7.16.8"
+ resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.8.tgz#0ba5da91dd71e0a4e7781a30f22770831062e3c1"
+ integrity sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==
dependencies:
"@babel/helper-validator-identifier" "^7.16.7"
to-fast-properties "^2.0.0"
From ef3147cf73767ddece91ce57f6028a83ce074b60 Mon Sep 17 00:00:00 2001
From: Rebecca Stevens
Date: Mon, 17 Jan 2022 21:59:04 +1300
Subject: [PATCH 24/29] fix(type-utils): check IndexSignature internals when
checking isTypeReadonly (#4417)
* fix(type-utils): make isTypeReadonly's options param optional
fix #4410
* test(type-utils): add basic tests for isTypeReadonly
* test(type-utils): add test for IndexSignature internals
* fix(type-utils): check IndexSignature internals when checking isTypeReadonly
fix #3714
* perf(type-utils): don't test IndexSignature key for readonlyness as it will always be readonly
Co-authored-by: Josh Goldberg
---
packages/type-utils/src/isTypeReadonly.ts | 56 +++++++++++++------
.../type-utils/tests/isTypeReadonly.test.ts | 28 ++++++++++
2 files changed, 68 insertions(+), 16 deletions(-)
diff --git a/packages/type-utils/src/isTypeReadonly.ts b/packages/type-utils/src/isTypeReadonly.ts
index d5d05e94a0e8..632108cd6b3a 100644
--- a/packages/type-utils/src/isTypeReadonly.ts
+++ b/packages/type-utils/src/isTypeReadonly.ts
@@ -107,9 +107,16 @@ function isTypeReadonlyObject(
function checkIndexSignature(kind: ts.IndexKind): Readonlyness {
const indexInfo = checker.getIndexInfoOfType(type, kind);
if (indexInfo) {
- return indexInfo.isReadonly
- ? Readonlyness.Readonly
- : Readonlyness.Mutable;
+ if (!indexInfo.isReadonly) {
+ return Readonlyness.Mutable;
+ }
+
+ return isTypeReadonlyRecurser(
+ checker,
+ indexInfo.type,
+ options,
+ seenTypes,
+ );
}
return Readonlyness.UnknownType;
@@ -119,20 +126,37 @@ function isTypeReadonlyObject(
if (properties.length) {
// ensure the properties are marked as readonly
for (const property of properties) {
- if (
- !(
- isPropertyReadonlyInType(type, property.getEscapedName(), checker) ||
- (options.treatMethodsAsReadonly &&
- property.valueDeclaration !== undefined &&
- hasSymbol(property.valueDeclaration) &&
- isSymbolFlagSet(
- property.valueDeclaration.symbol,
- ts.SymbolFlags.Method,
- ))
- )
- ) {
- return Readonlyness.Mutable;
+ if (options.treatMethodsAsReadonly) {
+ if (
+ property.valueDeclaration !== undefined &&
+ hasSymbol(property.valueDeclaration) &&
+ isSymbolFlagSet(
+ property.valueDeclaration.symbol,
+ ts.SymbolFlags.Method,
+ )
+ ) {
+ continue;
+ }
+
+ const declarations = property.getDeclarations();
+ const lastDeclaration =
+ declarations !== undefined && declarations.length > 0
+ ? declarations[declarations.length - 1]
+ : undefined;
+ if (
+ lastDeclaration !== undefined &&
+ hasSymbol(lastDeclaration) &&
+ isSymbolFlagSet(lastDeclaration.symbol, ts.SymbolFlags.Method)
+ ) {
+ continue;
+ }
+ }
+
+ if (isPropertyReadonlyInType(type, property.getEscapedName(), checker)) {
+ continue;
}
+
+ return Readonlyness.Mutable;
}
// all properties were readonly
diff --git a/packages/type-utils/tests/isTypeReadonly.test.ts b/packages/type-utils/tests/isTypeReadonly.test.ts
index 5afc3b6e59ca..d63ecf422d93 100644
--- a/packages/type-utils/tests/isTypeReadonly.test.ts
+++ b/packages/type-utils/tests/isTypeReadonly.test.ts
@@ -109,6 +109,34 @@ describe('isTypeReadonly', () => {
])('handles non fully readonly sets and maps', runTests);
});
});
+
+ describe('IndexSignature', () => {
+ describe('is readonly', () => {
+ const runTests = runTestIsReadonly;
+
+ it.each([
+ ['type Test = { readonly [key: string]: string };'],
+ [
+ 'type Test = { readonly [key: string]: { readonly foo: readonly string[]; }; };',
+ ],
+ ])(
+ 'handles readonly PropertySignature inside a readonly IndexSignature',
+ runTests,
+ );
+ });
+
+ describe('is not readonly', () => {
+ const runTests = runTestIsNotReadonly;
+
+ it.each([
+ ['type Test = { [key: string]: string };'],
+ ['type Test = { readonly [key: string]: { foo: string[]; }; };'],
+ ])(
+ 'handles mutable PropertySignature inside a readonly IndexSignature',
+ runTests,
+ );
+ });
+ });
});
describe('treatMethodsAsReadonly', () => {
From 99ab193bb02f181bed4ed917b1d121ed189d3fe4 Mon Sep 17 00:00:00 2001
From: Rebecca Stevens
Date: Mon, 17 Jan 2022 23:34:59 +1300
Subject: [PATCH 25/29] fix(type-utils): union types always being marked as
readonly (#4419)
---
packages/type-utils/src/isTypeReadonly.ts | 3 ++-
.../type-utils/tests/isTypeReadonly.test.ts | 27 +++++++++++++++++++
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/packages/type-utils/src/isTypeReadonly.ts b/packages/type-utils/src/isTypeReadonly.ts
index 632108cd6b3a..b8757b0a222c 100644
--- a/packages/type-utils/src/isTypeReadonly.ts
+++ b/packages/type-utils/src/isTypeReadonly.ts
@@ -216,7 +216,8 @@ function isTypeReadonlyRecurser(
const result = unionTypeParts(type).every(
t =>
seenTypes.has(t) ||
- isTypeReadonlyRecurser(checker, t, options, seenTypes),
+ isTypeReadonlyRecurser(checker, t, options, seenTypes) ===
+ Readonlyness.Readonly,
);
const readonlyness = result ? Readonlyness.Readonly : Readonlyness.Mutable;
return readonlyness;
diff --git a/packages/type-utils/tests/isTypeReadonly.test.ts b/packages/type-utils/tests/isTypeReadonly.test.ts
index d63ecf422d93..6c39955b7ee9 100644
--- a/packages/type-utils/tests/isTypeReadonly.test.ts
+++ b/packages/type-utils/tests/isTypeReadonly.test.ts
@@ -137,6 +137,33 @@ describe('isTypeReadonly', () => {
);
});
});
+
+ describe('Union', () => {
+ describe('is readonly', () => {
+ const runTests = runTestIsReadonly;
+
+ it.each([
+ [
+ 'type Test = Readonly<{ foo: string; bar: number; }> & Readonly<{ bar: number; }>;',
+ ],
+ ['type Test = readonly string[] | readonly number[];'],
+ ])('handles a union of 2 fully readonly types', runTests);
+ });
+
+ describe('is not readonly', () => {
+ const runTests = runTestIsNotReadonly;
+
+ it.each([
+ ['type Test = { foo: string; bar: number; } | { bar: number; };'],
+ [
+ 'type Test = { foo: string; bar: number; } | Readonly<{ bar: number; }>;',
+ ],
+ [
+ 'type Test = Readonly<{ foo: string; bar: number; }> | { bar: number; };',
+ ],
+ ])('handles a union of non fully readonly types', runTests);
+ });
+ });
});
describe('treatMethodsAsReadonly', () => {
From f4016c24f9023e8a42def9501b68c4a908cbfede Mon Sep 17 00:00:00 2001
From: Yosuke Ota
Date: Mon, 17 Jan 2022 19:52:55 +0900
Subject: [PATCH 26/29] fix(eslint-plugin): [no-extra-semi] false negatives
when used with eslint 8.3.0 (#4458)
---
package.json | 2 +-
.../eslint-plugin/src/rules/no-extra-semi.ts | 7 +-
.../eslint-plugin/typings/eslint-rules.d.ts | 9 +-
yarn.lock | 99 ++++++++++++++++++-
4 files changed, 112 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index 7a872962710f..331f95b03b49 100644
--- a/package.json
+++ b/package.json
@@ -85,7 +85,7 @@
"cz-conventional-changelog": "^3.3.0",
"downlevel-dts": "^0.8.0",
"enhanced-resolve": "^5.8.3",
- "eslint": "^8.1.0",
+ "eslint": "^8.7.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-eslint-plugin": "^4.0.1",
"eslint-plugin-import": "^2.25.2",
diff --git a/packages/eslint-plugin/src/rules/no-extra-semi.ts b/packages/eslint-plugin/src/rules/no-extra-semi.ts
index 4ae5cb5c396b..7100b5d6f880 100644
--- a/packages/eslint-plugin/src/rules/no-extra-semi.ts
+++ b/packages/eslint-plugin/src/rules/no-extra-semi.ts
@@ -32,9 +32,12 @@ export default util.createRule({
if (rules.MethodDefinition) {
// for ESLint <= v7
rules.MethodDefinition(node);
+ } else if (rules['MethodDefinition, PropertyDefinition']) {
+ // for ESLint >= v8 < v8.3.0
+ rules['MethodDefinition, PropertyDefinition'](node);
} else {
- // for ESLint v8
- rules['MethodDefinition, PropertyDefinition']?.(node);
+ // for ESLint >= v8.3.0
+ rules['MethodDefinition, PropertyDefinition, StaticBlock']?.(node);
}
},
};
diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts
index fc2491d67c85..5f6e1412f333 100644
--- a/packages/eslint-plugin/typings/eslint-rules.d.ts
+++ b/packages/eslint-plugin/typings/eslint-rules.d.ts
@@ -644,10 +644,17 @@ declare module 'eslint/lib/rules/no-extra-semi' {
ClassBody(node: TSESTree.ClassBody): void;
// for ESLint <= v7
MethodDefinition?: (node: TSESTree.MethodDefinition) => void;
- // for ESLint v8
+ // for ESLint >= v8 < v8.3.0
'MethodDefinition, PropertyDefinition'?: (
node: TSESTree.MethodDefinition | TSESTree.PropertyDefinition,
) => void;
+ // for ESLint >= v8.3.0
+ 'MethodDefinition, PropertyDefinition, StaticBlock'?: (
+ node:
+ | TSESTree.MethodDefinition
+ | TSESTree.PropertyDefinition
+ | TSESTree.StaticBlock,
+ ) => void;
}
>;
export = rule;
diff --git a/yarn.lock b/yarn.lock
index e27212405071..f0352ee1052f 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2078,6 +2078,21 @@
minimatch "^3.0.4"
strip-json-comments "^3.1.1"
+"@eslint/eslintrc@^1.0.5":
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.0.5.tgz#33f1b838dbf1f923bfa517e008362b78ddbbf318"
+ integrity sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==
+ dependencies:
+ ajv "^6.12.4"
+ debug "^4.3.2"
+ espree "^9.2.0"
+ globals "^13.9.0"
+ ignore "^4.0.6"
+ import-fresh "^3.2.1"
+ js-yaml "^4.1.0"
+ minimatch "^3.0.4"
+ strip-json-comments "^3.1.1"
+
"@gar/promisify@^1.0.1":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.2.tgz#30aa825f11d438671d585bd44e7fd564535fc210"
@@ -2113,11 +2128,25 @@
debug "^4.1.1"
minimatch "^3.0.4"
+"@humanwhocodes/config-array@^0.9.2":
+ version "0.9.2"
+ resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.2.tgz#68be55c737023009dfc5fe245d51181bb6476914"
+ integrity sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==
+ dependencies:
+ "@humanwhocodes/object-schema" "^1.2.1"
+ debug "^4.1.1"
+ minimatch "^3.0.4"
+
"@humanwhocodes/object-schema@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf"
integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==
+"@humanwhocodes/object-schema@^1.2.1":
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
+ integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
+
"@hutson/parse-repository-url@^3.0.0":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340"
@@ -4319,6 +4348,11 @@ acorn@^8.0.4, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2"
integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==
+acorn@^8.7.0:
+ version "8.7.0"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf"
+ integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==
+
add-stream@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa"
@@ -6942,6 +6976,14 @@ eslint-scope@^6.0.0:
esrecurse "^4.3.0"
estraverse "^5.2.0"
+eslint-scope@^7.1.0:
+ version "7.1.0"
+ resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.0.tgz#c1f6ea30ac583031f203d65c73e723b01298f153"
+ integrity sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==
+ dependencies:
+ esrecurse "^4.3.0"
+ estraverse "^5.2.0"
+
eslint-utils@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27"
@@ -6971,7 +7013,12 @@ eslint-visitor-keys@^3.0.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1"
integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==
-eslint@*, eslint@^8.1.0:
+eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.2.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.2.0.tgz#6fbb166a6798ee5991358bc2daa1ba76cc1254a1"
+ integrity sha512-IOzT0X126zn7ALX0dwFiUQEdsfzrm4+ISsQS8nukaJXwEyYKRSnEIIDULYg1mCtGp7UUXgfGl7BIolXREQK+XQ==
+
+eslint@*:
version "8.1.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.1.0.tgz#00f1f7dbf4134f26588e6c9f2efe970760f64664"
integrity sha512-JZvNneArGSUsluHWJ8g8MMs3CfIEzwaLx9KyH4tZ2i+R2/rPWzL8c0zg3rHdwYVpN/1sB9gqnjHwz9HoeJpGHw==
@@ -7061,6 +7108,47 @@ eslint@7.32.0:
text-table "^0.2.0"
v8-compile-cache "^2.0.3"
+eslint@^8.7.0:
+ version "8.7.0"
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.7.0.tgz#22e036842ee5b7cf87b03fe237731675b4d3633c"
+ integrity sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w==
+ dependencies:
+ "@eslint/eslintrc" "^1.0.5"
+ "@humanwhocodes/config-array" "^0.9.2"
+ ajv "^6.10.0"
+ chalk "^4.0.0"
+ cross-spawn "^7.0.2"
+ debug "^4.3.2"
+ doctrine "^3.0.0"
+ escape-string-regexp "^4.0.0"
+ eslint-scope "^7.1.0"
+ eslint-utils "^3.0.0"
+ eslint-visitor-keys "^3.2.0"
+ espree "^9.3.0"
+ esquery "^1.4.0"
+ esutils "^2.0.2"
+ fast-deep-equal "^3.1.3"
+ file-entry-cache "^6.0.1"
+ functional-red-black-tree "^1.0.1"
+ glob-parent "^6.0.1"
+ globals "^13.6.0"
+ ignore "^5.2.0"
+ import-fresh "^3.0.0"
+ imurmurhash "^0.1.4"
+ is-glob "^4.0.0"
+ js-yaml "^4.1.0"
+ json-stable-stringify-without-jsonify "^1.0.1"
+ levn "^0.4.1"
+ lodash.merge "^4.6.2"
+ minimatch "^3.0.4"
+ natural-compare "^1.4.0"
+ optionator "^0.9.1"
+ regexpp "^3.2.0"
+ strip-ansi "^6.0.1"
+ strip-json-comments "^3.1.0"
+ text-table "^0.2.0"
+ v8-compile-cache "^2.0.3"
+
espree@^7.3.0, espree@^7.3.1:
version "7.3.1"
resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6"
@@ -7079,6 +7167,15 @@ espree@^9.0.0:
acorn-jsx "^5.3.1"
eslint-visitor-keys "^3.0.0"
+espree@^9.2.0, espree@^9.3.0:
+ version "9.3.0"
+ resolved "https://registry.yarnpkg.com/espree/-/espree-9.3.0.tgz#c1240d79183b72aaee6ccfa5a90bc9111df085a8"
+ integrity sha512-d/5nCsb0JcqsSEeQzFZ8DH1RmxPcglRWh24EFTlUEmCKoehXGdpsx0RkHDubqUI8LSAIKMQp4r9SzQ3n+sm4HQ==
+ dependencies:
+ acorn "^8.7.0"
+ acorn-jsx "^5.3.1"
+ eslint-visitor-keys "^3.1.0"
+
esprima@^4.0.0, esprima@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
From 39a6806c61a48bbca93f9ffb965dd8b3fe0575b3 Mon Sep 17 00:00:00 2001
From: Rebecca Stevens
Date: Tue, 18 Jan 2022 00:12:14 +1300
Subject: [PATCH 27/29] fix(type-utils): isTypeReadonly now handles conditional
types (#4421)
---
packages/type-utils/src/isTypeReadonly.ts | 15 +++++++++
.../type-utils/tests/isTypeReadonly.test.ts | 32 +++++++++++++++++++
2 files changed, 47 insertions(+)
diff --git a/packages/type-utils/src/isTypeReadonly.ts b/packages/type-utils/src/isTypeReadonly.ts
index b8757b0a222c..0c5b30d83f16 100644
--- a/packages/type-utils/src/isTypeReadonly.ts
+++ b/packages/type-utils/src/isTypeReadonly.ts
@@ -1,5 +1,6 @@
import { ESLintUtils } from '@typescript-eslint/utils';
import {
+ isConditionalType,
isObjectType,
isUnionType,
isUnionOrIntersectionType,
@@ -223,6 +224,20 @@ function isTypeReadonlyRecurser(
return readonlyness;
}
+ if (isConditionalType(type)) {
+ const result = [type.root.node.trueType, type.root.node.falseType]
+ .map(checker.getTypeFromTypeNode)
+ .every(
+ t =>
+ seenTypes.has(t) ||
+ isTypeReadonlyRecurser(checker, t, options, seenTypes) ===
+ Readonlyness.Readonly,
+ );
+
+ const readonlyness = result ? Readonlyness.Readonly : Readonlyness.Mutable;
+ return readonlyness;
+ }
+
// all non-object, non-intersection types are readonly.
// this should only be primitive types
if (!isObjectType(type) && !isUnionOrIntersectionType(type)) {
diff --git a/packages/type-utils/tests/isTypeReadonly.test.ts b/packages/type-utils/tests/isTypeReadonly.test.ts
index 6c39955b7ee9..0924bd6122f1 100644
--- a/packages/type-utils/tests/isTypeReadonly.test.ts
+++ b/packages/type-utils/tests/isTypeReadonly.test.ts
@@ -164,6 +164,38 @@ describe('isTypeReadonly', () => {
])('handles a union of non fully readonly types', runTests);
});
});
+
+ describe('Conditional Types', () => {
+ describe('is readonly', () => {
+ const runTests = runTestIsReadonly;
+
+ it.each([
+ [
+ 'type Test = T extends readonly number[] ? readonly string[] : readonly number[];',
+ ],
+ ])('handles conditional type that are fully readonly', runTests);
+
+ it.each([
+ [
+ 'type Test = T extends number[] ? readonly string[] : readonly number[];',
+ ],
+ ])('should ignore mutable conditions', runTests);
+ });
+
+ describe('is not readonly', () => {
+ const runTests = runTestIsNotReadonly;
+
+ it.each([
+ ['type Test = T extends number[] ? string[] : number[];'],
+ [
+ 'type Test = T extends number[] ? string[] : readonly number[];',
+ ],
+ [
+ 'type Test = T extends number[] ? readonly string[] : number[];',
+ ],
+ ])('handles non fully readonly conditional types', runTests);
+ });
+ });
});
describe('treatMethodsAsReadonly', () => {
From 5046882025e3bc8cb122ecef703aebd0b5e79017 Mon Sep 17 00:00:00 2001
From: Rebecca Stevens
Date: Tue, 18 Jan 2022 00:32:37 +1300
Subject: [PATCH 28/29] fix(type-utils): intersection types involving readonly
arrays are now handled in most cases (#4429)
---
packages/type-utils/src/isTypeReadonly.ts | 30 ++++++++++++-
.../type-utils/tests/isTypeReadonly.test.ts | 44 +++++++++++++++++++
2 files changed, 72 insertions(+), 2 deletions(-)
diff --git a/packages/type-utils/src/isTypeReadonly.ts b/packages/type-utils/src/isTypeReadonly.ts
index 0c5b30d83f16..0ec24438943e 100644
--- a/packages/type-utils/src/isTypeReadonly.ts
+++ b/packages/type-utils/src/isTypeReadonly.ts
@@ -3,10 +3,10 @@ import {
isConditionalType,
isObjectType,
isUnionType,
- isUnionOrIntersectionType,
unionTypeParts,
isPropertyReadonlyInType,
isSymbolFlagSet,
+ isIntersectionType,
} from 'tsutils';
import * as ts from 'typescript';
import { getTypeOfPropertyOfType } from './propertyTypes';
@@ -224,6 +224,32 @@ function isTypeReadonlyRecurser(
return readonlyness;
}
+ if (isIntersectionType(type)) {
+ // Special case for handling arrays/tuples (as readonly arrays/tuples always have mutable methods).
+ if (
+ type.types.some(t => checker.isArrayType(t) || checker.isTupleType(t))
+ ) {
+ const allReadonlyParts = type.types.every(
+ t =>
+ seenTypes.has(t) ||
+ isTypeReadonlyRecurser(checker, t, options, seenTypes) ===
+ Readonlyness.Readonly,
+ );
+ return allReadonlyParts ? Readonlyness.Readonly : Readonlyness.Mutable;
+ }
+
+ // Normal case.
+ const isReadonlyObject = isTypeReadonlyObject(
+ checker,
+ type,
+ options,
+ seenTypes,
+ );
+ if (isReadonlyObject !== Readonlyness.UnknownType) {
+ return isReadonlyObject;
+ }
+ }
+
if (isConditionalType(type)) {
const result = [type.root.node.trueType, type.root.node.falseType]
.map(checker.getTypeFromTypeNode)
@@ -240,7 +266,7 @@ function isTypeReadonlyRecurser(
// all non-object, non-intersection types are readonly.
// this should only be primitive types
- if (!isObjectType(type) && !isUnionOrIntersectionType(type)) {
+ if (!isObjectType(type)) {
return Readonlyness.Readonly;
}
diff --git a/packages/type-utils/tests/isTypeReadonly.test.ts b/packages/type-utils/tests/isTypeReadonly.test.ts
index 0924bd6122f1..f6f2cebd12bc 100644
--- a/packages/type-utils/tests/isTypeReadonly.test.ts
+++ b/packages/type-utils/tests/isTypeReadonly.test.ts
@@ -165,6 +165,50 @@ describe('isTypeReadonly', () => {
});
});
+ describe('Intersection', () => {
+ describe('is readonly', () => {
+ const runTests = runTestIsReadonly;
+
+ it.each([
+ [
+ 'type Test = Readonly<{ foo: string; bar: number; }> & Readonly<{ bar: number; }>;',
+ ],
+ ])('handles an intersection of 2 fully readonly types', runTests);
+
+ it.each([
+ [
+ 'type Test = Readonly<{ foo: string; bar: number; }> & { foo: string; };',
+ ],
+ ])(
+ 'handles an intersection of a fully readonly type with a mutable subtype',
+ runTests,
+ );
+
+ // Array - special case.
+ // Note: Methods are mutable but arrays are treated special; hence no failure.
+ it.each([
+ ['type Test = ReadonlyArray & Readonly<{ foo: string; }>;'],
+ [
+ 'type Test = readonly [string, number] & Readonly<{ foo: string; }>;',
+ ],
+ ])('handles an intersections involving a readonly array', runTests);
+ });
+
+ describe('is not readonly', () => {
+ const runTests = runTestIsNotReadonly;
+
+ it.each([
+ ['type Test = { foo: string; bar: number; } & { bar: number; };'],
+ [
+ 'type Test = { foo: string; bar: number; } & Readonly<{ bar: number; }>;',
+ ],
+ [
+ 'type Test = Readonly<{ bar: number; }> & { foo: string; bar: number; };',
+ ],
+ ])('handles an intersection of non fully readonly types', runTests);
+ });
+ });
+
describe('Conditional Types', () => {
describe('is readonly', () => {
const runTests = runTestIsReadonly;
From 88941065097ce71a0e385cb2e00c1b263dbc69ab Mon Sep 17 00:00:00 2001
From: James Henry
Date: Mon, 17 Jan 2022 18:02:02 +0000
Subject: [PATCH 29/29] chore: publish v5.10.0
---
CHANGELOG.md | 24 ++++++++++++++++++++
lerna.json | 2 +-
packages/ast-spec/CHANGELOG.md | 11 +++++++++
packages/ast-spec/package.json | 2 +-
packages/eslint-plugin-internal/CHANGELOG.md | 11 +++++++++
packages/eslint-plugin-internal/package.json | 6 ++---
packages/eslint-plugin-tslint/CHANGELOG.md | 11 +++++++++
packages/eslint-plugin-tslint/package.json | 6 ++---
packages/eslint-plugin/CHANGELOG.md | 19 ++++++++++++++++
packages/eslint-plugin/package.json | 8 +++----
packages/experimental-utils/CHANGELOG.md | 13 +++++++++--
packages/experimental-utils/package.json | 4 ++--
packages/parser/CHANGELOG.md | 11 +++++++++
packages/parser/package.json | 8 +++----
packages/scope-manager/CHANGELOG.md | 8 +++++++
packages/scope-manager/package.json | 8 +++----
packages/shared-fixtures/CHANGELOG.md | 8 +++++++
packages/shared-fixtures/package.json | 2 +-
packages/type-utils/CHANGELOG.md | 20 ++++++++++++++++
packages/type-utils/package.json | 6 ++---
packages/types/CHANGELOG.md | 11 +++++++++
packages/types/package.json | 2 +-
packages/typescript-estree/CHANGELOG.md | 8 +++++++
packages/typescript-estree/package.json | 8 +++----
packages/utils/CHANGELOG.md | 7 ++++++
packages/utils/package.json | 8 +++----
packages/visitor-keys/CHANGELOG.md | 8 +++++++
packages/visitor-keys/package.json | 4 ++--
packages/website-eslint/CHANGELOG.md | 11 +++++++++
packages/website-eslint/package.json | 16 ++++++-------
packages/website/CHANGELOG.md | 8 +++++++
packages/website/package.json | 4 ++--
32 files changed, 234 insertions(+), 49 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e0fb9a26f1cd..4338f9f39256 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [explicit-function-return-type] support AllowTypedFunctionExpression within AllowHigherOrderFunction ([#4250](https://github.com/typescript-eslint/typescript-eslint/issues/4250)) ([d053cde](https://github.com/typescript-eslint/typescript-eslint/commit/d053cde3e8b5bf9ba1c22fd64a7456d672ef77ca))
+* **eslint-plugin:** [no-extra-semi] false negatives when used with eslint 8.3.0 ([#4458](https://github.com/typescript-eslint/typescript-eslint/issues/4458)) ([f4016c2](https://github.com/typescript-eslint/typescript-eslint/commit/f4016c24f9023e8a42def9501b68c4a908cbfede))
+* **eslint-plugin:** [no-invalid-this] crash when used with eslint 8.7.0 ([#4448](https://github.com/typescript-eslint/typescript-eslint/issues/4448)) ([e56f1e5](https://github.com/typescript-eslint/typescript-eslint/commit/e56f1e5d52fcbf3caae43034872e0b3181871689))
+* **eslint-plugin:** [no-magic-numbers] handle bigint in class props ([#4411](https://github.com/typescript-eslint/typescript-eslint/issues/4411)) ([c8e650f](https://github.com/typescript-eslint/typescript-eslint/commit/c8e650f0c124d24b24beaeb376eaf61ee8d9e6fb))
+* **type-utils:** check IndexSignature internals when checking isTypeReadonly ([#4417](https://github.com/typescript-eslint/typescript-eslint/issues/4417)) ([ef3147c](https://github.com/typescript-eslint/typescript-eslint/commit/ef3147cf73767ddece91ce57f6028a83ce074b60)), closes [#4410](https://github.com/typescript-eslint/typescript-eslint/issues/4410) [#3714](https://github.com/typescript-eslint/typescript-eslint/issues/3714)
+* **type-utils:** intersection types involving readonly arrays are now handled in most cases ([#4429](https://github.com/typescript-eslint/typescript-eslint/issues/4429)) ([5046882](https://github.com/typescript-eslint/typescript-eslint/commit/5046882025e3bc8cb122ecef703aebd0b5e79017))
+* **type-utils:** isTypeReadonly now handles conditional types ([#4421](https://github.com/typescript-eslint/typescript-eslint/issues/4421)) ([39a6806](https://github.com/typescript-eslint/typescript-eslint/commit/39a6806c61a48bbca93f9ffb965dd8b3fe0575b3))
+* **type-utils:** union types always being marked as readonly ([#4419](https://github.com/typescript-eslint/typescript-eslint/issues/4419)) ([99ab193](https://github.com/typescript-eslint/typescript-eslint/commit/99ab193bb02f181bed4ed917b1d121ed189d3fe4))
+
+
+### Features
+
+* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f))
+* **type-utils:** make isTypeReadonly's options param optional ([#4415](https://github.com/typescript-eslint/typescript-eslint/issues/4415)) ([3a07a56](https://github.com/typescript-eslint/typescript-eslint/commit/3a07a563c987ff25f6cd8925eeeb2ede47cc19e8))
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/typescript-eslint
diff --git a/lerna.json b/lerna.json
index d40ad3fd17cb..e89bb6adbe8a 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,5 +1,5 @@
{
- "version": "5.9.1",
+ "version": "5.10.0",
"npmClient": "yarn",
"useWorkspaces": true,
"stream": true
diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md
index baf675ebdb3a..c1b2da151020 100644
--- a/packages/ast-spec/CHANGELOG.md
+++ b/packages/ast-spec/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+
+### Features
+
+* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f))
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/ast-spec
diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json
index c37160544963..a43949381f92 100644
--- a/packages/ast-spec/package.json
+++ b/packages/ast-spec/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/ast-spec",
- "version": "5.9.1",
+ "version": "5.10.0",
"description": "TypeScript-ESTree AST spec",
"private": true,
"keywords": [
diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md
index 1d3f768bc6d0..438bb1d11ec4 100644
--- a/packages/eslint-plugin-internal/CHANGELOG.md
+++ b/packages/eslint-plugin-internal/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+
+### Features
+
+* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f))
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json
index 3b9d0e8d47fc..60800a13913a 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": "5.9.1",
+ "version": "5.10.0",
"private": true,
"main": "dist/index.js",
"scripts": {
@@ -14,8 +14,8 @@
},
"dependencies": {
"@types/prettier": "*",
- "@typescript-eslint/scope-manager": "5.9.1",
- "@typescript-eslint/utils": "5.9.1",
+ "@typescript-eslint/scope-manager": "5.10.0",
+ "@typescript-eslint/utils": "5.10.0",
"prettier": "*"
}
}
diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md
index abf3ab987a20..0ad5c1468c8e 100644
--- a/packages/eslint-plugin-tslint/CHANGELOG.md
+++ b/packages/eslint-plugin-tslint/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+
+### Features
+
+* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f))
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json
index 3ef927ab65f5..b3ed56a036d7 100644
--- a/packages/eslint-plugin-tslint/package.json
+++ b/packages/eslint-plugin-tslint/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-tslint",
- "version": "5.9.1",
+ "version": "5.10.0",
"main": "dist/index.js",
"typings": "src/index.ts",
"description": "TSLint wrapper plugin for ESLint",
@@ -38,7 +38,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/utils": "5.9.1",
+ "@typescript-eslint/utils": "5.10.0",
"lodash": "^4.17.21"
},
"peerDependencies": {
@@ -48,6 +48,6 @@
},
"devDependencies": {
"@types/lodash": "*",
- "@typescript-eslint/parser": "5.9.1"
+ "@typescript-eslint/parser": "5.10.0"
}
}
diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md
index a23a69950027..718107cbbbc8 100644
--- a/packages/eslint-plugin/CHANGELOG.md
+++ b/packages/eslint-plugin/CHANGELOG.md
@@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [explicit-function-return-type] support AllowTypedFunctionExpression within AllowHigherOrderFunction ([#4250](https://github.com/typescript-eslint/typescript-eslint/issues/4250)) ([d053cde](https://github.com/typescript-eslint/typescript-eslint/commit/d053cde3e8b5bf9ba1c22fd64a7456d672ef77ca))
+* **eslint-plugin:** [no-extra-semi] false negatives when used with eslint 8.3.0 ([#4458](https://github.com/typescript-eslint/typescript-eslint/issues/4458)) ([f4016c2](https://github.com/typescript-eslint/typescript-eslint/commit/f4016c24f9023e8a42def9501b68c4a908cbfede))
+* **eslint-plugin:** [no-invalid-this] crash when used with eslint 8.7.0 ([#4448](https://github.com/typescript-eslint/typescript-eslint/issues/4448)) ([e56f1e5](https://github.com/typescript-eslint/typescript-eslint/commit/e56f1e5d52fcbf3caae43034872e0b3181871689))
+* **eslint-plugin:** [no-magic-numbers] handle bigint in class props ([#4411](https://github.com/typescript-eslint/typescript-eslint/issues/4411)) ([c8e650f](https://github.com/typescript-eslint/typescript-eslint/commit/c8e650f0c124d24b24beaeb376eaf61ee8d9e6fb))
+
+
+### Features
+
+* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f))
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/eslint-plugin
diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json
index 7d62b026e81f..de6fc70bfdd3 100644
--- a/packages/eslint-plugin/package.json
+++ b/packages/eslint-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin",
- "version": "5.9.1",
+ "version": "5.10.0",
"description": "TypeScript plugin for ESLint",
"keywords": [
"eslint",
@@ -44,9 +44,9 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/scope-manager": "5.9.1",
- "@typescript-eslint/type-utils": "5.9.1",
- "@typescript-eslint/utils": "5.9.1",
+ "@typescript-eslint/scope-manager": "5.10.0",
+ "@typescript-eslint/type-utils": "5.10.0",
+ "@typescript-eslint/utils": "5.10.0",
"debug": "^4.3.2",
"functional-red-black-tree": "^1.0.1",
"ignore": "^5.1.8",
diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md
index a1fce3cc9eb1..d1ba36c65f10 100644
--- a/packages/experimental-utils/CHANGELOG.md
+++ b/packages/experimental-utils/CHANGELOG.md
@@ -1,10 +1,19 @@
# Change Log
-> ⚠ Changes for version 6.0 onwards are documented in the `@typescript-eslint/utils` changelog.
-
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+
+### Features
+
+* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f))
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/experimental-utils
diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json
index 342f8955f1be..9594a215a403 100644
--- a/packages/experimental-utils/package.json
+++ b/packages/experimental-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/experimental-utils",
- "version": "5.9.1",
+ "version": "5.10.0",
"description": "(Experimental) Utilities for working with TypeScript + ESLint together",
"keywords": [
"eslint",
@@ -38,7 +38,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/utils": "5.9.1"
+ "@typescript-eslint/utils": "5.10.0"
},
"peerDependencies": {
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md
index afa8af6e4642..a80aa4f4a146 100644
--- a/packages/parser/CHANGELOG.md
+++ b/packages/parser/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+
+### Features
+
+* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f))
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/parser
diff --git a/packages/parser/package.json b/packages/parser/package.json
index 22c42ebd3ec2..1958f2be8b44 100644
--- a/packages/parser/package.json
+++ b/packages/parser/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/parser",
- "version": "5.9.1",
+ "version": "5.10.0",
"description": "An ESLint custom parser which leverages TypeScript ESTree",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -44,9 +44,9 @@
"eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
},
"dependencies": {
- "@typescript-eslint/scope-manager": "5.9.1",
- "@typescript-eslint/types": "5.9.1",
- "@typescript-eslint/typescript-estree": "5.9.1",
+ "@typescript-eslint/scope-manager": "5.10.0",
+ "@typescript-eslint/types": "5.10.0",
+ "@typescript-eslint/typescript-estree": "5.10.0",
"debug": "^4.3.2"
},
"devDependencies": {
diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md
index 58f61334dfc4..24e269df7abf 100644
--- a/packages/scope-manager/CHANGELOG.md
+++ b/packages/scope-manager/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+**Note:** Version bump only for package @typescript-eslint/scope-manager
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/scope-manager
diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json
index fa513d23cd03..904cc2dd8c87 100644
--- a/packages/scope-manager/package.json
+++ b/packages/scope-manager/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/scope-manager",
- "version": "5.9.1",
+ "version": "5.10.0",
"description": "TypeScript scope analyser for ESLint",
"keywords": [
"eslint",
@@ -39,12 +39,12 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/types": "5.9.1",
- "@typescript-eslint/visitor-keys": "5.9.1"
+ "@typescript-eslint/types": "5.10.0",
+ "@typescript-eslint/visitor-keys": "5.10.0"
},
"devDependencies": {
"@types/glob": "*",
- "@typescript-eslint/typescript-estree": "5.9.1",
+ "@typescript-eslint/typescript-estree": "5.10.0",
"glob": "*",
"jest-specific-snapshot": "*",
"make-dir": "*",
diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md
index 8bd3c9f6c527..c52029a99ac3 100644
--- a/packages/shared-fixtures/CHANGELOG.md
+++ b/packages/shared-fixtures/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+**Note:** Version bump only for package @typescript-eslint/shared-fixtures
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/shared-fixtures
diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json
index 04d98f551187..933422483869 100644
--- a/packages/shared-fixtures/package.json
+++ b/packages/shared-fixtures/package.json
@@ -1,5 +1,5 @@
{
"name": "@typescript-eslint/shared-fixtures",
- "version": "5.9.1",
+ "version": "5.10.0",
"private": true
}
diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md
index 36aef638149e..dd0f5abcb1e3 100644
--- a/packages/type-utils/CHANGELOG.md
+++ b/packages/type-utils/CHANGELOG.md
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+
+### Bug Fixes
+
+* **type-utils:** check IndexSignature internals when checking isTypeReadonly ([#4417](https://github.com/typescript-eslint/typescript-eslint/issues/4417)) ([ef3147c](https://github.com/typescript-eslint/typescript-eslint/commit/ef3147cf73767ddece91ce57f6028a83ce074b60)), closes [#4410](https://github.com/typescript-eslint/typescript-eslint/issues/4410) [#3714](https://github.com/typescript-eslint/typescript-eslint/issues/3714)
+* **type-utils:** intersection types involving readonly arrays are now handled in most cases ([#4429](https://github.com/typescript-eslint/typescript-eslint/issues/4429)) ([5046882](https://github.com/typescript-eslint/typescript-eslint/commit/5046882025e3bc8cb122ecef703aebd0b5e79017))
+* **type-utils:** isTypeReadonly now handles conditional types ([#4421](https://github.com/typescript-eslint/typescript-eslint/issues/4421)) ([39a6806](https://github.com/typescript-eslint/typescript-eslint/commit/39a6806c61a48bbca93f9ffb965dd8b3fe0575b3))
+* **type-utils:** union types always being marked as readonly ([#4419](https://github.com/typescript-eslint/typescript-eslint/issues/4419)) ([99ab193](https://github.com/typescript-eslint/typescript-eslint/commit/99ab193bb02f181bed4ed917b1d121ed189d3fe4))
+
+
+### Features
+
+* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f))
+* **type-utils:** make isTypeReadonly's options param optional ([#4415](https://github.com/typescript-eslint/typescript-eslint/issues/4415)) ([3a07a56](https://github.com/typescript-eslint/typescript-eslint/commit/3a07a563c987ff25f6cd8925eeeb2ede47cc19e8))
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/type-utils
diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json
index cd0c1209d8d6..a8fcc005d389 100644
--- a/packages/type-utils/package.json
+++ b/packages/type-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/type-utils",
- "version": "5.9.1",
+ "version": "5.10.0",
"description": "Type utilities for working with TypeScript + ESLint together",
"keywords": [
"eslint",
@@ -39,12 +39,12 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/utils": "5.9.1",
+ "@typescript-eslint/utils": "5.10.0",
"debug": "^4.3.2",
"tsutils": "^3.21.0"
},
"devDependencies": {
- "@typescript-eslint/parser": "5.9.1",
+ "@typescript-eslint/parser": "5.10.0",
"typescript": "*"
},
"peerDependencies": {
diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md
index a9c51d54536c..2c349ed5677a 100644
--- a/packages/types/CHANGELOG.md
+++ b/packages/types/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+
+### Features
+
+* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f))
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/types
diff --git a/packages/types/package.json b/packages/types/package.json
index 4e9ea3a85fc2..773f44a5861a 100644
--- a/packages/types/package.json
+++ b/packages/types/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/types",
- "version": "5.9.1",
+ "version": "5.10.0",
"description": "Types for the TypeScript-ESTree AST spec",
"keywords": [
"eslint",
diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md
index 6cb5a58b4273..6a4882699abc 100644
--- a/packages/typescript-estree/CHANGELOG.md
+++ b/packages/typescript-estree/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-estree
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/typescript-estree
diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json
index 565833eef873..57be9bc0347a 100644
--- a/packages/typescript-estree/package.json
+++ b/packages/typescript-estree/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/typescript-estree",
- "version": "5.9.1",
+ "version": "5.10.0",
"description": "A parser that converts TypeScript source code into an ESTree compatible form",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -41,8 +41,8 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/types": "5.9.1",
- "@typescript-eslint/visitor-keys": "5.9.1",
+ "@typescript-eslint/types": "5.10.0",
+ "@typescript-eslint/visitor-keys": "5.10.0",
"debug": "^4.3.2",
"globby": "^11.0.4",
"is-glob": "^4.0.3",
@@ -59,7 +59,7 @@
"@types/is-glob": "*",
"@types/semver": "*",
"@types/tmp": "*",
- "@typescript-eslint/shared-fixtures": "5.9.1",
+ "@typescript-eslint/shared-fixtures": "5.10.0",
"glob": "*",
"jest-specific-snapshot": "*",
"make-dir": "*",
diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md
index e4d87c4d45c4..d0267163b09d 100644
--- a/packages/utils/CHANGELOG.md
+++ b/packages/utils/CHANGELOG.md
@@ -2,3 +2,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+
+### Features
+
+* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f))
diff --git a/packages/utils/package.json b/packages/utils/package.json
index be1a712fff32..117092f30d90 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/utils",
- "version": "5.9.1",
+ "version": "5.10.0",
"description": "Utilities for working with TypeScript + ESLint together",
"keywords": [
"eslint",
@@ -40,9 +40,9 @@
},
"dependencies": {
"@types/json-schema": "^7.0.9",
- "@typescript-eslint/scope-manager": "5.9.1",
- "@typescript-eslint/types": "5.9.1",
- "@typescript-eslint/typescript-estree": "5.9.1",
+ "@typescript-eslint/scope-manager": "5.10.0",
+ "@typescript-eslint/types": "5.10.0",
+ "@typescript-eslint/typescript-estree": "5.10.0",
"eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0"
},
diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md
index c1b962a1c9d6..e9de89e5ed09 100644
--- a/packages/visitor-keys/CHANGELOG.md
+++ b/packages/visitor-keys/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+**Note:** Version bump only for package @typescript-eslint/visitor-keys
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/visitor-keys
diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json
index 95e9c7207dff..f4d14ec290f4 100644
--- a/packages/visitor-keys/package.json
+++ b/packages/visitor-keys/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/visitor-keys",
- "version": "5.9.1",
+ "version": "5.10.0",
"description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
"keywords": [
"eslint",
@@ -38,7 +38,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/types": "5.9.1",
+ "@typescript-eslint/types": "5.10.0",
"eslint-visitor-keys": "^3.0.0"
},
"devDependencies": {
diff --git a/packages/website-eslint/CHANGELOG.md b/packages/website-eslint/CHANGELOG.md
index 8e8d7b23096c..bf10c5508563 100644
--- a/packages/website-eslint/CHANGELOG.md
+++ b/packages/website-eslint/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+
+### Features
+
+* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f))
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package @typescript-eslint/website-eslint
diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json
index aa38a0bc01d4..eeede1240934 100644
--- a/packages/website-eslint/package.json
+++ b/packages/website-eslint/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/website-eslint",
- "version": "5.9.1",
+ "version": "5.10.0",
"private": true,
"description": "ESLint which works in browsers.",
"engines": {
@@ -16,19 +16,19 @@
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore"
},
"dependencies": {
- "@typescript-eslint/types": "5.9.1",
- "@typescript-eslint/utils": "5.9.1"
+ "@typescript-eslint/types": "5.10.0",
+ "@typescript-eslint/utils": "5.10.0"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.0.6",
"@rollup/pluginutils": "^4.1.1",
- "@typescript-eslint/eslint-plugin": "5.9.1",
- "@typescript-eslint/parser": "5.9.1",
- "@typescript-eslint/scope-manager": "5.9.1",
- "@typescript-eslint/typescript-estree": "5.9.1",
- "@typescript-eslint/visitor-keys": "5.9.1",
+ "@typescript-eslint/eslint-plugin": "5.10.0",
+ "@typescript-eslint/parser": "5.10.0",
+ "@typescript-eslint/scope-manager": "5.10.0",
+ "@typescript-eslint/typescript-estree": "5.10.0",
+ "@typescript-eslint/visitor-keys": "5.10.0",
"eslint": "*",
"rollup": "^2.59.0",
"semver": "^7.3.5"
diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md
index 11395c4e0283..d912144e4fe9 100644
--- a/packages/website/CHANGELOG.md
+++ b/packages/website/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17)
+
+**Note:** Version bump only for package website
+
+
+
+
+
## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10)
**Note:** Version bump only for package website
diff --git a/packages/website/package.json b/packages/website/package.json
index 29102cd2871b..649cf34aece1 100644
--- a/packages/website/package.json
+++ b/packages/website/package.json
@@ -1,6 +1,6 @@
{
"name": "website",
- "version": "5.9.1",
+ "version": "5.10.0",
"private": true,
"scripts": {
"build": "docusaurus build",
@@ -21,7 +21,7 @@
"@docusaurus/theme-classic": "^2.0.0-beta.13",
"@docusaurus/theme-search-algolia": "^2.0.0-beta.13",
"@mdx-js/react": "1.6.22",
- "@typescript-eslint/website-eslint": "5.9.1",
+ "@typescript-eslint/website-eslint": "5.10.0",
"clsx": "^1.1.1",
"eslint": "*",
"json5": "^2.2.0",