-
Notifications
You must be signed in to change notification settings - Fork 109
Labels
kind/enhancementNew feature or requestNew feature or requeststage/6-releasedThe issue has been solved on a released version of the libraryThe issue has been solved on a released version of the library
Description
Issue workflow progress
Progress of the issue based on the Contributor Workflow
- 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
Please make sure the graphql-eslint version under
package.jsonmatches yours.
- 2. A failing test has been provided
- 3. A local solution has been provided
- 4. A pull request is pending review
Describe the bug
Hi 👋
This is just a small thing that I discovered when I wanted to add urls to our rules and TS didn't like it with the strict flag on, because url wasn't part of RuleDocsInfo.
I took a closer look and discovered that the problem is caused by docs being optional, and therefore the type returned by Omit<Rule.RuleMetaData['docs'], 'category'> is {}.
export type RuleDocsInfo<T> = {
docs: Omit<Rule.RuleMetaData['docs'], 'category'> & { <<<<<
category: CategoryType | CategoryType[];
requiresSchema?: true;
requiresSiblings?: true;
...
};
};
To Reproduce
Expected behavior
I think you wanted to keep all the properties from docs except for category, so that should be happening.
Proposed solution
Adding Required solves it.
Environment:
- OS: MacOS Monterey
@graphql-eslint/eslint-plugin: 3.10.7- Node.js: 16
dimaMachina
Metadata
Metadata
Assignees
Labels
kind/enhancementNew feature or requestNew feature or requeststage/6-releasedThe issue has been solved on a released version of the libraryThe issue has been solved on a released version of the library

