JSDoc that matches TypeScript

ESLint plugin for JSDoc type accuracy. Compares JSDoc annotations against TypeScript's type inference and auto-fixes mismatches.

npm install eslint-plugin-typed-jsdoc @typescript-eslint/parser typescript --save-dev

Catch Type Mismatches Automatically

JSDoc says string, but TypeScript knows it's a number. We fix that.

Before Type mismatch
/** @param {string} count */
function double(count) {
  return count * 2; // TypeScript knows this is number!
}
After eslint --fix
/** @param {number} count */
function double(count) {
  return count * 2;
}

Why typed-jsdoc?

TypeScript is the source of truth. JSDoc should match inference, not override it.

Auto-fix Everything

Run eslint --fix and mismatches are corrected automatically.

🔍

TypeScript-Powered

Leverages TypeScript's type inference. No custom type analysis.

🎯

Zero False Positives

We'd rather miss something than report incorrectly.

📋

2 Focused Rules

Fix inaccurate JSDoc. Remove redundant types. That's it.

Battle-Tested

Validated against popular npm packages to ensure accuracy

282
Packages Tested
9,947
Files Analyzed
711
Type Mismatches Found

Simple Configuration

Works with ESLint 9's flat config. Just add the plugin and enable the rules you want.

  • Three presets: recommended, strict, minimal
  • Per-rule ignorePatterns for fine-grained control
  • Works with typescript-eslint out of the box
eslint.config.js
// eslint.config.js
import tjd from 'eslint-plugin-typed-jsdoc';

export default [
  tjd.configs.recommended,
];

// Or with framework support:
// export default [
//   ...tjd.createConfig({ framework: 'next' }),
// ];

Ready to fix your JSDoc types?

Install the plugin and run eslint --fix. That's it.