Skip to content

require-template rule doesn't recognise typeParam as an alias for template #1609

@trikadin

Description

@trikadin

I searched for duplicates and didn't find any, sorry if I missed one. The bug presented both in CLI and IDE.

Repro:

eslint.config.js

// ... default config ...
settings: {
  jsdoc: {
    tagNamePreference: {
      template: 'typeParam',
    }
  }
},
rules: {
  'jsdoc/check-tag-names': 'error',
  'jsdoc/require-template': 'error',
}
// ... 

example.ts:

/**
 * Test interface for type definitions.
 *
 * @typeParam Foo - dummy type param
 */
export interface Test<Foo extends string> {
  /**
   *
   */
  bar: Foo;
}
eslint example.ts

Expected behavior

Success. No errors because typeParam is an alias for template (and check-tag-names checks and fixes this behavior if needed).

Actual behavior

ESLint fails. The following error printed:

error  Missing @template Foo              jsdoc/require-template

Environment

  • Node version: v22.21.1
  • ESLint version 9.26.0
  • eslint-plugin-jsdoc version: 50.6.17

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions