Skip to content

Minor bug: Dependency name mistaken as a path #51

@tomcatmwi

Description

@tomcatmwi

There is a dependency named graphql in node_modules.
I also have a src/graphql folder in my project.
In this folder, I have a Typescript file that imports from the graphql dependency:

import { GraphQLError } from 'graphql';

This is mistaken as a path reference by tspath, and it gets transpiled as:

const graphql_1 = require("../graphql/index.js");

Of course, the line can be skipped with // tspath: skip-file but it would be nice if tspath recognized that this is a reference to a dependency, and not to a folder. It would be as simple as collecting node_modules subfolders and giving them precedence over folder names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions