Skip to content
← Back to rules

jsdoc/require-param-description Pedantic

🚧 An auto-fix is planned for this rule, but not implemented at this time.

它的作用

要求每个 @param 标签都有描述值。

为什么这不好?

参数的描述应该被记录下来。

示例

此规则的错误代码示例:

javascript
/** @param foo */
function quux(foo) {}

此规则的正确代码示例:

javascript
/** @param foo Foo. */
function quux(foo) {}

如何使用

To enable this rule using the config file or in the CLI, you can use:

json
{
  "plugins": ["jsdoc"],
  "rules": {
    "jsdoc/require-param-description": "error"
  }
}
ts
import { defineConfig } from "oxlint";

export default defineConfig({
  plugins: ["jsdoc"],
  rules: {
    "jsdoc/require-param-description": "error",
  },
});
bash
oxlint --deny jsdoc/require-param-description --jsdoc-plugin

版本

此规则于 v0.4.4 中添加。

参考