If you know how to fix the issue, make a pull request instead.
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.
If you know how to fix the issue, make a pull request instead.
@types/xxxxpackage and had problems.Definitions by:inindex.d.ts) so they can respond.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
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