Skip to content

Commit 84d78b7

Browse files
authored
fix error TypeError: Cannot read properties of undefined (reading 'type') in require-description rule (#2775)
* aa * aa
1 parent baf4619 commit 84d78b7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.changeset/pretty-moons-happen.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@graphql-eslint/eslint-plugin': patch
3+
---
4+
5+
fix error `TypeError: Cannot read properties of undefined (reading 'type')` in `require-description`
6+
rule

packages/plugin/src/rules/require-description/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ export const rule: GraphQLESLintRule<RuleOptions> = {
153153
);
154154
}
155155

156+
if (!kinds.size) {
157+
throw new Error('At least one kind must be enabled');
158+
}
159+
156160
const selector = [...kinds].join(',');
157161

158162
return {

0 commit comments

Comments
 (0)