Installation
Quick Install
Install the plugin along with its peer dependencies:
npm install eslint-plugin-typed-jsdoc @typescript-eslint/parser typescript --save-dev Prerequisites
- Node.js 18+ - Required for modern JavaScript features
- ESLint 9+ - Uses the new flat config format
- TypeScript 5+ - Required for type inference (installed as peer dependency)
Peer Dependencies
The plugin requires these peer dependencies:
eslint^9.0.0@typescript-eslint/parser^8.0.0typescript^5.0.0
ESLint Configuration
The simplest setup uses a preset config:
eslint.config.js
// eslint.config.js
import tjd from 'eslint-plugin-typed-jsdoc';
export default [
tjd.configs.recommended,
];Or use the createConfig() factory for framework-specific setups:
eslint.config.js
// eslint.config.js
import tjd from 'eslint-plugin-typed-jsdoc';
export default [
...tjd.createConfig({
preset: 'recommended',
framework: 'next', // or 'react', 'vue', 'express', etc.
}),
];TypeScript Configuration (Optional)
The plugin uses TypeScript's projectService by default, which provides
zero-config support. However, for better type inference, you can create a tsconfig.json:
tsconfig.json
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"noEmit": true
},
"include": ["**/*.js", "**/*.mjs", "**/*.jsx"]
}The key settings are:
allowJs: true- Let TypeScript process JavaScript filescheckJs: true- Enable type checking for JavaScriptnoEmit: true- Don't generate output files
Verify Installation
Run ESLint to verify everything is working:
npx eslint src/If you see JSDoc-related warnings or errors, the plugin is working correctly.
Next Steps
- Configure the rules to match your project's needs
- Learn about each rule and what it catches