microsoft / microsoft/TypeScript
Type check TS file instead of index.d.ts in node_modules leads to build error that cannot be ignored
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 4.1 RC
Search Terms: node_module check
Code
Run tsc on this PR:
https://github.com/DimensionDev/Maskbook/pull/1879
Emitting this error (I have skipLibCheck on but tsc is going to read .tssource file not.d.ts` file):
node_modules/promievent/PromiEvent.ts:28:33 - error TS2345: Argument of type '(resolve: Resolve<T>, reject: Reject) => void' is not assignable to parameter of type '(resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void'.
Types of parameters 'resolve' and 'resolve' are incompatible.
Types of parameters 'value' and 'value' are incompatible.
Type 'T | PromiseLike<T> | undefined' is not assignable to type 'T | PromiseLike<T>'.
Type 'undefined' is not assignable to type 'T | PromiseLike<T>'.
28 this.promise = new Promise<T>(executor)
~~~~~~~~
Found 1 error.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report by running tsc on DimensionDev/Maskbook PR 1879 with TypeScript 4.1 RC and skipLibCheck enabled. Start with the node_modules/promievent/PromiEvent.ts diagnostic and compare why the .ts source is checked instead of the package's index.d.ts. Done means the reported build error is no longer produced under the stated configuration, with regression coverage added if an existing compiler test location is identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100