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

vscode-standard can't find ts-standard module in monorepo #327

Open
eettaa opened this issue Nov 20, 2021 · 2 comments
Open

vscode-standard can't find ts-standard module in monorepo #327

eettaa opened this issue Nov 20, 2021 · 2 comments

Comments

@eettaa
Copy link

eettaa commented Nov 20, 2021

What version of this package are you using?
vscode-standard 2.0.1

What operating system, Node.js, and npm version?
ubuntu 18.04 LTS
node: v14.18.1
npm: 6.14.15

What happened?
vscode-standard can't find ts-standard module in monorepo child directory

I have a monorepo project structure and would like to open the TLD in vscode but still have vscode-standard find an appropriate standard engine and tsconfig.json. The structure is:

/personal-path-to-monorepo-mount/monorepo-name
    .git
    /project1
      a.ts
      tsconfig.json
      node_modules/
        ts-standard/
      sub-projectA/
          subA.ts
          tsconfig.json
          node_modules/
              ts-standard/ (?)
    /project2
        b.ts
        tsconfig.json
        node_modules/
            ts-standard/    # I don't have ts-standard installed here but would happily consider doing it if that is part of the solution

I have tried using a multi-root workspace to solve this problem i.e. a monorepo-name/workspace.code-workspace file like:

    "folders": [
        {
            "path": "./"
        },
        {
            "path": "./project1",
            "name": "open nested dir to help vscode-standard find a standard engine (can ignore)"
        }
    ],

Bizarrely, this approach worked great in Aug and early September 2021 but then broke. I can verify that no code/config changed on my side by checking out that version of code. I assume it was related to a vscode-standard of a VS Code version update that changed behavior.

I have also tried a single-rooted workspace with standard.nodePath set to "./project1/node_modules". This does not work at all.

What did you expect to happen?

  • Some config or intelligent searching locates the desired module.
  • Every typescript file opened in VS Code is actively linted with the (a?) ts-standard engine.
  • Unknown: which tsconfig.json file should be used in which case. I could see an argument for a) a specified tsconfig.json or b) the tsconfig.json in the directory of the open file (fallback to parent directory/tsconfig.jsn, then grandparent directory, etc.)

Are you willing to submit a pull request to fix this bug?
If I understand what the specific problem is, I will consider it.

@jakepearson
Copy link

Any update on this issue? I have a similar issue where most of my workspace/repo is rust, but we have one directory with typescript that I would like to enable this extension for. The only way I have figured out how to do that is to open the TS folder as a project root in a new window. Would love to not have to do that. Thanks!

@mcdado
Copy link

mcdado commented Jul 22, 2022

You could set standard.enableGlobally but that means running standard/semistandard from npm -g installation of the packages. Indeed a shortcoming of the extension not being able to use multi-root Workspaces.

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

No branches or pull requests

3 participants