Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
eslint-plugin-tsdoc (plugin name)
✓ plugins: [
"@typescript-eslint/eslint-plugin",
"eslint-plugin-tsdoc"
]
✗ plugins: [
"@typescript-eslint",
"tsdoc"
]
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.
tsdoc/syntax (rule name)
✓ rules: {
"tsdoc/syntax": "warn"
}
✗ rules: {
"syntax": "warn"
}
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.
ESLint Configuration Object
✓ module.exports = {
// ... config object ...
};
✗ export default {
// ... config object ...
};
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.
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"
}
};
Debug
Known issues
breakingMajor 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.fixRefer to the release notes for `@typescript-eslint` and `eslint-plugin-tsdoc` when upgrading to identify necessary configuration adjustments or minimum version requirements.
affects: >=3.0.0 of @typescript-eslint/*
gotchaIncorrect 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.fixVerify 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.
affects: >=0.1.0
gotchaFailing 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.fixEnsure `@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`.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Plugin "tsdoc" was not found. Please check the plugin name, or consider installing it with npm.
The plugin name in the ESLint configuration `plugins` array is incorrect or missing the `eslint-plugin-` prefix.
fixChange `plugins: ['tsdoc']` to `plugins: ['eslint-plugin-tsdoc']` or ensure the package is correctly installed.
Parsing error: 'parserOptions.project' has been set for @typescript-eslint/parser. The file does not exist: /path/to/project/undefined
`parserOptions.project` or `tsconfigRootDir` is incorrectly configured, leading ESLint to look for a non-existent `tsconfig.json` file.
fixVerify 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`.
Rule 'tsdoc/syntax' is not found.
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.
fixEnsure `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.
Audit
Dependencies
eslintrequiredRequired for any ESLint plugin to function.
typescriptrequiredRequired by @typescript-eslint/parser to parse TypeScript code.
@typescript-eslint/eslint-pluginrequiredTypically used alongside to provide general TypeScript ESLint rules and parsing capabilities.
@typescript-eslint/parserrequiredRequired for ESLint to parse TypeScript files, which this plugin operates on.