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
parser does not recognize JSDoc blocks without initial whitespace #1217
Comments
I'm almost certain that in source code if not in its docs, the original JSDoc tool called for whitespace after the initial 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 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 |
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.1The text was updated successfully, but these errors were encountered: