3 const micromatch = require("micromatch");
4 const path = require("path");
6 // To find out if a path is ignored, we need to load the config,
7 // which may have an ignoreFiles property. We then check the path
9 module.exports = function(
10 stylelint /*: stylelint$internalApi*/,
11 filePathArg /*:: ?: string*/
12 ) /*: Promise<boolean>*/ {
13 const filePath = filePathArg; // to please Flow
15 return Promise.resolve(false);
18 return stylelint.getConfigForFile(filePath).then(result => {
19 const config = result.config;
20 const absoluteFilePath = path.isAbsolute(filePath)
22 : path.resolve(process.cwd(), filePath);
23 if (micromatch(absoluteFilePath, config.ignoreFiles).length) {