Stylelint: Globbing with ** does not include subdirectories

Created on 15 Mar 2017  Â·  3Comments  Â·  Source: stylelint/stylelint

Describe the issue. Is it a bug or a feature request (new rule, new option, etc.)?

Bug in globbing.

The README examples here: https://github.com/stylelint/stylelint/blob/master/docs/user-guide/cli.md#examples mention:

"Using bar/mySpecialConfig.json as config, with quiet mode on, to lint all .css files in the foo directory and any of its subdirectories and also all .css files in the bar directory, then writing the JSON-formatted output to myJsonReport.json:"

stylelint "foo/**/*.css bar/*.css" -q -f json --config bar/mySpecialConfig.json > myJsonReport.json

But this does not detect errors in foo/bar/qux/style.css. If I set to foo/**/**/*.css it finds errors in qux but not styles in bar

Which rule, if any, is this issue related to?

N/A

What CSS is needed to reproduce this issue?

.foo {
          color: pink;
}

(would fail for improper indentation)

What stylelint configuration is needed to reproduce this issue?

I would expect any configuration would have this problem. I'm using:

{
  "extends": "stylelint-config-standard",
  "rules": {
    "shorthand-property-no-redundant-values": null,
    "selector-pseudo-class-no-unknown": [true, {
      "ignorePseudoClasses": ["global"]
    }],
    "function-name-case": ["lower", {
      "ignoreFunctions": [
        "/fontSize/",
        "/lineHeight/"
      ]
    }]
  }
}

Which version of stylelint are you using?

7.8.0

How are you running stylelint: CLI, PostCSS plugin, Node API?

stylelint src/css/**/*.css

Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?

No

What did you expect to happen?

I expect it to include errors in styles in src/css/foo/bar/styles.css

What actually happened (e.g. what warnings or errors you are getting)?

No errors are reported

Most helpful comment

@bdefore unless your terminal-of-choice supports this kind of globbing, you need to wrap your glob in quotation marks to pass it through to stylelint. Instead of stylelint src/css/**/*.css, do stylelint "src/css/**/*.css".

All 3 comments

@bdefore unless your terminal-of-choice supports this kind of globbing, you need to wrap your glob in quotation marks to pass it through to stylelint. Instead of stylelint src/css/**/*.css, do stylelint "src/css/**/*.css".

@davidtheclark thanks. i was encountering this issue in bash, but can confirm that wrapping in quotes works.

cross-env stylelint "src/*/.less src/*.less" --config .stylelintrc --color --cache --syntax less

src/components/App.less
21:32 ✖ Expected "#F70" to be "#f70" color-hex-case

src/index.less
5:10 ✖ Expected "#FFF" to be "#fff" color-hex-case

cross-env stylelint "src/*/.less" --config .stylelintrc --color --cache --syntax less

src/components/App.less
21:32 ✖ Expected "#F70" to be "#f70" color-hex-case

cross-env stylelint "src/*.less" --config .stylelintrc --color --cache --syntax less

src/index.less
5:10 ✖ Expected "#FFF" to be "#fff" color-hex-case

Could you know what I want to say, it's a bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ntwb picture ntwb  Â·  3Comments

devsnice picture devsnice  Â·  3Comments

m-allanson picture m-allanson  Â·  3Comments

Havunen picture Havunen  Â·  3Comments

Linxflasher picture Linxflasher  Â·  3Comments