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

feature: detect inferred type cannot be named error #45

Open
unional opened this issue Jun 22, 2023 · 3 comments
Open

feature: detect inferred type cannot be named error #45

unional opened this issue Jun 22, 2023 · 3 comments
Labels
feature New feature or request needs npm install

Comments

@unional
Copy link

unional commented Jun 22, 2023

I was thinking about doing something similar.

Basically what's need is to get the package, install the dependencies, and see if the types in the output files can be resolved or not.

This is especially problematic with pnpm with monorepo as the transient packages are located at the top level ./node_modules/.pnpm/....

For example:

# Dependency graph
- lib-a
  - lib-b
    - lib-c
# folder
- packages
  - lib-a
    - node_modules
      - lib-b  # symlink to /node_modules/.pnpm/lib-b/version-y
- node_modules
  - .pnpm
    - lib-b@version-y
    - lib-c@version-x 

If lib-b does not re-exports the type from lib-c, you will get Inferred type cannot be named error.

@andrewbranch andrewbranch added feature New feature or request needs npm install labels Jun 22, 2023
@andrewbranch
Copy link
Collaborator

Anything that needs a full npm install is going to be out of scope for a while, but I think eventually it would be useful to do that and just report any actual TS errors.

@unional
Copy link
Author

unional commented Jun 22, 2023

Understand. 😄

Have not looked at the code, does it capable of parsing the typescript file?
Maybe a npm install can be avoided if we can compare the import identifiers against the dependencies in the package json.

@andrewbranch
Copy link
Collaborator

Yeah, the TS files are parsed. It’s not that installing dependencies is impossible, it’s just that it would introduce a lot of complexity. It could take a while and use a lot of data on the web, so we’d want to prompt first, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request needs npm install
Projects
None yet
Development

No branches or pull requests

2 participants