'Expected 1 arguments, but got 0.ts(2554) - Disable

For testing and migration proposes I would like to disable this option (TS2554), but I can't seem to find it regarding the name.

{
  "extends": "@quasar/app-webpack/tsconfig-preset",
  "compilerOptions": {
    "baseUrl": ".",
    "noImplicitAny": false,
    "strictPropertyInitialization": false,
    "strictNullChecks": false,
    "????": false
  }
}

Thank you,



Solution 1:[1]

It sounds like you're trying to call a function with 0 arguments when it expects 1. As far as I know, there is no option you can specify in the tsconfig.json file to allow calls like this.

If you have control over the function signature, you could change the parameter to be optional. Then you could call the function without passing in an argument. Something like this:

function myFunction(a?: any){
  console.log(a);
}

myFunction();

As an escape hatch, you can also use a @ts-ignore comment to tell the Typescript compiler to not type check your call to the function:

function myFunction(a: string){
  console.log(a);
}

// @ts-ignore
myFunction();

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jordan