【问题标题】:glob to match all files except top-level vendor or any-depth node_modulesglob 匹配除顶级供应商或任何深度 node_modules 之外的所有文件
【发布时间】:2018-04-08 13:14:58
【问题描述】:

我正在尝试编写 glob 以匹配 .css.scss 文件,但忽略 vendor 并在任何嵌套深度忽略 node_modules

vendor/please-ignore.css
vendor/example/please-ignore.css
node_modules/any/please-ignore.css
other/please-match.css
other/example/please-match.css
other/node_modules/please-ignore.css
other/example/node_modules/please-ignore.css
another/please-match.css
another/example/please-match.css
another/node_modules/please-ignore.css
another/example/node_modules/please-ignore.css

我觉得我很接近。这成功地忽略了顶级vendornode_modules,但仍然匹配嵌套的node_modules

stylelint './!(vendor|node_modules)/**/*.?(s)css'

如何调整黑名单node_modules任意级别?

【问题讨论】:

    标签: node.js glob stylelint


    【解决方案1】:

    试试stylelint '**/!(vendor|node_modules)/*.?(s)css'

    这应该在任何嵌套深度忽略vendornode_modules,包括顶层。

    【讨论】:

      猜你喜欢
      • 2018-01-11
      • 2020-11-15
      • 2014-06-26
      • 2019-08-15
      • 1970-01-01
      • 2021-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多