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

Incorrect fallback bug detection #23

Open
emmatown opened this issue May 4, 2023 · 2 comments
Open

Incorrect fallback bug detection #23

emmatown opened this issue May 4, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@emmatown
Copy link

emmatown commented May 4, 2023

For a package like this:

// package.json
{
  "name": "some-pkg",
  "version": "0.0.0",
  "exports": {
    ".": {
      "import": {},
      "require": {},
      "default": "./index.js"
    }
  }
}
// index.js
console.log('a')
// index.d.ts
export {};

Importing it works in Node (and TypeScript) but arethetypeswrong reports that it's relying on microsoft/TypeScript#50762 when it's not since TypeScript is doing the correct thing in this case and working like Node.

(of course it makes no sense to do what's in the example, it's just to illustrate the problem)

@andrewbranch andrewbranch added the bug Something isn't working label May 4, 2023
@andrewbranch
Copy link
Collaborator

Do you know of a published package where this happens?

@emmatown
Copy link
Author

emmatown commented Jun 11, 2023

I don't unfortunately, sorry

Some context as to how I ran into this though in case it's helpful: I was suggesting in a PR review that this line: https://github.com/emotion-js/emotion/blob/fef1ea086fbec998caaa016a5ecdace4bbb9d749/packages/react/package.json#L51 was unnecessary but ended up deciding not to remove it to avoid arethetypeswrong saying that it was wrong.

(I'm aware that what that entry point is doing is bad in a sense since it's lying to TypeScript but that's kind of the whole point of what's going on there because it's for https://github.com/kentcdodds/babel-plugin-macros and even ignoring module stuff, it wants to lie about what's going on)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants