简体   繁体   English

我怎样才能防止更漂亮的行为

[英]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我不想禁用 prettier,我在 root 中有 .prettierrc 文件用于配置

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

To exclude files from formatting, add entries to a .prettierignore file in the project root or set the --ignore-path CLI option.要从格式中排除文件,请将条目添加到项目根目录中的 .prettierignore 文件或设置 --ignore-path CLI 选项。 .prettierignore uses gitignore syntax. .prettierignore 使用 gitignore 语法。

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

Hope this helps.希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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