Preserve then() catch() format when using Prettier JS

Viewed 2156

I just started using the PrettierJS Plugin for VSCode and I am looking for a way to preserve my code format of my service calls (and subsequent Promises).

I know you can add the //prettier-ignore comments just before the code block to preserve the code pattern, but since i do this all over my app, i do not want to add that comment-line everywhere.

Right now, my code block looks like this:

       return this.thingService.addThing(newThing)
            .then(wonFunction)
            .catch(lostFunction);

But when i do the Prettier format command i get this:

    return this.accessData.addRight(newRight).then(wonAddAccessRight).catch(lostAddAccessRight);

I want a way to preserve my code blocks from changing without using the //prettier-ignore comments.

1 Answers
Related