简体   繁体   中英

Prevent prettier-standard from removing semicolons in Typescript interfaces

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 ?

您也许可以尝试 tslint 的“ignore-interfaces”,具体取决于您的设置:来自文档

"semicolon": [true, "never", "ignore-interfaces"]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM