-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(eslint): statSync also breaks if packages does not exist
- Loading branch information
Showing
2 changed files
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0f7a37f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I'm watching this repo, because it's amazing and your work at all.
Regarding this "workspaces" resolving and getting a list of packages in workspaces, I had created
@tunnckocore/utils
package before some weeks, that is getting all the names in all possible/defined workspaces (not only thepackages/
dir), and acreateAliases
useful for getting a map of key/value pairs, useful for"alias"
or TS's"paths"
, Jest or other resolvers. You can check the tests there too.It's working for pure Lerna, or Lerna with Yarn, or Pnpm.
https://github.com/tunnckocorehq/hela/blob/v3-next/%40tunnckocore/utils/src/index.js#L50
0f7a37f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sharing, it is very first version for my workspace solution, and should meet most cases(of course it could be better by your solution, thx), and TS's
paths
can be automatically handlered by eslint-import-resolver-ts.I have never used Pnpm before, I will try sometime, maybe.
And thanks for sharing your repository again, I will review it deeper later.
0f7a37f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What that means, more specifically? I need to have it working for all the defined workspaces, is it that you were talking about?
Like here https://github.com/tunnckocorehq/hela/blob/v3-next/tsconfig.json#L15-L18, which also is inside all of the package's
tsconfig.gentypes.json
. Btw, if you wonder why I don't use extends, it's because it wasn't working well for some reason, so I decided to duplicate everything 😆0f7a37f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean if you are using
eslint-plugin-import
, then the resolver plugins should be able to resolve ts paths correctly very well.Personally, when I use ts project reference feature, I have to do this also.