-
-
Notifications
You must be signed in to change notification settings - Fork 158
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 reports an undefined type that is defined #144
Comments
Could you include your typedef and your relevant eslint config? |
That type is not the only one with that problem, there are a few others. Those are all /**
* @global
* @typedef {string} SHA256Hash
*/ In the jsdoc3 HTML output all those types are clickable (types defined as @global get an extra page, types only visible within a module get no link), so jsdoc3 found the typedef. JSDoc rules — by now I disabled all the rules that caused errors for no good reason though:
|
One issue is that Here's the test I used that passes: {
code: `
/**
* @global
* @typedef {string} SHA256Hash
*/
/**
* @private
* @param {SHA256Hash} foo
*/
function quux(foo) {
}
`,
globals: {
SHA256Hash: true
}
}, I think you issue is a little more higher level. ESLint doesn't look like it is interfacing with your IDE to pass the global typedefs. I'm not too experienced in this field. Maybe @gajus knows more about this. |
I used the IDE for the nice screenshot, it's of course the same on the command line. Your test does not help, most uses of that type in all files, and it is one used everywhere, cause no problem. I even chose an example where it is and isn't a problem at the same time. I don't understand the "Promise" part, I didn't post anything about a problem with a base type so that seems to be a problem you are having, well... And another thing about your comment about the IDE: The IDE merely displays what running eslint produces in messages. That's why that popup starts with the name of the tool tool that produced the displayed message. In any case it has noting to do with this issue. |
By doing |
@PLASMAchicken I already have exactly that set in my .eslintrc.js |
If the I therefore think this can be closed as a dupe of 99. As far as "rules that caused errors for no good reason though", we'd need a more specific (and reduced) test case. |
@ibbignerd : Re: @PLASMAchicken : If you are using Node/commonjs, and not actually using ESM, PR #222 may solve an issue whereby |
Closed as duplicate of #99 |
v3.15.1
Even within the same file for the exact same type I get both no error and an error about the type being undefined. All errors of this kind are for types defined with
@typedef
and@global
in other files.The text was updated successfully, but these errors were encountered: