You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before formatting, by JSDoc for a return statement looks like this:
/** * Gets a configuration object assembled from environment variables and .env configuration files. * * @memberof Config * @function getEnvConfig * @returns {Config.SomeConfiguration | Config.SomeOtherConfiguration | Config.AnotherConfiguration | Config.YetAnotherConfiguration } The environment configuration */exportdefault()=>configurator.config;
After running Prettier, the JSDoc comment is formatted like this:
/** * Gets a configuration object assembled from environment variables and .env configuration files. * * @memberof Config * @function getEnvConfig * @returns {| Config.SomeConfiguration * | Config.SomeOtherConfiguration * | Config.AnotherConfiguration * | Config.YetAnotherConfiguration} * The environment configuration */exportdefault()=>configurator.config;
Running JSDoc, this causes the following error:
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:
/** * Gets a configuration object assembled from environment variables and .env configuration files. * * @memberof Config * @function getEnvConfig * @returns {Config.SomeConfiguration * | Config.SomeOtherConfiguration * | Config.AnotherConfiguration * | Config.YetAnotherConfiguration} * The environment configuration */exportdefault()=>configurator.config;
The text was updated successfully, but these errors were encountered:
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:The text was updated successfully, but these errors were encountered: