Open stoicbuddha opened 3 months ago
I'm almost certain that in source code if not in its docs, the original JSDoc tool called for whitespace after the initial /**
. However, as you are using the TypeScript mode (now the default also), we'd ideally be using comment parsing as used by TypeScript.
It does seem though that TSDoc, a spec/tool for parsing JSDoc comments for TypeScript, allows for no whitespace. Ideally then, we'd use a tool like @microsoft/tsdoc in place of comment-parser
. This might also be useful in a few other edge cases like #1116 .
However, this would most likely require a high degree of refactoring, and it is not one I am inclined to undertake myself (it'd also require changes in @es-joy/jsdoccomment
). A PR would be welcome, however.
Description:
When using JSDoc to define a typedef with an import statement, the linter fails with the rule jsdoc/no-undefined-types when the import statement is referencing a type defined in another file purely based on spacing.
Steps to Reproduce:
Define a JSDoc typedef with an import statement referencing a type from another file, for example: javascript
Expected Behavior:
The linter should recognize the import statement and not raise any errors for the typedef definition; for the sake of consistency, it should either error on both or error on neither.
Actual Behavior:
The linter fails on the import for
helperError
with the rule jsdoc/no-undefined-types, indicating that the imported type is undefined, despite being properly recognized by VS Code.Note that the following works properly and passes the linter:
The behavior is inconsistent.
ESLint Config
Environment
Node version: v18.19.1 ESLint Version: v8.57.0
eslint-plugin-jsdoc
: 48.2.1