Skip to content

Commit

Permalink
chore: basename
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Mar 15, 2019
1 parent c5cea04 commit 2555110
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Expand Up @@ -7,7 +7,10 @@ const rules = fs
.readdirSync(path.join(__dirname, 'rules'))
.filter(rule => rule !== '__tests__' && rule !== 'util.js')
.reduce(
(acc, curr) => Object.assign(acc, { [curr]: require(`./rules/${curr}`) }),
(acc, curr) =>
Object.assign(acc, {
[path.basename(curr, '.js')]: require(`./rules/${curr}`),
}),
{}
);

Expand Down

0 comments on commit 2555110

Please sign in to comment.