Skip to content

Commit

Permalink
[Refactor] no-anonymous-default-export: use fromEntries instead o…
Browse files Browse the repository at this point in the history
…f `reduce`
  • Loading branch information
ljharb committed Jul 28, 2023
1 parent 703e9f9 commit 89f5d0d
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/rules/no-anonymous-default-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,10 @@ const defs = {
},
};

const schemaProperties = Object.keys(defs)
.map((key) => defs[key])
.reduce((acc, def) => {
acc[def.option] = {
description: def.description,
type: 'boolean',
};

return acc;
}, {});
const schemaProperties = fromEntries(values(defs).map((def) => [def.option, {
description: def.description,
type: 'boolean',
}]));

const defaults = fromEntries(values(defs).map((def) => [def.option, has(def, 'default') ? def.default : false]));

Expand Down

0 comments on commit 89f5d0d

Please sign in to comment.