JoshuaKGoldberg / JoshuaKGoldberg/TypeStat
findRelevantNodeReferencesAsNodes should recurse through export assignments
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 47
- Avg merge
- 15h 55m
- Merged PRs (30d)
- 21
Description
### 🐛 Bug Report
- TypeStat version: 0.6.0
- TypeScript version: n/a
- Node version: n/a
#### Actual Behavior
Right now, `findRelevantNodeReferencesAsNodes` directly calls to the TS language service's `findReferences` API. That only finds _direct_ references to a node. If the node is re-exported with an export assignment (`export { MyNode }`), then only the reference in the export assignment will be looked at.
#### Expected Behavior
Fixers that try to collect all types used for some node are hamstrung by this. You'd expect them to also see uses of the exported node.
#### Reproduction
The `fixReactPropsMissing` fixer added in #1037 doesn't find the `` in this pair of files:
```ts
// MyComponent.ts
const MyComponent = ({ prop }) =>
export { MyComponent };
```
```ts
// index.tsx
import { MyComponent } from "./MyComponent";
export const render = () => ;
```
Contributor guide
Assessment
This issue has not been assessed yet.