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

Add support for self-referencing #194

Open
RebeccaStevens opened this issue Jul 7, 2023 · 0 comments
Open

Add support for self-referencing #194

RebeccaStevens opened this issue Jul 7, 2023 · 0 comments

Comments

@RebeccaStevens
Copy link

I can't seem to get self-referencing to work with tsd. Here's the basics of my setup.

// my-test.test-d.ts
import { expectType } from "tsd";

import { foo } from "my-package";      // <-- tsd cannot resolve either of these imports,
import { bar } from "my-package/bar";  // <-- but typescript itself can.

// ...
// package.json
{
  "name": "my-package",
  "type": "module",
  "exports": {
    ".": {
      "development": "./src/index.ts",
      "types": "./dist/index.d.mts",
      "import": "./dist/index.mjs",
    },
    "./bar": {
      "development": "./src/bar.ts",
      "types": "./dist/bar.d.mts",
      "import": "./dist/bar.mjs",
    }
  }
}
// tsconfig.json
{
  "compilerOptions": {
    "strict": true,
    "customConditions": ["development"] // If tsd is to run on the compiled .d.ts files, then tsd probably need to be configure NOT to use this (all other tools do need it)
  }
}
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