简体   繁体   中英

How can I prevent prettier behavior

i want formating like this

  @Matches(
    /^[a-zA-Z0-9_.-]*$/,{
      message: 'Please try again'
    })

Prettier reformat to

  @Matches(
    /^[a-zA-Z0-9_.-]*$/,
    {
      message: 'Please try again'
    }
  )

I dont want to disable prettier, i have .prettierrc file in root for configuration

您需要编辑根文件夹中的.prettierignore文件。

To exclude files from formatting, add entries to a .prettierignore file in the project root or set the --ignore-path CLI option. .prettierignore uses gitignore syntax.

https://prettier.io/docs/en/ignore.html

Hope this helps.

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