Cannot find references outside package
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 238
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
**Describe the bug**
Version: 13.0.3
**To Reproduce**
I have a monorepo with multiple packages. My tsconfig looks like this:
```json
{
"include": ["packages/*/src/**/*"],
"exclude": ["node_modules", "**/*.spec.ts"],
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"noEmit": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": false,
}
}
```
```ts
import { Project } from "ts-morph";
let project = new Project({
tsConfigFilePath: '/app/tsconfig.tsmorph.json',
})
// This seems to be OK, all files are listed
console.log(project.getSourceFiles().map(x => x.getFilePath())
let found = project
.getSourceFile('packages/core/src/panda/index.ts')
.getReferencingSourceFiles()
```
**Expected behavior**
If get all references to `@app/core/panda` within `@app/core`, however references from packages outside `@app/core` are not listed
Contributor guide
Research direction
Reproduce the monorepo case using the provided tsconfig and the ts-morph Project entry point. Inspect how getSourceFile('packages/core/src/panda/index.ts').getReferencingSourceFiles() resolves imports across packages; done means references from packages outside @app/core are included as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100