Skip to content

Plugin doesn't follow the same module-loader search paths #30

@richardspence

Description

@richardspence

Summary

The plugin treats the paths in the tsconfig as gospel for adjusting the resolution path. It should instead use it as the primary search folder for determining where the module is located before falling back to the default module resolution strategies.

Repro steps

tsconfig:

    "baseUrl": ".",
    "paths": {
            "*": ["*"]
        },

foo/IFoo

export interface IFoo {}

foo/File2

import {IFoo} from './IFoo';

Expected

The plugin to not transform the relative imports (since they aren't available of the root). Paths should be performed first and only applied if the module can be loaded from that location. Then it should fallback to the module resolution strategy defined for the project https://www.typescriptlang.org/docs/handbook/module-resolution.html#module-resolution-strategies

Actual

foo/File2.d.ts

import {IFoo} from '../IFoo';

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions