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: Monorepo workspaces support #101

Open
3 tasks done
daniel-nagy opened this issue Nov 22, 2023 · 3 comments
Open
3 tasks done

🚀 Feature: Monorepo workspaces support #101

daniel-nagy opened this issue Nov 22, 2023 · 3 comments
Labels
status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :( type: feature New enhancement or request

Comments

@daniel-nagy
Copy link

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

This plugin is not working when using bun or yarn workspaces and importing a module from another package in the workspace that contains declaration files. I originally created a bug ticket for typescript-eslint and they were able to rule out any issues on their end. I created a repo to reproduce the issue.

Additional Info

No response

@daniel-nagy daniel-nagy added the type: feature New enhancement or request label Nov 22, 2023
@JoshuaKGoldberg JoshuaKGoldberg added the status: needs investigation Further research required...? label Dec 11, 2023
@JoshuaKGoldberg
Copy link
Owner

👋 sorry for the slow response @daniel-nagy! Thanks for filing both issues & creating a standalone repro, that's really helpful. 🙂

As for this reproduction: very interesting. A few notes:

  • Quick summary: this is purely using Yarn workspaces ("workspaces": ["packages/*"]), not any TSConfig paths or similar. b/package.json includes "dependencies": { "a": ... }.
  • Removing EXPERIMENTAL_useProjectService does not fix the error or change anything
  • The actual here is what includes const _copy: any:
    const qi = languageService.getQuickInfoAtPosition(
    sourceFile.fileName,
    node.getStart(),
    );
    if (!qi?.displayParts) {
    twoSlashFailureLines.push(
    sourceFile.getLineAndCharacterOfPosition(position).line,
    );
    continue;
    }
    const actual = qi.displayParts.map((dp) => dp.text).join("");

...I'd guess this is an issue with the created TS language service:

const languageService = ts.createLanguageService(
getLanguageServiceHost(program),
);

Accepting PRs!

@JoshuaKGoldberg JoshuaKGoldberg added type: bug Something isn't working :( status: accepting prs Please, send a pull request to resolve this! and removed status: needs investigation Further research required...? labels Dec 11, 2023
@JoshuaKGoldberg JoshuaKGoldberg changed the title 🚀 Feature: Monorepo Support 🚀 Feature: Monorepo workspaces support Dec 11, 2023
@JoshuaKGoldberg
Copy link
Owner

@all-contributors please add @daniel-nagy for bug.

🤖 Beep boop! This comment was added automatically by all-contributors-auto-action.
Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed.
...and of course, thank you for contributing! 💙

Copy link
Contributor

@JoshuaKGoldberg

I've put up a pull request to add @daniel-nagy! 🎉

I couldn't determine any contributions to add, did you specify any contributions?
Please make sure to use valid contribution names.

JoshuaKGoldberg pushed a commit that referenced this issue Dec 20, 2023
Adds @daniel-nagy as a contributor for bug.

This was requested by JoshuaKGoldberg [in this
comment](#101 (comment))

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
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: bug Something isn't working :( type: feature New enhancement or request
Projects
None yet
Development

No branches or pull requests

2 participants