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

Support TypeScript 4.9 satisfies operator #42

Closed
karlhorky opened this issue Nov 21, 2022 · 4 comments
Closed

Support TypeScript 4.9 satisfies operator #42

karlhorky opened this issue Nov 21, 2022 · 4 comments

Comments

@karlhorky
Copy link

karlhorky commented Nov 21, 2022

Hi @lukeed 👋 Hope you are well.

It would be great to be able to use the TypeScript 4.9 satisfies operator!

However, currently, tsm throws an error when using satisfies:

import {AType} from '../a';

const a = 'abc' satisfies AType; // 💥 Expected ";" but found "satisfies"

Full error:

Error: R] Expected ";" but found "satisfies"

    /home/runner/work/courses/courses/packages/database/scripts/databaseFixtures/courseModules.ts:879:11:
      879 │ ] as const satisfies readonly CourseModule[];
          │            ~~~~~~~~~
          ╵            ;

/home/runner/work/courses/courses/node_modules/tsm/node_modules/esbuild/lib/main.js:1605
  let error = new Error(`${text}${summary}`);
              ^

This is supported in esbuild@^0.15.13


Workaround

Use Yarn/pnpm Resolutions (or npm Overrides) to force the version in package.json:

{
  "resolutions": {
    "**/tsm/esbuild": "0.15.14"
  }
}
@karlhorky
Copy link
Author

Upgrading to a new esbuild version may also resolve #31

@lukeed lukeed closed this as completed in 2d406ef Nov 27, 2022
@karlhorky
Copy link
Author

Thanks for 2d406ef @lukeed ! Will this be released in tsm@2.2.3?

@lukeed
Copy link
Owner

lukeed commented Nov 27, 2022

2.3.0 by eod

@karlhorky
Copy link
Author

Nice, tsm@2.3.0 is working, thanks! 🙌

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

2 participants