ESLint Plugin for TSDoc Syntax Validation

0.5.2 · active · verified Sun Apr 19

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.

Common errors

Warnings

Install

Imports

Quickstart

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.

npm install --save-dev eslint typescript @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-tsdoc

// .eslintrc.js
module.exports =  {
  plugins: [
    "@typescript-eslint/eslint-plugin",
    "eslint-plugin-tsdoc"
  ],
  extends:  [
    'plugin:@typescript-eslint/recommended'
  ],
  parser:  '@typescript-eslint/parser',
  parserOptions: {
    project: "./tsconfig.json",
    tsconfigRootDir: __dirname,
    ecmaVersion: 2018,
    sourceType: "module"
  },
  rules: {
    "tsdoc/syntax": "warn"
  }
};

view raw JSON →