Skip to content

Commit 6a735f3

Browse files
authored
Fix crash in esLint linter when meta.docs is undefined for a rule
FIX: Fix a crash in the `esLint` helper when a rule's `meta.docs` isn't defined.
1 parent 9f86da0 commit 6a735f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/eslint.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function esLint(eslint: any, config?: any) {
2323
rules: {}
2424
}
2525
eslint.getRules().forEach((desc: any, name: string) => {
26-
if (desc.meta.docs.recommended) config.rules[name] = 2
26+
if (desc.meta.docs?.recommended) config.rules[name] = 2
2727
})
2828
}
2929

0 commit comments

Comments
 (0)