Skip to content

Update to TypeScript 5 #546

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

Open
alfaproject opened this issue May 24, 2023 · 3 comments
Open

Update to TypeScript 5 #546

alfaproject opened this issue May 24, 2023 · 3 comments

Comments

@alfaproject
Copy link

TypeScript 5 has been out for a while and TypeScript 5.1 is almost here, so we should update to latest if we can

One of the deprecations from TypeScript 4 is still not tackled and will actually error on TS5:

DeprecationWarning: 'isTypeAssertion' has been deprecated since v4.0.0. Use isTypeAssertionExpression instead.

@alfaproject
Copy link
Author

@ezze
Copy link

ezze commented Aug 2, 2023

I need to upgrade TypeScript to 5.1.x in my project but had no luck due to this.

/home/ezze/Development/sbercity-crm/frontend/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
src/__scripts__/zod/zod.ts:61:50 - error TS2345: Argument of type 'import("/home/ezze/Development/sbercity-crm/frontend/node_modules/typescript/lib/typescript").Program' is not assignable to parameter of type 'import("/home/ezze/Development/sbercity-crm/frontend/node_modules/typescript-json-schema/node_modules/typescript/lib/typescript").Program'.
  The types returned by 'getSourceFiles()' are incompatible between these types.
    Type 'readonly import("/home/ezze/Development/sbercity-crm/frontend/node_modules/typescript/lib/typescript").SourceFile[]' is not assignable to type 'readonly import("/home/ezze/Development/sbercity-crm/frontend/node_modules/typescript-json-schema/node_modules/typescript/lib/typescript").SourceFile[]'.
      Type 'import("/home/ezze/Development/sbercity-crm/frontend/node_modules/typescript/lib/typescript").SourceFile' is not assignable to type 'import("/home/ezze/Development/sbercity-crm/frontend/node_modules/typescript-json-schema/node_modules/typescript/lib/typescript").SourceFile'.
        Types of property 'kind' are incompatible.
          Type 'import("/home/ezze/Development/sbercity-crm/frontend/node_modules/typescript/lib/typescript").SyntaxKind.SourceFile' is not assignable to type 'import("/home/ezze/Development/sbercity-crm/frontend/node_modules/typescript-json-schema/node_modules/typescript/lib/typescript").SyntaxKind.SourceFile'.

61       const jsonSchemaGenerator = buildGenerator(tjsProgram, { required: true });
                                                    ~~~~~~~~~~

@chriskrogh
Copy link

#564 was merged recently. @domoritz do you know when the next release will be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants