Skip to content
Advertisement

Stylelint skips entire folders

I have stylelint installed in my project, and I’ve configured its configuration. I added a script to run this linter on my src folder.

For some reason, the linter scans only one folder.

Here is my configuration file stylelint.config.js:

JavaScript

This is the script: "stylelint": "stylelint --f verbose src/**/*.scss",

My src folder has a lot of .scss files. But this script only scans 2 files for some reason.

JavaScript

Why would it ignores all other files? I don’t have some “ignore” configuration file.

NOTE: It worked on Windows perfect (didn’t skip), on Mac it skips almost the entire src file

Also when I change the script to run stylelint ... **/*.scss it does work

Advertisement

Answer

You need to quote your input glob, otherwise the shell (which differs on Windows and Mac) will interpret it rather than Stylelint itself.

If you’re only targeting *nix, you can use single quotes:

JavaScript

For cross-platform use escaped double quotes:

JavaScript

Incidentally, you:

  • can remove the plugins property as both plugins are bundled in their respective configs
  • should put the prettier config last so that it overrides everything before
JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement