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 distributing a reusable piece of Jest config in a package, which provides a moduleNameMapper object that maps certain strings to paths in that package. I use absolute paths to make the resolution independent of the actual Jest root dir:
Jest can handle this, but eslint-import-resolver-jest does not expect the path to be absolute and always prepends jestConfig.importResolverProjectRoot.
I think, instead of checking whether jestConfig.rootDir is absolute, this case could be covered by checking if replacedRoot instead. Would you accept a PR along these lines?
Workaround
Currently, you can set rootDir to an absolute path in the Jest config which uses the reusable snippet to make it work:
rootDir: require('path').resolve(__dirname),
The text was updated successfully, but these errors were encountered:
I'm distributing a reusable piece of Jest config in a package, which provides a
moduleNameMapper
object that maps certain strings to paths in that package. I use absolute paths to make the resolution independent of the actual Jest root dir:Jest can handle this, but
eslint-import-resolver-jest
does not expect the path to be absolute and always prependsjestConfig.importResolverProjectRoot
.eslint-import-resolver-jest/src/index.js
Lines 137 to 146 in c7b3d04
I think, instead of checking whether
jestConfig.rootDir
is absolute, this case could be covered by checking ifreplacedRoot
instead. Would you accept a PR along these lines?Workaround
Currently, you can set
rootDir
to an absolute path in the Jest config which uses the reusable snippet to make it work:The text was updated successfully, but these errors were encountered: