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 e1834d0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/standalone.js
Expand Up @@ -184,6 +184,20 @@ module.exports = function (options) {
fileCache.destroy();
}

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

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

return result;
}

return p;
});

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

0 comments on commit e1834d0

Please sign in to comment.