【问题标题】:How to Ignore all folders with folder pattern using prettier如何使用更漂亮的文件夹模式忽略所有文件夹
【发布时间】:2022-10-24 22:34:05
【问题描述】:

当我在项目的根文件夹中执行以下命令时,所有文件都会按照我的预期递归运行。

更漂亮 --write "**/*.{js,ts}"

但是,我想忽略这些子文件夹中以 ./next 或 ./old 开头的所有文件夹。我怎样才能做到这一点?我已经尝试了以下命令,但它们不会忽略这些文件夹

更漂亮 --write "**/*.{js,ts}" --ignore-path ".next"

更漂亮——写“/*.{js,ts}" --ignore-path "/.next"

【问题讨论】:

    标签: prettier nsregularexpression prettier-eslint


    【解决方案1】:

    您可以将.next/.next 添加到.prettierignore 文件中。

    -- 忽略路径是the path to a file containing patterns that describe files to ignore;这不是要忽略的文件夹!

    请阅读this

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-15
      • 2018-03-07
      • 2017-06-22
      • 2015-12-25
      • 2019-07-14
      • 2014-05-06
      • 2021-06-21
      • 2020-03-14
      相关资源
      最近更新 更多