jsdoc/require-yields-type 严谨
它的作用
要求 @yields 标签带有类型。
为什么这不好?
@yields 标签应当记录生成器产出的类型。
示例
以下是此规则的错误代码示例:
js
/** @yields */
function* quux() {}以下是此规则的正确代码示例:
js
/** @yields {string} */
function* quux() {}如何使用
To enable this rule using the config file or in the CLI, you can use:
json
{
"plugins": ["jsdoc"],
"rules": {
"jsdoc/require-yields-type": "error"
}
}ts
import { defineConfig } from "oxlint";
export default defineConfig({
plugins: ["jsdoc"],
rules: {
"jsdoc/require-yields-type": "error",
},
});bash
oxlint --deny jsdoc/require-yields-type --jsdoc-plugin版本
此规则已在 v1.65.0 中添加。
