From 1fb8319366e0d6bb463c3e2d0d1648bbfdbcfb78 Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Fri, 21 Jul 2023 13:39:49 -0400 Subject: [PATCH 1/9] fix: blog typo --- .../2023-07-09-announcing-typescript-eslint-v6.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md index e79664a5874..f69e7aa6d2b 100644 --- a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md +++ b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md @@ -619,7 +619,7 @@ For more information, see: ### Package Exports -The v5 `@typescript-eslint/` packages don't use [Node.js package.json exports](https://nodejs.org/api/packages.html#package-entry-points), so anyone can import any file in any package by directly referencing a path within the dist folder. +The v5 `@typescript-eslint/` packages don't use [Node.js package.json exports](https://nodejs.org/api/packages.html#package-entry-points), which allows someone to import any file in any package by directly referencing a path within the `dist` directory. For example: ```ts @@ -628,19 +628,21 @@ import * as TSESLint from '@typescript-eslint/utils/dist/ts-eslint'; That presents a few issues for developers: -- It can be unclear which of many potential import paths to use -- TypeScript sometimes suggests importing types or values meant to be private -- Consumers using deep import paths can be broken by internal refactors that rename files +- It can be unclear which of many potential import paths to use. +- TypeScript sometimes suggests importing types or values meant to be private. +- Consumers using deep import paths might get broken code after internal refactors rename files. As of [feat: add package.json exports for public packages](https://github.com/typescript-eslint/typescript-eslint/pull/6458), `@typescript-eslint/*` packages now use `exports` to prevent importing internal file paths. -Developers must now mostly import directly from the package names, e.g.: +Developers must now mostly import directly from the package names. For example, to fix the code from the previous example, you would use the following: ```ts -import * as TSESLint from '@typescript-eslint/ts-eslint'; +import * as TSESLint from '@typescript-eslint/utils'; ``` See [RFC: Use package.json exports to "hide" the dist folder for packages and control our exported surface-area](https://github.com/typescript-eslint/typescript-eslint/discussions/6015) for more backing context. +Note that if you update your imports and you still get an error from TypeScript saying "Cannot find module '@typescript-eslint/utils' or its corresponding type declarations", then you might need to change the value of `moduleResolution` to `node16` in your TypeScript config, as detailed in [this issue](https://github.com/typescript-eslint/typescript-eslint/issues/7279). + ### Other Developer-Facing Breaking Changes - [feat(utils): remove (ts-)eslint-scope types](https://github.com/typescript-eslint/typescript-eslint/pull/5256): Removes no-longer-useful `TSESLintScope` types from the `@typescript-eslint/utils` package. Use `@typescript-eslint/scope-manager` directly instead. From 40dd58c23c03e6e6f1b1e592e7df76627cd6d247 Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Fri, 21 Jul 2023 14:15:24 -0400 Subject: [PATCH 2/9] Update packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Josh Goldberg ✨ --- .../blog/2023-07-09-announcing-typescript-eslint-v6.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md index f69e7aa6d2b..b67f9a93d68 100644 --- a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md +++ b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md @@ -641,7 +641,9 @@ import * as TSESLint from '@typescript-eslint/utils'; See [RFC: Use package.json exports to "hide" the dist folder for packages and control our exported surface-area](https://github.com/typescript-eslint/typescript-eslint/discussions/6015) for more backing context. -Note that if you update your imports and you still get an error from TypeScript saying "Cannot find module '@typescript-eslint/utils' or its corresponding type declarations", then you might need to change the value of `moduleResolution` to `node16` in your TypeScript config, as detailed in [this issue](https://github.com/typescript-eslint/typescript-eslint/issues/7279). +:::note +If you update your imports and you still get an error from TypeScript saying _`"Cannot find module '@typescript-eslint/...' or its corresponding type declarations"`_, then you might need to change the value of `moduleResolution` in your TypeScript config. See [this tracking issue for `package.json` exports types](https://github.com/typescript-eslint/typescript-eslint/issues/7284). +::: ### Other Developer-Facing Breaking Changes From 7a7b78d8ca411169610ee4c3dcd3f24465750e2f Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Tue, 25 Jul 2023 16:16:54 -0400 Subject: [PATCH 3/9] Update packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Josh Goldberg ✨ --- .../website/blog/2023-07-09-announcing-typescript-eslint-v6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md index b67f9a93d68..ebea7c87894 100644 --- a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md +++ b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md @@ -619,7 +619,7 @@ For more information, see: ### Package Exports -The v5 `@typescript-eslint/` packages don't use [Node.js package.json exports](https://nodejs.org/api/packages.html#package-entry-points), which allows someone to import any file in any package by directly referencing a path within the `dist` directory. +The v5 `@typescript-eslint/*` packages don't use [Node.js package.json exports](https://nodejs.org/api/packages.html#package-entry-points), which allows importing any file in any package by directly referencing a path within the package's `dist/` directory. For example: ```ts From 72ebf533b7b5052b4e2691375796ec30f93bea78 Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Tue, 25 Jul 2023 16:19:06 -0400 Subject: [PATCH 4/9] Update 2023-07-09-announcing-typescript-eslint-v6.md --- .../website/blog/2023-07-09-announcing-typescript-eslint-v6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md index ebea7c87894..87c1bd4619a 100644 --- a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md +++ b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md @@ -630,7 +630,7 @@ That presents a few issues for developers: - It can be unclear which of many potential import paths to use. - TypeScript sometimes suggests importing types or values meant to be private. -- Consumers using deep import paths might get broken code after internal refactors rename files. +- Consumers using deep import paths can be broken by internal refactors that rename files. As of [feat: add package.json exports for public packages](https://github.com/typescript-eslint/typescript-eslint/pull/6458), `@typescript-eslint/*` packages now use `exports` to prevent importing internal file paths. Developers must now mostly import directly from the package names. For example, to fix the code from the previous example, you would use the following: From 9bd6f5492f5ad5c6b79c6f72c63715913d616f63 Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Tue, 25 Jul 2023 16:21:00 -0400 Subject: [PATCH 5/9] Update 2023-07-09-announcing-typescript-eslint-v6.md --- .../website/blog/2023-07-09-announcing-typescript-eslint-v6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md index 87c1bd4619a..6054595c7b2 100644 --- a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md +++ b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md @@ -633,7 +633,7 @@ That presents a few issues for developers: - Consumers using deep import paths can be broken by internal refactors that rename files. As of [feat: add package.json exports for public packages](https://github.com/typescript-eslint/typescript-eslint/pull/6458), `@typescript-eslint/*` packages now use `exports` to prevent importing internal file paths. -Developers must now mostly import directly from the package names. For example, to fix the code from the previous example, you would use the following: +Developers must now import directly from the package names. e.g.: ```ts import * as TSESLint from '@typescript-eslint/utils'; From 9d9e4bf81f0d7c515eea6e179db7d8c975971ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Wed, 26 Jul 2023 07:51:53 -0500 Subject: [PATCH 6/9] Update packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md --- .../website/blog/2023-07-09-announcing-typescript-eslint-v6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md index 6054595c7b2..45582ed6e77 100644 --- a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md +++ b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md @@ -633,7 +633,7 @@ That presents a few issues for developers: - Consumers using deep import paths can be broken by internal refactors that rename files. As of [feat: add package.json exports for public packages](https://github.com/typescript-eslint/typescript-eslint/pull/6458), `@typescript-eslint/*` packages now use `exports` to prevent importing internal file paths. -Developers must now import directly from the package names. e.g.: +Developers must now mostly import directly from the package names, e.g.: ```ts import * as TSESLint from '@typescript-eslint/utils'; From 5ad1243faa20aac25dd9fb21932fee4927856486 Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Fri, 28 Jul 2023 17:34:07 -0400 Subject: [PATCH 7/9] fix: yarn version not specified --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e93d904d0d6..8c58d5de7d2 100644 --- a/package.json +++ b/package.json @@ -144,5 +144,6 @@ "pretty-format": "^29", "tsx": "^3.12.7", "typescript": "5.1.6" - } + }, + "packageManager": "yarn@1.22.19" } From ee3164bc75af037be8b0225f73f1281fcfc676be Mon Sep 17 00:00:00 2001 From: James <5511220+Zamiell@users.noreply.github.com> Date: Fri, 28 Jul 2023 17:36:03 -0400 Subject: [PATCH 8/9] Update 2023-07-09-announcing-typescript-eslint-v6.md --- ...2023-07-09-announcing-typescript-eslint-v6.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md index 7d0ad7bc3c3..8f34626fe7e 100644 --- a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md +++ b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md @@ -63,7 +63,7 @@ As a result, we've reworked the configurations provided by typescript-eslint int - Functional rule configurations, for best best practices and code correctness: - **`recommended`**: Recommended rules that you can drop in without additional configuration. - - **`recommended-type-checked`**: Additional recommended rules that require type information. + - **`recommended-type-checked`**: Additional recommended rules that require type information. - **`strict`**: Additional strict rules that can also catch bugs but are more opinionated than recommended rules _(without type information)_. - **`strict-type-checked`**: Additional strict rules that do require type information. - Stylistic rule configurations, for consistent and predictable syntax usage: @@ -620,7 +620,7 @@ For more information, see: ### Package Exports -The v5 `@typescript-eslint/*` packages don't use [Node.js package.json exports](https://nodejs.org/api/packages.html#package-entry-points), which allows importing any file in any package by directly referencing a path within the package's `dist/` directory. +The v5 `@typescript-eslint/` packages don't use [Node.js package.json exports](https://nodejs.org/api/packages.html#package-entry-points), so anyone can import any file in any package by directly referencing a path within the dist folder. For example: ```ts @@ -629,23 +629,19 @@ import * as TSESLint from '@typescript-eslint/utils/dist/ts-eslint'; That presents a few issues for developers: -- It can be unclear which of many potential import paths to use. -- TypeScript sometimes suggests importing types or values meant to be private. -- Consumers using deep import paths can be broken by internal refactors that rename files. +- It can be unclear which of many potential import paths to use +- TypeScript sometimes suggests importing types or values meant to be private +- Consumers using deep import paths can be broken by internal refactors that rename files As of [feat: add package.json exports for public packages](https://github.com/typescript-eslint/typescript-eslint/pull/6458), `@typescript-eslint/*` packages now use `exports` to prevent importing internal file paths. Developers must now mostly import directly from the package names, e.g.: ```ts -import * as TSESLint from '@typescript-eslint/utils'; +import * as TSESLint from '@typescript-eslint/utils/ts-eslint'; ``` See [RFC: Use package.json exports to "hide" the dist folder for packages and control our exported surface-area](https://github.com/typescript-eslint/typescript-eslint/discussions/6015) for more backing context. -:::note -If you update your imports and you still get an error from TypeScript saying _`"Cannot find module '@typescript-eslint/...' or its corresponding type declarations"`_, then you might need to change the value of `moduleResolution` in your TypeScript config. See [this tracking issue for `package.json` exports types](https://github.com/typescript-eslint/typescript-eslint/issues/7284). -::: - ### Other Developer-Facing Breaking Changes - [feat(utils): remove (ts-)eslint-scope types](https://github.com/typescript-eslint/typescript-eslint/pull/5256): Removes no-longer-useful `TSESLintScope` types from the `@typescript-eslint/utils` package. Use `@typescript-eslint/scope-manager` directly instead. From b678ef209de437c6a1275188de5eb3b3e011ff4d Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 30 Jul 2023 22:43:21 -0400 Subject: [PATCH 9/9] reset v6.md to main --- .../website/blog/2023-07-09-announcing-typescript-eslint-v6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md index 8f34626fe7e..c4a5d6b7d3b 100644 --- a/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md +++ b/packages/website/blog/2023-07-09-announcing-typescript-eslint-v6.md @@ -63,7 +63,7 @@ As a result, we've reworked the configurations provided by typescript-eslint int - Functional rule configurations, for best best practices and code correctness: - **`recommended`**: Recommended rules that you can drop in without additional configuration. - - **`recommended-type-checked`**: Additional recommended rules that require type information. + - **`recommended-type-checked`**: Additional recommended rules that require type information. - **`strict`**: Additional strict rules that can also catch bugs but are more opinionated than recommended rules _(without type information)_. - **`strict-type-checked`**: Additional strict rules that do require type information. - Stylistic rule configurations, for consistent and predictable syntax usage: