Skip to content

Commit

Permalink
Escape square brackets before globby fixes stylelint#4855
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyunsuk Jo committed Jul 13, 2020
1 parent 909063d commit 4b1c12e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/standalone.js
Expand Up @@ -184,6 +184,18 @@ module.exports = function (options) {
fileCache.destroy();
}

// Escape square brackets
fileList = fileList.map((p) => {
let path = p;

if (path.match(/[[\]]/g)) {
path = path.split('[').join('\\[');
path = path.split(']').join('\\]');
}

return path;
});

return globby(fileList, globbyOptions)
.then((filePaths) => {
// The ignorer filter needs to check paths relative to cwd
Expand Down

0 comments on commit 4b1c12e

Please sign in to comment.