Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add v8 beta blog post #9022

Merged
merged 28 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fd825f1
docs: add v8 beta blog post
JoshuaKGoldberg Apr 28, 2024
22c443f
Mention custom meta.docs
JoshuaKGoldberg Apr 29, 2024
1541914
Apply suggestions from code review
JoshuaKGoldberg May 1, 2024
801b40f
Update packages/website/blog/2024-04-30-announcing-typescript-eslint-…
JoshuaKGoldberg May 8, 2024
8bb1bcc
hyphens
JoshuaKGoldberg May 8, 2024
6fb1d1b
Clarifying project service
JoshuaKGoldberg May 8, 2024
c2b62d5
Added a bit more info to tooling breaking changes
JoshuaKGoldberg May 8, 2024
e2dd27c
configurationsg
JoshuaKGoldberg May 8, 2024
13550bc
Actions for breaking changes
JoshuaKGoldberg May 12, 2024
8c66d32
More actions for breaking changes
JoshuaKGoldberg May 12, 2024
e57849c
Update date to the 11th
JoshuaKGoldberg May 12, 2024
08f133b
Use v8-- link for no-empty-object-type
JoshuaKGoldberg May 12, 2024
3e07598
Remove ban-types hourglass
JoshuaKGoldberg May 12, 2024
d939cf0
lil ban-types typo
JoshuaKGoldberg May 12, 2024
cd1fd00
Merge branch 'main' into v8-beta-post
JoshuaKGoldberg May 12, 2024
461e8b0
Remove ESLint v9 hourglass
JoshuaKGoldberg May 12, 2024
57280cc
Apply suggestions from code review
JoshuaKGoldberg May 12, 2024
e3ab88f
Couple more review touchups
JoshuaKGoldberg May 13, 2024
227c9d7
Remove hourglass for multipass fixes
JoshuaKGoldberg May 16, 2024
31ea9ec
Apply suggestions from code review
JoshuaKGoldberg May 24, 2024
d4cbffc
Missing 'this'
JoshuaKGoldberg May 24, 2024
af8fa1f
Push date to the 27th
JoshuaKGoldberg May 24, 2024
df2dcb0
Update packages/website/blog/2024-05-27-announcing-typescript-eslint-…
JoshuaKGoldberg May 24, 2024
de2f8bd
Stabilized project service
JoshuaKGoldberg May 24, 2024
9b1ab46
lil phrasing nit
JoshuaKGoldberg May 24, 2024
a98f3a3
Final proofreading
JoshuaKGoldberg May 24, 2024
029b91c
Update appreciation list
JoshuaKGoldberg May 24, 2024
054a0f1
Update packages/website/blog/2024-05-27-announcing-typescript-eslint-…
JoshuaKGoldberg May 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"lzstring",
"markdownlint",
"metastring",
"multipass",
"necroing",
"nocheck",
"noninteractive",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,6 @@ Thanks Joshua! 🤗

## Supporting typescript-eslint

If you enjoyed this blog post and/or or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint).
If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint).
bradzacher marked this conversation as resolved.
Show resolved Hide resolved
We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great.
Thanks! 💖
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,6 @@ See [our Getting Started docs](/getting-started) for more information on linting

## Supporting typescript-eslint

If you enjoyed this blog post and/or or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint).
If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint).
We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great.
Thanks! 💖
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,6 @@ See the [v6.0.0 milestone](https://github.com/typescript-eslint/typescript-eslin

## Supporting typescript-eslint

If you enjoyed this blog post and/or or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint).
If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint).
We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great.
Thanks! 💖
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,6 @@ See the [v6.0.0 milestone](https://github.com/typescript-eslint/typescript-eslin

## Supporting typescript-eslint

If you enjoyed this blog post and/or or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint).
If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint).
We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great.
Thanks! 💖
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
---
authors:
- image_url: https://www.joshuakgoldberg.com/img/josh.jpg
name: Josh Goldberg
title: typescript-eslint Maintainer
url: https://github.com/JoshuaKGoldberg
description: Announcing the release of typescript-eslint's v8 beta, including its changes and timeline.
slug: announcing-typescript-eslint-v8-beta
tags: [breaking changes, typescript-eslint, v7, v8]
title: Announcing typescript-eslint v8 Beta
---

[typescript-eslint](https://typescript-eslint.io) is the tooling that enables standard JavaScript tools such as [ESLint](https://eslint.org) and [Prettier](https://prettier.io) to support TypeScript code.
We've been working on a set of breaking changes and general features that we're excited to get in front of users soon.
And now, we're excited to say that typescript-eslint v8 is ready for public beta testing! 🎉

Our plan for typescript-eslint v8 is to:

1. Have users try out betas starting in May of 2024
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
2. Respond to user feedback for the next ~1-2 months
3. Release a stable version summer of 2024

Nothing mentioned in this blog post is set in stone.
If you feel passionately about any of the choices we've made here -positively or negatively- then do let us know on [the typescript-eslint Discord](https://discord.gg/FSxKq8Tdyg)'s `#v8` channel!
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved

<!--truncate-->

## Trying Out v8

Please do try out the typescript-eslint v8 beta!

### As A New User

If you don't yet use typescript-eslint, you can go through our [configuration steps on the v8 _Getting Started_ docs](https://v8--typescript-eslint.netlify.app/getting-started).
It'll walk you through setting up typescript-eslint in a project.

To use v8 specifically, see the following section for an updated install command.

### As An Existing User

If you already use typescript-eslint, you'll need to first replace your package's previous versions of `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser` with `@rc-v8` versions:

```shell
npm i @typescript-eslint/eslint-plugin@rc-v8 @typescript-eslint/parser@rc-v8 --save-dev
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
```

We highly recommend then basing your ESLint configuration on the reworked typescript-eslint [recommended configurations mentioned later in this post](#reworked-configuration-names) — especially if it's been a while since you've reworked your linter config.

## User-Facing Changes

These are the changes that users of typescript-eslint -generally, any developer running ESLint on TypeScript code- should pay attention to when upgrading typescript-eslint from v7 to v8.
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved

> ⏳ indicates a change that has been scheduled for v8 but not yet released.
> We'll update this blog post as the corresponding pull requests land.

### ⏳ ESLint v9 Support
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved

typescript-eslint v8 ships will full support for ESLint v9.
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved

typescript-eslint v7 was our first version that supported ESLint's [new "flat" config file format](https://eslint.org/docs/latest/use/configure/configuration-files), which was already available in ESLint v8.
ESLint v9 still supports ESLint's [older legacy config file format](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated) so our tooling does as well.
However, ESLint v9 also includes a set of breaking changes that we added support for in typescript-eslint v8.
See the [ESLint v9 release blog post](https://eslint.org/blog/2024/04/eslint-v9.0.0-released) and for more details.

### ⏳ Project Service
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved

The biggest new feature added in this version is the stability of our new "project service".
In short, the project service is a new way to enable [typed linting](/getting-started/typed-linting) that is generally _easier to configure_ and _faster at runtime_ than our previous offerings.
It's been experimentally available since v6.1.0 under the name `EXPERIMENTAL_useProjectService`; now, we've renamed it to `projectService`.

You can use the new project service in your configuration instead of the previous `parserOptions.project`:

```js title="eslint.config.js"
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
// Remove this line
project: true,
// Add this line
projectService: true,
tsconfigRootDir: import.meta.dirname,
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
},
},
},
);
```

The project service will automatically find the closest `tsconfig.json` for each file (like `project: true`).
It also allows enabling typed linting for files not explicitly included in a `tsconfig.json`.
This should remove the need for custom `tsconfig.eslint.json` files to lint files like `eslint.config.js`!
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved

```js title="eslint.config.js"
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
// Remove this line
project: ['packages/*/tsconfig.json', 'tsconfig.eslint.json'],
// Add this line
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
projectService: {
allowDefaultProjectForFiles: ['./*.js'],
defaultProject: './tsconfig.json',
},
tsconfigRootDir: import.meta.dirname,
},
},
},
);
```

Internally, the project service uses the same TypeScript APIs that editors such as VS Code use.
Doing so should make it harder to accidentally configure different type information for ESLint than what you see in day-to-day editing.

We're thrilled to have this option promoted to stable in v8.
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
We'll soon release a [dedicated `parserOptions` blog post](https://github.com/typescript-eslint/typescript-eslint/pull/8031) walking through the new option in more details.

### Updated Configuration Rules

Every new major version of typescript-eslint comes with changes to which rules are enabled in the preset configurations - and with which options.
Because this release also includes a reworking of the configurations themselves, the list of changes is too large to put in this blog post.
Instead see the table in [Changes to configurations for 8.0.0](https://github.com/typescript-eslint/typescript-eslint/discussions/8914) for a full list of the changes.

Please do try out the new rule configurations presets and let us know in that discussion!

:::tip
If your ESLint configuration contains many `rules` configurations, we suggest the following strategy to start anew:
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved

1. Remove all your rules configurations
2. Extend from the preset configs that make sense for you
3. Run ESLint on your project
4. In your ESLint configuration, turn off any rules creating errors that don't make sense for your project - with comments explaining why
5. In your ESLint configuration and/or with inline `eslint-disable` comments, turn off any rules creating too many errors for you to fix - with _"TODO"_ comments linking to tracking issues/tickets to re-enable them

:::

### Rule Breaking Changes

Several rules were changed in significant enough ways to be considered breaking changes:

- ⏳ [Rules: Deprecate prefer-ts-expect-error in favor of ban-ts-comment](https://github.com/typescript-eslint/typescript-eslint/issues/8333)
- ⏳ [chore(eslint-plugin): deprecate no-var-requires in favor of no-require-imports](https://github.com/typescript-eslint/typescript-eslint/pull/8334)
- [feat(eslint-plugin): deprecate no-throw-literal and add a renamed only-throw-error](https://github.com/typescript-eslint/typescript-eslint/pull/8701)
- ⏳ [fix(eslint-plugin): [no-useless-template-literals] rename to no-useless-template-expression](https://github.com/typescript-eslint/typescript-eslint/pull/8821)
- [feat(eslint-plugin): deprecate no-loss-of-precision extension rule](https://github.com/typescript-eslint/typescript-eslint/pull/8832)
- [feat(eslint-plugin): remove formatting/layout rules](https://github.com/typescript-eslint/typescript-eslint/pull/8833)
- [feat(eslint-plugin): [prefer-nullish-coalescing] change ignoreConditionalTests default to true](https://github.com/typescript-eslint/typescript-eslint/pull/8872)
- [feat(eslint-plugin): [no-unused-vars] align catch behavior to ESLint 9](https://github.com/typescript-eslint/typescript-eslint/pull/8971)
- ⏳ [feat(eslint-plugin): split no-empty-object-type rule out from ban-types rule](https://github.com/typescript-eslint/typescript-eslint/pull/8977)

### Tooling Breaking Changes

- ⏳ [Enhancement: Error if configuration options aren't provided as expected](https://github.com/typescript-eslint/typescript-eslint/issues/6403)
- [fix(typescript-estree): enable dot globs for project by default](https://github.com/typescript-eslint/typescript-eslint/pull/8818)
- [feat(typescript-estree): remove slow deprecated and isolated programs](https://github.com/typescript-eslint/typescript-eslint/pull/8834)
- [feat(typescript-estree): rename automaticSingleRunInference to disallowAutomaticSingleRunInference](https://github.com/typescript-eslint/typescript-eslint/pull/8922)
- [chore: bump minimum versions for v8](https://github.com/typescript-eslint/typescript-eslint/pull/8973)
- ESLint support range was changed from `^8.56.0` to `^8.57.0`
- Node.js support range was changed from `^18.18.0 || >=20.0.0` to `^18.18.0 || ^20.9.0 || >=21.1.0`
- TypeScript support range was changed from `>=4.7.4 <5.5.0` to `>=4.8.4 <5.5.0`
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved

## Developer-Facing Changes

typescript-eslint v6 comes with a suite of cleanups and improvements for developers as well.
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
If you author any ESLint plugins or other tools that interact with TypeScript syntax, then we recommend you try out typescript-eslint v6 soon.
JoshuaKGoldberg marked this conversation as resolved.
Show resolved Hide resolved
It includes some breaking changes that you may need to accommodate for.

:::tip
If you're having trouble working with the changes, please let us know on [the typescript-eslint Discord](https://discord.gg/FSxKq8Tdyg)'s `#v8` channel!
:::

### AST Breaking Changes

These PRs changed the AST shapes generated by typescript-eslint when parsing code.
If you author any ESLint rules that refer to the syntax mentioned by them, these are relevant to you.

- ⏳ [Enhancement: add strict parent types for nodes that have well-defined parents](https://github.com/typescript-eslint/typescript-eslint/issues/6225)
- [feat(typescript-estree): split TSMappedType typeParameter into constraint and key](https://github.com/typescript-eslint/typescript-eslint/pull/7065)
- ⏳ [feat(ast-spec): remove deprecated type params](https://github.com/typescript-eslint/typescript-eslint/pull/8933)

### Other Developer-Facing Breaking Changes

- ⏳ [Repo: Rule [options] parameter should be non-nullable if defaultOptions exists](https://github.com/typescript-eslint/typescript-eslint/issues/5439)
- [feat(parser): always enable comment, loc, range, tokens](https://github.com/typescript-eslint/typescript-eslint/pull/8617)
- ⏳ [feat(rule-tester): support multipass fixes](https://github.com/typescript-eslint/typescript-eslint/pull/8883)
- [chore(type-utils)!: remove IsNullableTypeOptions interface](https://github.com/typescript-eslint/typescript-eslint/pull/8934)
- [feat(utils): swap LegacyESLint out for FlatESLint as ESLint export](https://github.com/typescript-eslint/typescript-eslint/pull/8972)
- [chore(type-utils): remove getTypeArguments](https://github.com/typescript-eslint/typescript-eslint/pull/8938)
- ⏳ [feat(utils): remove deprecated context helpers](https://github.com/typescript-eslint/typescript-eslint/pull/9000)

## Appreciation

We'd like to extend a sincere _thank you_ to everybody who pitched in to make typescript-eslint v8 possible.

- Ourselves on the maintenance team:
- [Auvred](https://github.com/auvred)
- [Armano](https://github.com/armano2)
- [Brad Zacher](https://github.com/bradzacher)
- [James Henry](https://github.com/JamesHenry)
- [Josh Goldberg](https://github.com/JoshuaKGoldberg)
- [Joshua Chen](https://github.com/Josh-Cena)
- [Kirk Waiblinger](https://github.com/kirkwaiblinger)
- Community contributors whose PRs were merged into the 8.0.0 release:
<!-- cspell:disable -->
- [Thomas Huchedé](https://github.com/thuchede)
- [Yukihiro Hasegawa](https://github.com/y-hsgw)
- _(more to come as PRs are merged)_
<!-- cspell:enable -->

See the [v8.0.0 milestone](https://github.com/typescript-eslint/typescript-eslint/milestone/9) for the list of issues and associated merged pull requests.

## Supporting typescript-eslint

If you enjoyed this blog post and/or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint).
We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great.
Thanks! 💖