stylelint
stylelint copied to clipboard
Fix Node.js API glob returning empty array
Clearly describe the bug
The nodejs api is using globby to collect the scss files for linting. When used on windows it returns an empty array for the list of files in standalone.js - the filePaths is an empty array.

I've already opened a bug at https://github.com/sindresorhus/globby/issues/152
Workaround
It would be nice to have an option where I can provide the file paths on my own and not rely on any globbing so that I can pass a list of absolute file paths that should be linted.
Which version of stylelint are you using?
"version": "13.2.1"
How are you running stylelint: CLI, PostCSS plugin, Node.js API?
import { lint, LinterResult } from 'stylelint';
const files = ["./path/to/files/*.scss"];
lintingOutcome = await lint({
configFile: normalize(config),
configBasedir: process.cwd(),
files: files,
formatter: junitFormatter,
});
@lukasholzer Thanks for the report.
Can you try 13.8.0, please? This issue may have been fixed by https://github.com/stylelint/stylelint/pull/4931.
@jeddy3 Thx is now working with the latest version. The question even though is for me can we implement the feature of passing the files directly? As this might be way more performant if I need to run only for a limited set of files.
Are you willing to take contributions on that?
@lukasholzer yes we are. Can you open a new feature request for it?