question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve extension in a Multi repository setup with Lerna.

See original GitHub issue

I’ve tried everything to make this work with mono repositories but nothing helps. My eslint config works when run from command line but it fails to work in vsc.

Here is my directories structure:

web - root directory
web/package.json - all the eslint packages are added here
web/.eslintrc - main eslint config
web/packages/a/.eslintrc - eslint config that extends .eslintrc from the root
web/packages/a/tsconfig.json - TS config

When I run eslinter from command line everything works perfectly but in the vsc I constantly see error that tsconfig.json file can’t be found in the web directory. It’s pretty annoying as it should look for the file in each sub package. It works in eslint cli, so don’t know why it doesn’t work in vsc.

I’ve also tried changing settings:

{
  "eslint.enable": true,
  "eslint.packageManager": "yarn",
  "eslint.workingDirectories": [
    {
      "directory": "./packages/a",
      "changeProcessCWD": true
    },
    {
      "directory": "./packages/b",
      "changeProcessCWD": true
    }
  ]
}

and then it works but it’s far from perfect as I would like to use something like glob pattern and I can’t in the directory property. I guess that it would also take the first tsconfig.json file that it finds in this directories which doesn’t necessary mean the one that is dedicated for a given sub package

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
dbaeumercommented, Dec 4, 2019

There is a new version (Insider testing) that addresses this is two ways:

  • glob pattern support
  • more eager working directory changes.

The version can be found here: https://github.com/microsoft/vscode-eslint/issues/815

2reactions
dbaeumercommented, Dec 16, 2019

Now available in 2.0.4. See new auto mode a glob pattern support for working directories.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting up a monorepo with Lerna for a TypeScript project
You know the benefits of keeping your codebase simple to maintain. Learn how to setup a monorepo with Lerna and configure it for...
Read more >
Reuse your eslint/prettier configurations in a monorepo with ...
Basically, a monorepo is a repository where you can store many packages. Some of the main advantages are more reusability and dependency management....
Read more >
Lerna, a tool for managing JavaScript projects with ... - YouTube
Live meetup from Denver Node.js hosted at Code Talent. Kim shows off Lerna, a tool for hosting multiple projects in the same repository....
Read more >
Lerna reborn — What's new in v6?. Lerna v6 is out ... - Nx Blog
Are you maintaining an OSS repository using Lerna? ... ..to automatically generate a nx.json configuration file based on your ... Upgrade to v6...
Read more >
A Guide to Monorepos for Front-end Code - Toptal
Comparison of a monorepo, single repo, and multi-repo ... Each package will have to have its own workflow environment configuration, and this means...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found