Skip to content

no-undefined-types doesn't know the @import types #1244

@regseb

Description

@regseb

Expected behavior

no-undefined-types doesn't repport an error if the type used has been imported with @import tag.

Actual behavior

no-undefined-types doesn't know the @import types.

Files

package.json

{
  "name": "testcase",
  "version": "1.0.0",
  "dependencies": {
    "eslint": "9.5.0",
    "eslint-plugin-jsdoc": "48.2.13"
  }
}

eslint.config.mjs

import jsdoc from "eslint-plugin-jsdoc";

export default [
    {
        plugins: { jsdoc },
        rules: {
            "jsdoc/no-undefined-types": "error"
        }
    }
];

index.js

/**
 * @import { Linter } from "eslint"
 */

/**
 * @type {Linter.Config}
 */
const config = {};

To reproduce

  1. npm install

  2. npx eslint index.js

     /home/regseb/testcase/index.js
       6:1  error  The type 'Linter' is undefined  jsdoc/no-undefined-types
    
     ✖ 1 problem (1 error, 0 warnings)
    

Environment

  • Node version: 20.14.0
  • ESLint version: 9.5.0
  • eslint-plugin-jsdoc version: 48.2.13

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions