Skip to content

Commit

Permalink
fix(rule-finder): use a safer extension filter
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolashenry committed May 21, 2020
1 parent 8f7f112 commit fdf20da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/rule-finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ function _isNotCore(rule) {

function RuleFinder(specifiedFile, {omitCore, includeDeprecated, ext = ['.js']}) {
const configFile = _getConfigFile(specifiedFile);
const files = glob.sync(`**/*@(${ ext.join('|') })`, {dot: true, matchBase: true});

const extensions = new Set(ext);
const files = glob.sync(`**/*`, {dot: true, matchBase: true})
.filter(file => extensions.has(path.extname(file)));

const config = _getConfig(configFile, files);
let currentRuleNames = _getCurrentNamesRules(config);
if (omitCore) {
Expand Down

0 comments on commit fdf20da

Please sign in to comment.