Sitelet https://github.com/gajus/eslint-plugin-jsdoc/issues/1420
Skip to content

no-undefined-types errors when referencing property of interface defined in the same file #1420

Description

@saffr3n

Expected behavior

Both interface links act the same way.

Actual behavior

Imported interface works as expected, while interface defined in the same file yields the error.

ESLint Config

import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import jsdoc from "eslint-plugin-jsdoc";
import { defineConfig } from "eslint/config";

export default defineConfig([
  {
    files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
    plugins: { js },
    extends: ["js/recommended"],
  },
  {
    files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
    plugins: { jsdoc },
    ...jsdoc.configs["flat/recommended-typescript-error"],
  },
  {
    files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
    languageOptions: { globals: globals.node },
  },
  tseslint.configs.recommended,
  {
    rules: {
      "jsdoc/no-undefined-types": "error",
    },
  },
]);

ESLint sample

// some.ts
export interface SomeInterface1 {
  someProp: unknown;
}

// index.ts
import type { SomeInterface1 } from "./some";

export interface SomeInterface2 {
  someProp: unknown;
}

/**
 * {@link SomeInterface1.someProp} // No error
 * {@link SomeInterface2.someProp} // jsdoc/no-undefined-types: The type 'SomeInterface2.someProp' is undefined.
 * {@link SomeInterface2} // No error without specifying a property
 * @returns something
 */

Environment

  • Node version: 22.17.0
  • ESLint version 9.30.0
  • eslint-plugin-jsdoc version: 51.2.3

Activity

  1. added 2 commits that reference this issue on Jun 30, 2025
    97450f1
    f3a1708
  2. added a commit that references this issue on Jun 30, 2025
    3748bbe
  3. github-actions commented on Jun 30, 2025

    @github-actions

    🎉 This issue has been resolved in version 51.3.1 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions