Open
Description
Is your feature request related to a problem? Please describe.
Now that Eslint 9 allows JS configs, you can use type safety around rules
You can currently access types via
import type graphqlPlugin from '@graphql-eslint/eslint-plugin';
type Groups = Partial<typeof graphqlPlugin['configs']>
type GraphQLRules = Partial<NonNullable<Groups[keyof Groups]>['rules']>;
const graphqlRules = {
'@graphql-eslint/alphabetize': [
'error',
{
selections: ['OperationDefinition']
},
],
} satisfies GraphQLRules;
export default graphqlRules;
However this produces error
Type '{ selections: string[]; }' is missing the following properties from type '{ definitions: boolean; selections: string[]; variables: boolean; arguments: string[]; groups: string[]; }': definitions, variables, arguments, groupsts(2739)
Despite the docs implying that you don't need to set all arguments to the rule
Describe the solution you'd like
Expose GraphQLRules
as a export (to avoid the consumer having to dig for it), and correctly type optional fields
Describe alternatives you've considered
Additional context
Metadata
Metadata
Assignees
Labels
No labels