Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
regseb opened this issue Jun 22, 2024 · 4 comments · Fixed by #1245, #1248 or femdevs/femdev-website#18
Closed

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

regseb opened this issue Jun 22, 2024 · 4 comments · Fixed by #1245, #1248 or femdevs/femdev-website#18

Comments

@regseb
Copy link
Contributor

regseb commented Jun 22, 2024

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
@brettz9
Copy link
Collaborator

brettz9 commented Jun 22, 2024

In order to parse import statements for use by our rule, I've filed TomerAberbach/parse-imports#10 as this package might help us do so.

Copy link

🎉 This issue has been resolved in version 48.2.14 🎉

The release is available on:

Your semantic-release bot 📦🚀

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 23, 2024
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 23, 2024
@brettz9
Copy link
Collaborator

brettz9 commented Jun 23, 2024

And sorry had to revert due to #1246 (no CJS build in the dependency), so reopening. I've filed TomerAberbach/parse-imports#12 in case the dependency can resolve this for us.

@brettz9 brettz9 reopened this Jun 23, 2024
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 23, 2024
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 23, 2024
brettz9 added a commit that referenced this issue Jun 24, 2024
Copy link

🎉 This issue has been resolved in version 48.3.0 🎉

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