You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using TypeScript Project References, where project A depends on project B:
B's package.json is correctly configured to export cjs, esm, and types
A's package.json has entry B in dependencies
TypeScript successfully infers all types and goes to definitions.
Even though projects A and B have not yet been built, everything is working properly (thanks to project references).
Unfortunately, while importing B into A in a TypeScript file, ESLint cannot locate the files for B (it has not yet been built) and returns the error import-x/no-unresolved.
Is it possible to instruct import-x to infer/use TypeScript project references or there is another trick or workaround?
The only option I've found is to build project B, which will make import-x happy.
Thanks
The text was updated successfully, but these errors were encountered:
However, because I was referencing a single shared tsconfig.json—which contained the common settings for two different projects—that adjustment alone did not work for me.
Ultimately, I fixed it by moving the shared settings into each project's individual tsconfig file instead.
It's not the prettiest solution, but hopefully it helps if you run into the same problem.
I'm using TypeScript Project References, where project
A
depends on projectB
:B
'spackage.json
is correctly configured to exportcjs
,esm
, andtypes
A
'spackage.json
has entryB
in dependenciesEven though projects
A
andB
have not yet been built, everything is working properly (thanks to project references).Unfortunately, while importing
B
intoA
in a TypeScript file,ESLint
cannot locate the files for B (it has not yet been built) and returns the errorimport-x/no-unresolved
.Is it possible to instruct
import-x
to infer/use TypeScript project references or there is another trick or workaround?The only option I've found is to build project
B
, which will makeimport-x
happy.Thanks
The text was updated successfully, but these errors were encountered: