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

[api-extractor] pass compilerOptions into getModeForUsageLocation to fix TS 5.6 #4973

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

jakebailey
Copy link
Member

Summary

Fixes #4919

Details

getModeForUsageLocation has required compiler options for a while, but this was hidden by an as any. Passing in the compiler options prevents the crash.

How it was tested

I made the same change in node_modules for typescript-eslint, and api-extractor no longer crashed.

It's not clear to me how to test this otherwise without also upgrading the repo to TS 5.6.

Impacted documentation

None.

@D4N14L D4N14L merged commit 681f718 into microsoft:main Oct 14, 2024
4 checks passed
@jakebailey jakebailey deleted the fix-5.6 branch October 14, 2024 20:37
@jakebailey
Copy link
Member Author

Thanks for merging this!

@octogonz
Copy link
Collaborator

octogonz commented Nov 8, 2024

@jakebailey just curious - is your toolchain somehow bypassing the hardwired version of TypeScript that is bundled with API Extractor?

@jakebailey
Copy link
Member Author

Bundled with TypeScript? Do you mean the explicit version listed in package.json? Yes, typescript-eslint overrides that via an override: https://github.com/typescript-eslint/typescript-eslint/blob/124b65dc821ae69ef033bdda39fe997687cbf225/package.json#L149. ts-eslint builds on TS's API and needs to work with the latest, not an outdated version.

It'd be nice if api-extractor updated its version, or had a version range it supported (and then tested against TS nightly to find breaks like this...)

(To be clear, it's not my toolchain...)

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

Successfully merging this pull request may close these issues.

[api-extractor] building with TS 5.6.2 causes error on wildcard import
3 participants