ERROR: Unable to parse a tag's type expression for source file /Users/patrick.hund/IdeaProjects/code-kraken/src/config/getEnvConfig.mjs in line 41 with tag title "returns" and text "{| Config.SomeConfiguration
| Config.SomeOtherConfiguration
| Config.AnotherConfiguration
| Config.YetAnotherConfiguration}
The environment configuration": Invalid type expression "| Config.SomeConfiguration
| Config.SomeOtherConfiguration
| Config.AnotherConfiguration
| Config.YetAnotherConfiguration": Expected "!", "$", "'", "(", "*", ".", "...", "0", "?", "@", "Function", "\"", "\\", "_", "break", "case", "catch", "class", "const", "continue", "debugger", "default", "delete", "do", "else", "enum", "export", "extends", "false", "finally", "for", "function", "if", "implements", "import", "in", "instanceof", "interface", "let", "new", "null", "package", "private", "protected", "public", "return", "static", "super", "switch", "this", "throw", "true", "try", "typeof", "undefined", "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.
The culprit is the pipe character before Config.SomeConfiguration. If I manually format the JSDoc code like this, removing the pipe character, the syntax error does not happen:
Before formatting, by JSDoc for a return statement looks like this:
After running Prettier, the JSDoc comment is formatted like this:
Running JSDoc, this causes the following error:
The culprit is the pipe character before
Config.SomeConfiguration
. If I manually format the JSDoc code like this, removing the pipe character, the syntax error does not happen: