Skip to content

Commit 0b82629

Browse files
committed
Fix case in flat config when a file doesn't have any rules configured
In flat config the resolved config is "undefined" for files that don't have any configuration, which caused an error in the CLI utility, unlike in legacy ESLint configuration where the empty resolved configuration is an empty object with an empty "rules: {}".
1 parent cdc4a5c commit 0b82629

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bin/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if (module === require.main) {
6060
})
6161
)
6262
.then((configs) => {
63-
const rules = configs.flatMap(({ rules }, index) =>
63+
const rules = configs.flatMap(({ rules = {} } = {}, index) =>
6464
Object.entries(rules).map((entry) => [...entry, args[index]])
6565
);
6666
const result = processRules(rules);

0 commit comments

Comments
 (0)