Skip to content
tai-kun's Vite+ Lint Plugins
Esc
↑↓navigate↵open⌘Jpreview
On this page

jsdoc-param-order

Require `@param` tags to follow the order of function parameters.

  • Rule ID: tai-kun/jsdoc-param-order
  • Auto-fix: No

Compares the order of @param tags with the function signature and reports the first mismatch.

Configuration

Add the rule to lint.rules in vite.config.ts to enable it.

"tai-kun/jsdoc-param-order": "error",

Examples

Invalid

/**
 * @param b The second parameter.
 * @param a The first parameter.
 */
function f(a: string, b: number): void {}

Valid

/**
 * @param a The first parameter.
 * @param b The second parameter.
 */
function f(a: string, b: number): void {}

Notes

  • Supports function declarations, class methods, and exported functions.
  • Destructured parameters, missing or extra tags, and nested tags such as options.foo are ignored.
  • This rule reports only; it does not auto-fix.

Was this page helpful?