Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor bug: Dependency name mistaken as a path #51

Open
tomcatmwi opened this issue Feb 9, 2023 · 0 comments
Open

Minor bug: Dependency name mistaken as a path #51

tomcatmwi opened this issue Feb 9, 2023 · 0 comments

Comments

@tomcatmwi
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant