jsconfig.json option

noImplicitThis

  • Default false
  • Since TypeScript 2.0

Inside a plain function, this depends on how the function is called, so TypeScript often cannot know its type and falls back to any. noImplicitThis reports those uses (TS2683), so a typo in this.nmae cannot slip through.

It is part of strict and arrived with TypeScript 2.0. Methods in classes and object literals are not affected: there this has a known type.

At a glance

Write Leave it to strict; write "noImplicitThis": false only to turn this one check back off
On the command line --noImplicitThis
Type boolean
Default in TypeScript 5.9 false (on when strict is on)
Default from TypeScript 6.0 true, through strict (TypeScript 6.0)
TypeScript's description Enable error reporting when 'this' is given the type 'any'.

The description is quoted from TypeScript's own option list (Apache-2.0); see the notices.

Examples

main.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: main.js(5,13): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. main.js(5,32): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. main.js(5,13): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. main.js(5,32): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. main.js(5,13): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. main.js(5,32): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. checked 21 October 2026
export const product = { name: "Tea", price: 3, describe };

function describe() {
  return `${this.name} costs ${this.price}`;error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
}
noImplicitThis on: this has no known type in a plain function.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": [
    "*.js"
  ]
}
main.js TypeScript 5.9.3 TypeScript 5.9.3, run 21 October 2026: No errors. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. No errors. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. No errors. checked 21 October 2026
export const product = { name: "Tea", price: 3, describe };

function describe() {
  return `${this.name} costs ${this.price}`;
}
noImplicitThis off: this is any.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": [],
    "noImplicitThis": false
  },
  "include": [
    "*.js"
  ]
}

Saying what this is

Add a @this tag, /** @this {{ name: string, price: number }} */, or move the function into the object or class as a method, where this is typed for you.

Gotchas

  • A function that assigns to this.something is treated as a constructor function in a .js file, so its this is the instance and is never reported.
  • Arrow functions take this from where they are written, so they are never the cause.

Sources

Last reviewed 20 October 2026.