We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
VSCode IntelliSense is happy with these definitions in a JS file:
/** * @type {{quoteId: quoteSqlId} & SqlTag} * @typedef {( * tpl: string[], * ...interpolations: string[] * ) => [string, string[]]} SqlTag */ export const sql = (tpl, ...interpolations) => {return ['foo', ['bar']]}
...but JSDoc isn't:
DEBUG: JSDoc 3.6.6 (Sun, 20 Sep 2020 02:25:14 GMT) DEBUG: Environment info: {"env":{"conf":{"plugins":[],"recurseDepth":10,"source":{"includePattern":".+\\.js(doc|x)?$","excludePattern":"(^|\\/|\\\\)_"},"sourceType":"module","tags":{"allowUnknownTags":true,"dictionaries":["jsdoc","closure"]},"templates":{"monospaceLinks":false,"cleverLinks":false,"default":{"outputSourceFiles":true}}},"opts":{"_":["t.js"],"explain":true,"debug":true,"destination":"./out/","encoding":"utf8"}}} DEBUG: Parsing source files: ["/home/wmertens/Projects/strato-db/t.js"] Parsing /home/wmertens/Projects/strato-db/t.js ... ERROR: Unable to parse a tag's type expression for source file /home/wmertens/Projects/strato-db/t.js in line 1 with tag title "type" and text "{{quoteId: quoteSqlId} & SqlTag}": Invalid type expression "{quoteId: quoteSqlId} & SqlTag": Expected "|" but "&" found. ERROR: Unable to parse a tag's type expression for source file /home/wmertens/Projects/strato-db/t.js in line 1 with tag title "typedef" and text "{( tpl: string[], ...interpolations: string[] ) => [string, string[]]} SqlTag": Invalid type expression "( tpl: string[], ...interpolations: string[] ) => [string, string[]]": Expected "$", "'", ".", "0", "@", "\"", "\\", "_", "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "enum", "export", "extends", "finally", "for", "function", "if", "implements", "import", "in", "instanceof", "interface", "let", "new", "package", "private", "protected", "public", "return", "static", "super", "switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "yield", Unicode letter number, Unicode lowercase letter, Unicode modifier letter, Unicode other letter, Unicode titlecase letter, Unicode uppercase letter, or [1-9] but " " found. ERROR: Unable to parse a tag's type expression for source file /home/wmertens/Projects/strato-db/t.js in line 8 with tag title "type" and text "{{quoteId: quoteSqlId} & SqlTag}": Invalid type expression "{quoteId: quoteSqlId} & SqlTag": Expected "|" but "&" found. ERROR: Unable to parse a tag's type expression for source file /home/wmertens/Projects/strato-db/t.js in line 8 with tag title "typedef" and text "{( tpl: string[], ...interpolations: string[] ) => [string, string[]]} SqlTag": Invalid type expression "( tpl: string[], ...interpolations: string[] ) => [string, string[]]": Expected "$", "'", ".", "0", "@", "\"", "\\", "_", "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "enum", "export", "extends", "finally", "for", "function", "if", "implements", "import", "in", "instanceof", "interface", "let", "new", "package", "private", "protected", "public", "return", "static", "super", "switch", "this", "throw", "try", "typeof", "var", "void", "while", "with", "yield", Unicode letter number, Unicode lowercase letter, Unicode modifier letter, Unicode other letter, Unicode titlecase letter, Unicode uppercase letter, or [1-9] but " " found. DEBUG: Finished parsing source files. DEBUG: Adding inherited symbols, mixins, and interface implementations... DEBUG: Adding borrowed doclets... DEBUG: Post-processing complete.
It should not error but at most warn, and just assume that the whole thing is a valid type
A & B
(a: string[], ...b: string[]) => c
The text was updated successfully, but these errors were encountered:
I got a similar error and I just solved it: #1897 (comment) Hope it can helps you !
Sorry, something went wrong.
@Zargith thanks, but you're simply ignoring those files, right? I do want to use these types for documentation.
@wmertens told that because I mostly had the same error message but don't know if it could helps you 😅
Hey, sadly JsDoc does not support TypeScript types at the moment. The parser does not support it. See #1917
No branches or pull requests
Input code
VSCode IntelliSense is happy with these definitions in a JS file:
JSDoc debug output
...but JSDoc isn't:
Expected behavior
It should not error but at most warn, and just assume that the whole thing is a valid type
Current behavior
A & B
is not supported(a: string[], ...b: string[]) => c
is not supportedYour environment
The text was updated successfully, but these errors were encountered: