-
-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
Minimal repro here: https://github.com/chenxinyanc/unrs-resolver-mounted-partition
When resolving for a module, if there is a mount point instead of ordinary folder within the path of the resolved file, unrs-resolver
gives incorrect outputs.
I'm reporting this issue because both eslint-import-resolver-typescript and eslint-plugin-import-x are using unrs-resolver
.
For example, suppose there is a Mounted Volume named "mount-root" under current directory, the following code
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { ResolverFactory } from "unrs-resolver";
const resolver = new ResolverFactory({
tsconfig: {
configFile: 'tsconfig.json',
},
});
const dir = path.resolve(fileURLToPath(import.meta.url), '..');
// console.log("dir: ", dir);
const resolved = resolver.sync(dir, './mount-root/foo.ts');
console.log(resolved);
currently prints something like
{
path: '...\\unrs-resolver-mounted-partition\\src\\Volume{3b0ca266-7f02-4f2c-938c-50931634f3fb}\\foo.ts',
moduleType: 'module',
packageJsonPath: '...\\unrs-resolver-mounted-partition\\package.json'
}
where "Volume{3b0ca266-7f02-4f2c-938c-50931634f3fb}" is supposed to be "mount-root".
Please refer to the README.md of my reproduction repo attached above for details.
Metadata
Metadata
Assignees
Labels
No labels