-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Closed
Description
If you know how to fix the issue, make a pull request instead.
- I tried using the
@types/xxxxpackage and had problems. - I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
- I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
- Mention the authors (see
Definitions by:inindex.d.ts) so they can respond.- Authors: @SimonSchick @rbuckton @sandersn
Code to reproduce:
Note: I am using --checkJs --allowJs to type checking my js project.
Link to a minimal repo that reproduce this bug
index.js
const { promisify } = require('util')
const f = promisify((a, callback) => {})
const g = promisify((a, b, callback) => {})
f(1) // error TS2554: Expected 0 arguments, but got 1.
g(1,2) // error TS2554: Expected 0 arguments, but got 2.tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"allowJs": true,
"checkJs": true,
"noEmit": true,
"strict": false,
}
}package.json
{
"devDependencies": {
"@types/node": "^11.9.5",
"typescript": "^3.3.3333"
}
}Error output
$ npx tsc
index.js:6:1 - error TS2554: Expected 0 arguments, but got 1.
6 f(1)
~~~~
index.js:7:1 - error TS2554: Expected 0 arguments, but got 2.
7 g(1,2)
~~~~~~
Found 2 errors.
cbaron, zerubeus, gitowiec, eduardobcastro, LinqLover and 1 more
Metadata
Metadata
Assignees
Labels
No labels