【问题标题】:npm specifying path for prettiernpm 指定更漂亮的路径
【发布时间】:2021-04-26 20:06:44
【问题描述】:

我无法得到更漂亮的工作。

这是我在 package.json 中添加的脚本

"prettier:write": "prettier --write 'src/*.{ts}'"

当我运行 npm run prettier:write 时,它会说

No files matching the pattern were found: "src/*.{ts}".

这是我的目录

我也试过

prettier --write '/src/*.{ts}

prettier --write './src/*.{ts}

【问题讨论】:

    标签: node.js npm prettier


    【解决方案1】:

    尝试将模式更改为:

    "prettier:write": "prettier --write 'src/*.ts'",
    

    【讨论】:

      【解决方案2】:

      感觉你的 glob 有问题。

      尝试从 'src/*.{ts}' 更改为 'src/**/*.ts'

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-11-21
        • 2012-05-26
        • 2016-09-01
        • 1970-01-01
        • 1970-01-01
        • 2021-06-22
        • 2017-01-04
        • 1970-01-01
        相关资源
        最近更新 更多