find and solve ||
Please wait.....

Parameter implicitly has an 'any' type

I'm using visual studio code for a typescript project, where I use some 3rd party npm js libraries. Some of them don't provide any ts types (types.d.ts file), so whenever I use parameters or variables without specifying their type, vs code's linting shows this error: parameter implicitly has an 'any' type. Also, ts wouldn't compile


Option 1.

First, you  make typescript tolerate parameters without declaring their type, edit the tsconfig.json

// disable this rule:
// "strict": true,
// enable this rule:
"noImplicitAny": false

Second, install the tslint npm package as a prerequisite for the tslint vs code extension

npm install -g tslint

Option 2.

Specify the type: (callback:any) => { } for example.

Option 3.

 getSomeValue() {

        (response: { data: any; }) => {
        this.groupList =;
      }, (error: any) => {


  getList() {

    return this.http.get<any>(this.appUrl + "api/GetList").pipe(
      map(data => {
        return data;
      },function(error: string) {
              console.log("List Service Error " + error);

Option 4.

In your tsconfig.json file set the parameter "noImplicitAny": false under compilerOptions to get rid of this error.

Mahira  khanna

Mahira khanna

I have the skills you need for you company blog, website, or other content materials


Report Response