Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TypeScript 5.6 Support #9653

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

Closed
bradzacher opened this issue Jul 28, 2024 · 29 comments · Fixed by #9972
Closed

TypeScript 5.6 Support #9653

bradzacher opened this issue Jul 28, 2024 · 29 comments · Fixed by #9972
Labels
dependencies Issue about dependencies of the package locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. New TypeScript Version

Comments

@bradzacher
Copy link
Member

bradzacher commented Jul 28, 2024

Edit(JoshuaKGoldberg): ✨ [email protected]


Edit(JoshuaKGoldberg): We're currently blocked on microsoft/rushstack#4919

We haven't had the bandwidth to investigate and try helping them fix it. If anyone is so motivated - fixing that would unblock us and allow us to support 5.6.


https://devblogs.microsoft.com/typescript/announcing-typescript-5-6-beta/

Please read through our TypeScript version policy: https://typescript-eslint.io/users/dependency-versions#typescript

This issue is just to track all of the new features and their implementation state in this project.
As with all releases, we will not necessarily to support all features until closer to the full release when everything the features are stabilised.

Please be patient.


🔗 Disallowed Nullish and Truthy Checks: #9973

Moved to issue #9973. This does not block supporting TypeScript 5.6.

As they mention in the post - this is essentially a weaker version of no-constant-binary-expression. There will be a lot of overlap between the rules.

Perhaps we should create an extension rule to remove the duplicates so users can have the rest of the rule without the duplicate reports?

🏗 Support for Arbitrary Module Identifiers: #9972

We will need to update our AST types as per the estree spec.

🏗 Search Ancestor Configuration Files for Project Ownership: #9972

Perhaps we should follow their logic and update our project: true logic?

🏗 lib.d.ts Updates: #9972

We will need to regenerate our types within scope-manager.

Other changes with no impact to us

  • Iterator Helper Methods
  • Strict Builtin Iterator Checks (and --strictBuiltinIteratorReturn)
  • The --noUncheckedSideEffectImports Option
  • The --noCheck Option
  • Allow --build with Intermediate Errors
  • Region-Prioritized Diagnostics in Editors
  • Notable Behavioral Changes
    • .tsbuildinfo is Always Written
    • Respecting File Extensions and package.json from within node_modules
    • Correct override Checks on Computed Properties
@bradzacher bradzacher added dependencies Issue about dependencies of the package New TypeScript Version labels Jul 28, 2024
@bradzacher bradzacher pinned this issue Jul 28, 2024
@Josh-Cena
Copy link
Member

Support for Arbitrary Module Identifiers

This changes ExportSpecifier#exported and ImportSpecifier#imported to be potentially string literals, I believe. And may require a change to the AST converter or even estree itself (if we require Identifier nodes to represent actual identifiers). I don't know for sure because ts-ast-viewer still gives a parser error on export { a as "a" };.

@bradzacher
Copy link
Member Author

@Josh-Cena you're not wrong! I'd just forgotten that we hadn't done that yet cos I'd remembered seeing it in the spec ages ago.

@auvred
Copy link
Member

auvred commented Sep 11, 2024

rakyi added a commit to owid/owid-grapher that referenced this issue Sep 20, 2024
I wanted to fix the warning we get when running ESlint after update to
TypeScript 5.6, but latest typescript-eslint still doesn't support it:
typescript-eslint/typescript-eslint#9653

So we at least got the other updates and related lint fixes.
rakyi added a commit to owid/owid-grapher that referenced this issue Sep 20, 2024
I wanted to fix the warning we get when running ESlint after update to
TypeScript 5.6, but latest typescript-eslint still doesn't support it:
typescript-eslint/typescript-eslint#9653

So we at least got the other updates and related lint fixes.
rakyi added a commit to owid/owid-grapher that referenced this issue Sep 20, 2024
I wanted to fix the warning we get when running ESlint after update to
TypeScript 5.6, but latest typescript-eslint still doesn't support it:
typescript-eslint/typescript-eslint#9653

So we at least got the other updates and related lint fixes.
rakyi added a commit to owid/owid-grapher that referenced this issue Sep 22, 2024
* Update ESlint plugins

I wanted to fix the warning we get when running ESlint after update to
TypeScript 5.6, but latest typescript-eslint still doesn't support it:
typescript-eslint/typescript-eslint#9653

So we at least got the other updates and related lint fixes.

* chore(deps): dedupe deps

---------

Co-authored-by: Marcel Gerber <[email protected]>
angelo-v added a commit to pod-os/PodOS that referenced this issue Sep 25, 2024
…est version supported by @typescript-eslint/typescript-estree

see also typescript-eslint/typescript-eslint#9653
@jclaveau
Copy link

jclaveau commented Sep 30, 2024

If ever it can help someone else : Using TS 5.6.2 made the onSave feature of VSCode's extension dbaeumer.vscode-eslint extremely slow (more than 10s) when it worked quite fast directly from bash

maxlath added a commit to inventaire/inventaire-client that referenced this issue Oct 3, 2024
This reverts commit 7359c0c.

to avoid typescript-eslint warning:

"""
WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=4.7.4 <5.6.0

YOUR TYPESCRIPT VERSION: 5.6.2

Please only submit bug reports when using the officially supported version.
"""

See typescript-eslint/typescript-eslint#9653
@danieleformichelli
Copy link

Hello @bradzacher 👋
Thanks a lot for your great work! 🙌
Is there any estimate on when we might get support for TypeScript 5.6? 🙏

@bradzacher
Copy link
Member Author

We're currently blocked on microsoft/rushstack#4919

We haven't had the bandwidth to investigate and try helping them fix it. If anyone is so motivated - fixing that would unblock us and allow us to support 5.6

@jakebailey
Copy link
Collaborator

I took a look and sent microsoft/rushstack#4973 to api-extractor, which I believe should unblock you if you pull the patch in locally (which you've had to do previously).

@josundt
Copy link

josundt commented Oct 17, 2024

If the rushstack api-extractor is no longer a blocker; will you release a new version with TypeScript 5.6 support soon?

@JoshuaKGoldberg
Copy link
Member

You bet 🙂 just merged the PR and should release soon. Will post back here as soon as we have something.

@JoshuaKGoldberg
Copy link
Member

[email protected]

@jfirebaugh
Copy link

Will there be any 7.x release with TypeScript 5.6 support, or will TypeScript 5.6+ require a typescript-eslint 8.x / eslint 9.x upgrade? (It's a non-trivial upgrade so we've been putting it off as long as possible.)

@Josh-Cena
Copy link
Member

We don't backport changes, so yes you should upgrade, or stay on the older one if it happens to still work.

@bradzacher
Copy link
Member Author

https://typescript-eslint.io/users/releases#back-porting-releases

We do not back port releases to previously released major/minor versions. We only ever release forward.

@bradzacher
Copy link
Member Author

will TypeScript 5.6+ require a typescript-eslint 8.x / eslint 9.x upgrade?

Note that v8 of our tooling DOES NOT require v9 of eslint. You can use v8.57.0 of eslint just fine.

So you need only update to v8 of our tooling. That is a major bump, but it shouldn't be too painful. Source: I did it at my company with a monorepo of 80k TS files and it only took an hour or two.

The hardest part was updating code around changes to no-unused-vars but even then there was only a few dozen to update.

@guillaumebrunerie
Copy link

will TypeScript 5.6+ require a typescript-eslint 8.x / eslint 9.x upgrade?

Note that v8 of our tooling DOES NOT require v9 of eslint. You can use v8.57.0 of eslint just fine.

Does typescript-eslint officially support ESLint v8, or is it just by chance that it still works? Because https://typescript-eslint.io/users/dependency-versions seems to suggest that it only supports ESLint v9, so maybe that should be clarified if v8 is still supported.

I can add that I've been using the latest version of typescript-eslint with ESLint v8.57.0 as well for a while now, and I didn't notice any issue.

@jfirebaugh
Copy link

jfirebaugh commented Oct 17, 2024

Note that v8 of our tooling DOES NOT require v9 of eslint. You can use v8.57.0 of eslint just fine.

As @guillaumebrunerie noted, this is contrary to https://typescript-eslint.io/users/dependency-versions/, which states:

The version range of ESLint currently supported is ^9.3.0.

This was what I was basing my comment on. If typescript-eslint actually still does support ESLint v8, that's great! The docs in that case should say ^8.57.0 || ^9.3.0 (or whatever the actual range is).

@JavaScriptBach
Copy link
Contributor

Will there be any 7.x release with TypeScript 5.6 support, or will TypeScript 5.6+ require a typescript-eslint 8.x / eslint 9.x upgrade? (It's a non-trivial upgrade so we've been putting it off as long as possible.)

One thing that you can consider is doing the upgrade but disabling the new rules added in the recommended configurations. This allows you to decouple the upgrade from the mass refactoring of turning on new lint rules. Upgrading to typescript-eslint v8 was not too much work in my company's mono-repo.

@bradzacher
Copy link
Member Author

"eslint": "^8.57.0 || ^9.0.0"

"eslint": "^8.57.0 || ^9.0.0"

It's officially supported. The docs are wrong there. This was the enitre point of our v7 release - to bump the minimum eslint version to 8.56.0 so that we could easily support v8 and v9 of eslint.

@bradzacher
Copy link
Member Author

The issue is that our docs are auto-generated via our root package.json version - so it's not truly correct and doesn't respect the real peer dependency.

<code>{packageJson.devDependencies.eslint}</code>.

@azat-io
Copy link
Contributor

azat-io commented Oct 17, 2024

Sorry if this question is stupid.

Is it works with arbitrary module identifiers?
https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/#support-for-arbitrary-module-identifiers

I created unit test:

    ruleTester.run(`${ruleName}(${type}): works with arbitrary names`, rule, {
      valid: [
        {
          code: dedent`
            import { "🍎" as apple, "🍌" as banana } from 'module';
          `,
          options: [
            {
              ...options,
              specialCharacters: 'remove',
            },
          ],
        },
      ],
      invalid: [
        {
          code: dedent`
            import { "🍌" as banana, "🍎" as apple } from 'module';
          `,
          output: dedent`
            import { "🍎" as apple, "🍌" as banana } from 'module';
          `,
          options: [options],
          errors: [
            {
              messageId: 'unexpectedNamedImportsOrder',
              data: {
                left: 'banana',
                right: 'apple',
              },
            },
          ],
        },
      ],
    })

But it seems specifier.imported comes with Identifier type, not StringLiteral type.

image

Copy link

Uh oh! @azat-io, the image you shared is missing helpful alt text. Check #9653 (comment).

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

@bradzacher
Copy link
Member Author

But it seems specifier.imported comes with Identifier type, not StringLiteral type

@azat-io it comes with both

export interface ImportSpecifier extends BaseNode {
type: AST_NODE_TYPES.ImportSpecifier;
imported: Identifier | StringLiteral;
importKind: ImportKind;
local: Identifier;
}

Your screenshot shows that because your first branch filters out Identifier?

@azat-io
Copy link
Contributor

azat-io commented Oct 18, 2024

@bradzacher Yes, but I've added the tests above.
And the line about the specified.imoprted StringLiteral type it doesn't cover. As if the type is always Identifier.

@bradzacher
Copy link
Member Author

playground

I can see it working fine in the playground.

@azat-io
Copy link
Contributor

azat-io commented Oct 18, 2024

Sorry, thank you!

@JoshuaKGoldberg
Copy link
Member

Btw, filed #10170 to fix the docs issue on what version of ESLint is supported.

@github-actions github-actions bot added the locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. label Oct 29, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2024
@bradzacher bradzacher unpinned this issue Nov 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Issue about dependencies of the package locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. New TypeScript Version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

14 participants