JSDoc tag

@static

  • Not checked by TypeScript
  • Tested with TypeScript 5.9

@static is a JSDoc documentation tag for a member that belongs to a class or function itself rather than to its instances. TypeScript 5.9 ignores it: a method tagged @static is still an instance method, and calling it on the class is an error (TS2339).

JavaScript has the static keyword for this, and TypeScript reads it in .js files. For older code, assigning a function to a property of the class after its declaration also adds a static member.

At a glance

Use JSDoc in a .js file TypeScript in a .ts file
A static method class Temperature { static fromCelsius(celsius) { … } } class Temperature { static fromCelsius(celsius: number) { … } }
A static property added later Temperature.toCelsius = (f) => …; class Temperature { static toCelsius = (f: number) => …; }

Examples

temperature.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: temperature.js(12,13): error TS2339: Property 'fromCelsius' does not exist on type 'typeof Temperature'. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. temperature.js(12,13): error TS2339: Property 'fromCelsius' does not exist on type 'typeof Temperature'. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. temperature.js(12,13): error TS2339: Property 'fromCelsius' does not exist on type 'typeof Temperature'. checked 21 October 2026
export class Temperature {
  /**
   * @static
   * @param {number} celsius
   */
  fromCelsius(celsius) {
    return celsius * 1.8 + 32;
  }
}

Temperature.fromCelsius(20);error TS2339: Property 'fromCelsius' does not exist on type 'typeof Temperature'.
@static does not make a method static.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}
temperature.js temperature.ts 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 class Temperature {
  /** @param {number} celsius */
  static fromCelsius(celsius) {
    return celsius * 1.8 + 32;
  }
}

/** @param {number} fahrenheit */
Temperature.toCelsius = (fahrenheit) => (fahrenheit - 32) / 1.8;

Temperature.fromCelsius(20);
Temperature.toCelsius(68);
export class Temperature {
  static fromCelsius(celsius: number) {
    return celsius * 1.8 + 32;
  }

  static toCelsius = (fahrenheit: number) => (fahrenheit - 32) / 1.8;
}

Temperature.fromCelsius(20);
Temperature.toCelsius(68);
The static keyword, or an assignment to the class.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "target": "es2022",
    "module": "nodenext",
    "types": []
  },
  "include": ["*.js"]
}

How we tested it

The first example tags an ordinary method @static and calls Temperature.fromCelsius(20). If the tag were read, the call would pass; tsc reports "Property 'fromCelsius' does not exist on type 'typeof Temperature'".

Static members in JavaScript

static works on methods, fields, getters and blocks in any class. An assignment such as Temperature.toCelsius = … in the same file is read as a static member too, typed from the assigned function and its JSDoc. Both appear in the second example.

Gotchas

  • For constructor functions, the same assignment pattern applies: Counter.create = function () { … } adds create to the function's type.
  • Keep @static if your documentation tool needs it to file a member; TypeScript shows it in the hover as text.

Questions

How do I document a static method with JSDoc for TypeScript?

Write the static keyword on the method and document it with @param and @returns as usual. No tag is needed.

Sources

Last reviewed 20 October 2026.