Skip to content

Commit 2f6c02f

Browse files
authored
make RuleDocsInfo type optional (#1167)
* make `RuleDocsInfo` type optional * fix lint
1 parent eab5492 commit 2f6c02f

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.changeset/tough-apes-deny.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@graphql-eslint/eslint-plugin': patch
3+
---
4+
5+
make `RuleDocsInfo` type optional

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ jobs:
1111
releaseScript: release
1212
nodeVersion: 18
1313
secrets:
14-
githubToken: ${{ secrets.GUILD_BOT_TOKEN }}
14+
githubToken: ${{ secrets.GITHUB_TOKEN }}
1515
npmToken: ${{ secrets.NPM_TOKEN }}

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
with:
1414
script: yarn ci:lint
1515
secrets:
16-
githubToken: ${{ secrets.GUILD_BOT_TOKEN }}
16+
githubToken: ${{ secrets.GITHUB_TOKEN }}
1717

1818
typecheck:
1919
name: typecheck / graphql v${{matrix.graphql_version}}

packages/plugin/src/types.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,8 @@ export type GraphQLESLintRuleContext<Options = any[]> = Omit<
5252

5353
export type CategoryType = 'Schema' | 'Operations';
5454

55-
export type RuleDocsInfo<T> = {
56-
description: string;
55+
export type RuleDocsInfo<T> = Omit<Rule.RuleMetaData['docs'], 'category' | 'suggestion'> & {
5756
category: CategoryType | CategoryType[];
58-
recommended?: boolean;
59-
url: string;
6057
requiresSchema?: true;
6158
requiresSiblings?: true;
6259
examples?: {
@@ -77,7 +74,7 @@ export type RuleDocsInfo<T> = {
7774
export type GraphQLESLintRule<Options = any[], WithTypeInfo extends boolean = false> = {
7875
create(context: GraphQLESLintRuleContext<Options>): GraphQLESLintRuleListener<WithTypeInfo>;
7976
meta: Omit<Rule.RuleMetaData, 'docs'> & {
80-
docs: RuleDocsInfo<Options>;
77+
docs?: RuleDocsInfo<Options>;
8178
};
8279
};
8380

0 commit comments

Comments
 (0)