{"id":10833,"library":"eslint-plugin-tsdoc","title":"ESLint Plugin for TSDoc Syntax Validation","description":"eslint-plugin-tsdoc is an ESLint plugin designed to enforce the TSDoc specification for documentation comments within TypeScript projects. It ensures that doc comments adhere to a structured format, improving consistency and machine-readability for tools like API extractors. The plugin's current stable version is 0.5.2 and it is actively maintained by the TSDoc project, indicating ongoing support and alignment with the TSDoc specification. Unlike general JSDoc validators, this plugin is specifically tailored for TypeScript and integrates seamlessly with the `@typescript-eslint` ecosystem, requiring its parser and plugin for correct operation. Its primary differentiation is strict adherence to the TSDoc standard, providing a more formal and type-aware documentation approach compared to looser JSDoc interpretations. Release cadence is typically driven by TSDoc spec updates or bug fixes, rather than a fixed schedule.","status":"active","version":"0.5.2","language":"javascript","source_language":"en","source_url":"https://github.com/microsoft/tsdoc","tags":["javascript","TypeScript","documentation","doc","comments","JSDoc","TSDoc","ESLint","plugin","typescript"],"install":[{"cmd":"npm install eslint-plugin-tsdoc","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-tsdoc","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-tsdoc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for any ESLint plugin to function.","package":"eslint","optional":false},{"reason":"Required by @typescript-eslint/parser to parse TypeScript code.","package":"typescript","optional":false},{"reason":"Typically used alongside to provide general TypeScript ESLint rules and parsing capabilities.","package":"@typescript-eslint/eslint-plugin","optional":false},{"reason":"Required for ESLint to parse TypeScript files, which this plugin operates on.","package":"@typescript-eslint/parser","optional":false}],"imports":[{"note":"ESLint plugins are referenced by their full package name (e.g., 'eslint-plugin-tsdoc') or their short name if prefixed with 'eslint-plugin-' (e.g., 'tsdoc'). The recommended approach is to use the full name for clarity or use a direct reference like this example.","wrong":"plugins: [\n  \"@typescript-eslint\",\n  \"tsdoc\"\n]","symbol":"eslint-plugin-tsdoc (plugin name)","correct":"plugins: [\n  \"@typescript-eslint/eslint-plugin\",\n  \"eslint-plugin-tsdoc\"\n]"},{"note":"ESLint rules from plugins must be prefixed with the plugin name or its alias, followed by a slash and the rule name. Omitting the prefix will result in the rule not being found.","wrong":"rules: {\n  \"syntax\": \"warn\"\n}","symbol":"tsdoc/syntax (rule name)","correct":"rules: {\n  \"tsdoc/syntax\": \"warn\"\n}"},{"note":"ESLint configuration files (`.eslintrc.js`) are typically CommonJS modules and should use `module.exports`. While ESLint has experimental support for ESM config files, CJS is the standard and most compatible approach.","wrong":"export default {\n  // ... config object ...\n};","symbol":"ESLint Configuration Object","correct":"module.exports =  {\n  // ... config object ...\n};"}],"quickstart":{"code":"npm install --save-dev eslint typescript @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-tsdoc\n\n// .eslintrc.js\nmodule.exports =  {\n  plugins: [\n    \"@typescript-eslint/eslint-plugin\",\n    \"eslint-plugin-tsdoc\"\n  ],\n  extends:  [\n    'plugin:@typescript-eslint/recommended'\n  ],\n  parser:  '@typescript-eslint/parser',\n  parserOptions: {\n    project: \"./tsconfig.json\",\n    tsconfigRootDir: __dirname,\n    ecmaVersion: 2018,\n    sourceType: \"module\"\n  },\n  rules: {\n    \"tsdoc/syntax\": \"warn\"\n  }\n};","lang":"typescript","description":"This quickstart demonstrates how to install `eslint-plugin-tsdoc` along with its peer dependencies and configure your `.eslintrc.js` file to enable the `tsdoc/syntax` rule for validating TSDoc comments in a TypeScript project."},"warnings":[{"fix":"Refer to the release notes for `@typescript-eslint` and `eslint-plugin-tsdoc` when upgrading to identify necessary configuration adjustments or minimum version requirements.","message":"Major versions of `@typescript-eslint/parser` or `@typescript-eslint/eslint-plugin` can introduce breaking changes that might affect how `eslint-plugin-tsdoc` interacts with your TypeScript code. Ensure compatibility when upgrading.","severity":"breaking","affected_versions":">=3.0.0 of @typescript-eslint/*"},{"fix":"Verify that `parserOptions.project` points to the correct `tsconfig.json` file for the linted project, and `tsconfigRootDir` is set to the absolute path of the directory containing `tsconfig.json` relative to your ESLint config.","message":"Incorrect configuration of `parserOptions.project` or `tsconfigRootDir` in your ESLint setup can prevent `@typescript-eslint/parser` (and thus `eslint-plugin-tsdoc`) from correctly resolving type information, leading to parsing errors or rules not firing correctly, especially in monorepos.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure `@typescript-eslint/parser` and `@typescript-eslint/eslint-plugin` are installed as dev dependencies and properly configured in your `.eslintrc.js` file under `parser`, `plugins`, and `extends`.","message":"Failing to install or correctly configure `@typescript-eslint/parser` and `@typescript-eslint/eslint-plugin` will cause ESLint to fail to parse TypeScript files or recognize the TSDoc plugin's context.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Change `plugins: ['tsdoc']` to `plugins: ['eslint-plugin-tsdoc']` or ensure the package is correctly installed.","cause":"The plugin name in the ESLint configuration `plugins` array is incorrect or missing the `eslint-plugin-` prefix.","error":"Error: Plugin \"tsdoc\" was not found. Please check the plugin name, or consider installing it with npm."},{"fix":"Verify that `parserOptions.project` correctly points to your `tsconfig.json` (e.g., `./tsconfig.json`) and that `tsconfigRootDir` is correctly set to `__dirname` or the absolute root of your project containing `tsconfig.json`.","cause":"`parserOptions.project` or `tsconfigRootDir` is incorrectly configured, leading ESLint to look for a non-existent `tsconfig.json` file.","error":"Parsing error: 'parserOptions.project' has been set for @typescript-eslint/parser. The file does not exist: /path/to/project/undefined"},{"fix":"Ensure `eslint-plugin-tsdoc` is listed in the `plugins` array in your `.eslintrc.js` and that the rule name `tsdoc/syntax` is spelled correctly, including the `tsdoc/` prefix.","cause":"The `tsdoc/syntax` rule is referenced in the `rules` section but the `eslint-plugin-tsdoc` plugin is not correctly loaded, or the rule name is mistyped.","error":"Rule 'tsdoc/syntax' is not found."}],"ecosystem":"npm"}