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

🚀 Feature: Allow specifying multiple TS versions (node_modules/typescript paths) #107

Open
3 tasks done
JoshuaKGoldberg opened this issue Dec 11, 2023 · 3 comments · May be fixed by #123
Open
3 tasks done

🚀 Feature: Allow specifying multiple TS versions (node_modules/typescript paths) #107

JoshuaKGoldberg opened this issue Dec 11, 2023 · 3 comments · May be fixed by #123
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request

Comments

@JoshuaKGoldberg
Copy link
Owner

JoshuaKGoldberg commented Dec 11, 2023

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Porting over from microsoft/DefinitelyTyped-tools#858: @definitelytyped/expect has the ability to receive a versionsToTest option. That option contains an array of TS versions with paths to the node_modules. The plugin then runs roughly:

for (const version of versionsToTest) {
  const ts = require(version.path) as TSModule;
  const program = getProgram(tsconfigPath, ts, version.versionName, parserServices.program);

Let's port that feature over to eslint-plugin-expect-type. I think it can exist roughly as-is. Maybe some bikeshedding on the option name?

Additional Info

Edit: This would support react-native-community/discussions-and-proposals#719 (comment) too.

Edit: ...and microsoft/DefinitelyTyped-tools#440

@jakebailey
Copy link

Related: microsoft/DefinitelyTyped-tools#848

I'm not sure how much I like to have an API that accepts a path to require, however, doing this opens the door to us moving the copies somewhere else which is pretty helpful.

@JoshuaKGoldberg JoshuaKGoldberg linked a pull request Dec 21, 2023 that will close this issue
3 tasks
@nateshmbhat
Copy link

any update on this ?

@JoshuaKGoldberg
Copy link
Owner Author

@nateshmbhat no, if there's an update you'll see it in this issue. I haven't had time to work on #123 this year yet. Since you're interested, feel free to send your own PR that builds on #123 to resolve the issue. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants