flowts icon indicating copy to clipboard operation
flowts copied to clipboard

Babel parse error

Open meandmax opened this issue 4 years ago • 2 comments

Not sure if it is valid to use multiline comments like this, any idea what could cause this?

Screen Shot 2021-06-21 at 2 08 16 pm
export const foo = (): string[] =>
    /**
     * Multiline comment
     **/
    bar();

meandmax avatar Jun 21 '21 04:06 meandmax

looks to be caused by prettier - filed bug report here: https://github.com/prettier/prettier/issues/11100

zxbodya avatar Jun 21 '21 10:06 zxbodya

while it is not fixed - one option is to not use prettier --no-prettier(but if you use it after - that still would be a problem),

or to refactor code before converting to use return statement - following will work fine:

const test = () => {
    /**
     * Multiline comment
     **/
     return bar();
}

zxbodya avatar Jun 21 '21 10:06 zxbodya