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

fix: update getLib for new TypeScript targets ES2021, ES2022 #6782

Merged
merged 1 commit into from Apr 8, 2023

Conversation

andersk
Copy link
Contributor

@andersk andersk commented Mar 27, 2023

PR Checklist

Overview

Support for the es2021.full and es2022.full libs was added in #3460 and #4615, but the getLib function wasn’t updated to use them; if target is set to "ES2021" or "ES2022" in tsconfig.json, getLib would incorrectly fall back to ['lib'] rather than ['es2021.full'] or ['es2022.full']. Add these missing cases.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @andersk!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@netlify
Copy link

netlify bot commented Mar 27, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 2aeee90
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6422185fefac7d000775261b
😎 Deploy Preview https://deploy-preview-6782--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@andersk andersk changed the title parser: Update getLib for new TypeScript targets ES2021, ES2022 fix: Update getLib for new TypeScript targets ES2021, ES2022 Mar 27, 2023
@andersk andersk changed the title fix: Update getLib for new TypeScript targets ES2021, ES2022 fix: update getLib for new TypeScript targets ES2021, ES2022 Mar 27, 2023
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find, thanks @andersk!

Out of curiosity - how did you notice this? 😄

@JoshuaKGoldberg JoshuaKGoldberg merged commit 1c04664 into typescript-eslint:main Apr 8, 2023
38 of 42 checks passed
@andersk
Copy link
Contributor Author

andersk commented Apr 9, 2023

I found this in zulip/zulip#24875 where the no-undef rule started complaining about more globals when we switched the TypeScript target from ES2020 to ES2022. (I know you don’t recommend no-undef with typescript-eslint, but we want to prohibit some globals like jQuery that TypeScript thinks are globally available but we want to be explicit about importing.)

@andersk andersk deleted the getLib-targets branch April 9, 2023 23:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants