9

I have this Typescript interface definition.

interface CurrencyAmountProps {
  value: number;
  currency: string;
}

I am currently using prettier-standard this command to format Typescript files

"format": "prettier-standard --parser typescript --write --trailing-comma=all",

The problem with formatting is that prettier-standard removes the semicolons after the value and currency lines.

This is valid Typescript but it is causing some issue when I try to use react-intl-cra to extract formatted messages.

How can I make an exception for not removing semicolons in interfaces in prettier-standard?

developarvin
  • 4,940
  • 12
  • 54
  • 100

1 Answers1

5

You might be able to try tslint's "ignore-interfaces", depending on your setup: from the docs

"semicolon": [true, "never", "ignore-interfaces"]
bozdoz
  • 12,550
  • 7
  • 67
  • 96
  • This will also cause prettier not to add semicolons if there aren't already one, so I wouldn't consider it a full solution. – jeffkmeng Mar 09 '20 at 06:28