tsdoc/eslint-plugin
Pete Gonzalez 26a8594082 Cherry-pick 06e9af3c95 2024-07-24 20:59:55 -07:00
..
config Fix up projects to build again 2023-06-10 15:53:21 -07:00
src Fix lint and build issues. 2024-05-28 13:20:36 -07:00
.eslintrc.js Eliminate eslint-config and typescript dependencies in most projects. 2024-05-28 13:20:36 -07:00
.npmignore Cherry-pick 06e9af3c95 2024-07-24 20:59:55 -07:00
CHANGELOG.json Update changelogs [skip ci] 2024-05-28 21:34:19 +00:00
CHANGELOG.md Update changelogs [skip ci] 2024-05-28 21:34:19 +00:00
LICENSE
README.md Update URLs to reference https://tsdoc.org/ 2020-11-29 21:41:14 -08:00
package.json Bump versions [skip ci] 2024-05-28 21:34:21 +00:00
tsconfig.json Enable some stricter options. 2024-05-28 13:20:36 -07:00

README.md

eslint-plugin-tsdoc

This ESLint plugin provides a rule for validating that TypeScript doc comments conform to the TSDoc specification.

Usage

  1. Configure ESLint for your TypeScript project. See the instructions provided by the typescript-eslint project. You will end up with some dependencies like this:

    my-project/package.json (example)

    {
      "name": "my-project",
      "version": "1.0.0",
      "dependencies": {},
      "devDependencies": {
        "@typescript-eslint/eslint-plugin": "~2.6.1",
        "@typescript-eslint/parser": "~2.6.1",
        "eslint": "~6.6.0",
        "typescript": "~3.7.2"
      },
      "scripts": {
        "lint": "eslint -f unix \"src/**/*.{ts,tsx}\""
      }
    }
    
  2. Add the eslint-plugin-tsdoc dependency to your project:

    $ cd my-project
    $ npm install --save-dev eslint-plugin-tsdoc
    
  3. In your ESLint config file, add the "eslint-plugin-tsdoc" package to your plugins field, and enable the "tsdoc/syntax" rule. For example:

    my-project/.eslintrc.js (example)

    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"
      }
    };
    

This package is maintained by the TSDoc project. If you have questions or feedback, please let us know!