@graphql-eslint/eslint-plugin
Version:
GraphQL plugin for ESLint
442 lines (440 loc) • 20.6 kB
TypeScript
declare const configs: {
'schema-recommended': {
parser: string;
plugins: string[];
rules: {
'@graphql-eslint/description-style': "error";
'@graphql-eslint/known-argument-names': "error";
'@graphql-eslint/known-directives': "error";
'@graphql-eslint/known-type-names': "error";
'@graphql-eslint/lone-schema-definition': "error";
'@graphql-eslint/naming-convention': ["error", {
types: string;
FieldDefinition: string;
InputValueDefinition: string;
Argument: string;
DirectiveDefinition: string;
EnumValueDefinition: string;
'FieldDefinition[parent.name.value=Query]': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'FieldDefinition[parent.name.value=Mutation]': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'FieldDefinition[parent.name.value=Subscription]': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'EnumTypeDefinition,EnumTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'InterfaceTypeDefinition,InterfaceTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'UnionTypeDefinition,UnionTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'ObjectTypeDefinition,ObjectTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
}];
'@graphql-eslint/no-hashtag-description': "error";
'@graphql-eslint/no-typename-prefix': "error";
'@graphql-eslint/no-unreachable-types': "error";
'@graphql-eslint/possible-type-extension': "error";
'@graphql-eslint/provided-required-arguments': "error";
'@graphql-eslint/require-deprecation-reason': "error";
'@graphql-eslint/require-description': ["error", {
types: boolean;
DirectiveDefinition: boolean;
rootField: boolean;
}];
'@graphql-eslint/strict-id-in-types': "error";
'@graphql-eslint/unique-directive-names': "error";
'@graphql-eslint/unique-directive-names-per-location': "error";
'@graphql-eslint/unique-enum-value-names': "error";
'@graphql-eslint/unique-field-definition-names': "error";
'@graphql-eslint/unique-operation-types': "error";
'@graphql-eslint/unique-type-names': "error";
};
};
'schema-all': {
extends: string;
rules: {
'@graphql-eslint/alphabetize': ["error", {
definitions: boolean;
fields: string[];
values: boolean;
arguments: string[];
groups: string[];
}];
'@graphql-eslint/input-name': "error";
'@graphql-eslint/no-root-type': ["error", {
disallow: string[];
}];
'@graphql-eslint/no-scalar-result-type-on-mutation': "error";
'@graphql-eslint/require-deprecation-date': "error";
'@graphql-eslint/require-field-of-type-query-in-mutation-result': "error";
'@graphql-eslint/require-nullable-fields-with-oneof': "error";
'@graphql-eslint/require-nullable-result-in-root': "error";
'@graphql-eslint/require-type-pattern-with-oneof': "error";
};
};
'schema-relay': {
parser: string;
plugins: string[];
rules: {
'@graphql-eslint/relay-arguments': "error";
'@graphql-eslint/relay-connection-types': "error";
'@graphql-eslint/relay-edge-types': "error";
'@graphql-eslint/relay-page-info': "error";
};
};
'operations-recommended': {
parser: string;
plugins: string[];
rules: {
'@graphql-eslint/executable-definitions': "error";
'@graphql-eslint/fields-on-correct-type': "error";
'@graphql-eslint/fragments-on-composite-type': "error";
'@graphql-eslint/known-argument-names': "error";
'@graphql-eslint/known-directives': "error";
'@graphql-eslint/known-fragment-names': "error";
'@graphql-eslint/known-type-names': "error";
'@graphql-eslint/lone-anonymous-operation': "error";
'@graphql-eslint/naming-convention': ["error", {
VariableDefinition: string;
OperationDefinition: {
style: string;
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
FragmentDefinition: {
style: string;
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
}];
'@graphql-eslint/no-anonymous-operations': "error";
'@graphql-eslint/no-deprecated': "error";
'@graphql-eslint/no-duplicate-fields': "error";
'@graphql-eslint/no-fragment-cycles': "error";
'@graphql-eslint/no-undefined-variables': "error";
'@graphql-eslint/no-unused-fragments': "error";
'@graphql-eslint/no-unused-variables': "error";
'@graphql-eslint/one-field-subscriptions': "error";
'@graphql-eslint/overlapping-fields-can-be-merged': "error";
'@graphql-eslint/possible-fragment-spread': "error";
'@graphql-eslint/provided-required-arguments': "error";
'@graphql-eslint/require-selections': "error";
'@graphql-eslint/scalar-leafs': "error";
'@graphql-eslint/selection-set-depth': ["error", {
maxDepth: number;
}];
'@graphql-eslint/unique-argument-names': "error";
'@graphql-eslint/unique-directive-names-per-location': "error";
'@graphql-eslint/unique-fragment-name': "error";
'@graphql-eslint/unique-input-field-names': "error";
'@graphql-eslint/unique-operation-name': "error";
'@graphql-eslint/unique-variable-names': "error";
'@graphql-eslint/value-literals-of-correct-type': "error";
'@graphql-eslint/variables-are-input-types': "error";
'@graphql-eslint/variables-in-allowed-position': "error";
};
};
'operations-all': {
extends: string;
rules: {
'@graphql-eslint/alphabetize': ["error", {
definitions: boolean;
selections: string[];
variables: boolean;
arguments: string[];
groups: string[];
}];
'@graphql-eslint/lone-executable-definition': "error";
'@graphql-eslint/match-document-filename': ["error", {
query: string;
mutation: string;
subscription: string;
fragment: string;
}];
'@graphql-eslint/no-one-place-fragments': "error";
'@graphql-eslint/require-import-fragment': "error";
};
};
'flat/schema-recommended': {
rules: {
'@graphql-eslint/description-style': "error";
'@graphql-eslint/known-argument-names': "error";
'@graphql-eslint/known-directives': "error";
'@graphql-eslint/known-type-names': "error";
'@graphql-eslint/lone-schema-definition': "error";
'@graphql-eslint/naming-convention': ["error", {
types: string;
FieldDefinition: string;
InputValueDefinition: string;
Argument: string;
DirectiveDefinition: string;
EnumValueDefinition: string;
'FieldDefinition[parent.name.value=Query]': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'FieldDefinition[parent.name.value=Mutation]': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'FieldDefinition[parent.name.value=Subscription]': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'EnumTypeDefinition,EnumTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'InterfaceTypeDefinition,InterfaceTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'UnionTypeDefinition,UnionTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'ObjectTypeDefinition,ObjectTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
}];
'@graphql-eslint/no-hashtag-description': "error";
'@graphql-eslint/no-typename-prefix': "error";
'@graphql-eslint/no-unreachable-types': "error";
'@graphql-eslint/possible-type-extension': "error";
'@graphql-eslint/provided-required-arguments': "error";
'@graphql-eslint/require-deprecation-reason': "error";
'@graphql-eslint/require-description': ["error", {
types: boolean;
DirectiveDefinition: boolean;
rootField: boolean;
}];
'@graphql-eslint/strict-id-in-types': "error";
'@graphql-eslint/unique-directive-names': "error";
'@graphql-eslint/unique-directive-names-per-location': "error";
'@graphql-eslint/unique-enum-value-names': "error";
'@graphql-eslint/unique-field-definition-names': "error";
'@graphql-eslint/unique-operation-types': "error";
'@graphql-eslint/unique-type-names': "error";
};
};
'flat/schema-all': {
rules: {
'@graphql-eslint/alphabetize': ["error", {
definitions: boolean;
fields: string[];
values: boolean;
arguments: string[];
groups: string[];
}];
'@graphql-eslint/input-name': "error";
'@graphql-eslint/no-root-type': ["error", {
disallow: string[];
}];
'@graphql-eslint/no-scalar-result-type-on-mutation': "error";
'@graphql-eslint/require-deprecation-date': "error";
'@graphql-eslint/require-field-of-type-query-in-mutation-result': "error";
'@graphql-eslint/require-nullable-fields-with-oneof': "error";
'@graphql-eslint/require-nullable-result-in-root': "error";
'@graphql-eslint/require-type-pattern-with-oneof': "error";
'@graphql-eslint/description-style': "error";
'@graphql-eslint/known-argument-names': "error";
'@graphql-eslint/known-directives': "error";
'@graphql-eslint/known-type-names': "error";
'@graphql-eslint/lone-schema-definition': "error";
'@graphql-eslint/naming-convention': ["error", {
types: string;
FieldDefinition: string;
InputValueDefinition: string;
Argument: string;
DirectiveDefinition: string;
EnumValueDefinition: string;
'FieldDefinition[parent.name.value=Query]': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'FieldDefinition[parent.name.value=Mutation]': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'FieldDefinition[parent.name.value=Subscription]': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'EnumTypeDefinition,EnumTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'InterfaceTypeDefinition,InterfaceTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'UnionTypeDefinition,UnionTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
'ObjectTypeDefinition,ObjectTypeExtension': {
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
}];
'@graphql-eslint/no-hashtag-description': "error";
'@graphql-eslint/no-typename-prefix': "error";
'@graphql-eslint/no-unreachable-types': "error";
'@graphql-eslint/possible-type-extension': "error";
'@graphql-eslint/provided-required-arguments': "error";
'@graphql-eslint/require-deprecation-reason': "error";
'@graphql-eslint/require-description': ["error", {
types: boolean;
DirectiveDefinition: boolean;
rootField: boolean;
}];
'@graphql-eslint/strict-id-in-types': "error";
'@graphql-eslint/unique-directive-names': "error";
'@graphql-eslint/unique-directive-names-per-location': "error";
'@graphql-eslint/unique-enum-value-names': "error";
'@graphql-eslint/unique-field-definition-names': "error";
'@graphql-eslint/unique-operation-types': "error";
'@graphql-eslint/unique-type-names': "error";
};
};
'flat/schema-relay': {
rules: {
'@graphql-eslint/relay-arguments': "error";
'@graphql-eslint/relay-connection-types': "error";
'@graphql-eslint/relay-edge-types': "error";
'@graphql-eslint/relay-page-info': "error";
};
};
'flat/operations-recommended': {
rules: {
'@graphql-eslint/executable-definitions': "error";
'@graphql-eslint/fields-on-correct-type': "error";
'@graphql-eslint/fragments-on-composite-type': "error";
'@graphql-eslint/known-argument-names': "error";
'@graphql-eslint/known-directives': "error";
'@graphql-eslint/known-fragment-names': "error";
'@graphql-eslint/known-type-names': "error";
'@graphql-eslint/lone-anonymous-operation': "error";
'@graphql-eslint/naming-convention': ["error", {
VariableDefinition: string;
OperationDefinition: {
style: string;
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
FragmentDefinition: {
style: string;
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
}];
'@graphql-eslint/no-anonymous-operations': "error";
'@graphql-eslint/no-deprecated': "error";
'@graphql-eslint/no-duplicate-fields': "error";
'@graphql-eslint/no-fragment-cycles': "error";
'@graphql-eslint/no-undefined-variables': "error";
'@graphql-eslint/no-unused-fragments': "error";
'@graphql-eslint/no-unused-variables': "error";
'@graphql-eslint/one-field-subscriptions': "error";
'@graphql-eslint/overlapping-fields-can-be-merged': "error";
'@graphql-eslint/possible-fragment-spread': "error";
'@graphql-eslint/provided-required-arguments': "error";
'@graphql-eslint/require-selections': "error";
'@graphql-eslint/scalar-leafs': "error";
'@graphql-eslint/selection-set-depth': ["error", {
maxDepth: number;
}];
'@graphql-eslint/unique-argument-names': "error";
'@graphql-eslint/unique-directive-names-per-location': "error";
'@graphql-eslint/unique-fragment-name': "error";
'@graphql-eslint/unique-input-field-names': "error";
'@graphql-eslint/unique-operation-name': "error";
'@graphql-eslint/unique-variable-names': "error";
'@graphql-eslint/value-literals-of-correct-type': "error";
'@graphql-eslint/variables-are-input-types': "error";
'@graphql-eslint/variables-in-allowed-position': "error";
};
};
'flat/operations-all': {
rules: {
'@graphql-eslint/alphabetize': ["error", {
definitions: boolean;
selections: string[];
variables: boolean;
arguments: string[];
groups: string[];
}];
'@graphql-eslint/lone-executable-definition': "error";
'@graphql-eslint/match-document-filename': ["error", {
query: string;
mutation: string;
subscription: string;
fragment: string;
}];
'@graphql-eslint/no-one-place-fragments': "error";
'@graphql-eslint/require-import-fragment': "error";
'@graphql-eslint/executable-definitions': "error";
'@graphql-eslint/fields-on-correct-type': "error";
'@graphql-eslint/fragments-on-composite-type': "error";
'@graphql-eslint/known-argument-names': "error";
'@graphql-eslint/known-directives': "error";
'@graphql-eslint/known-fragment-names': "error";
'@graphql-eslint/known-type-names': "error";
'@graphql-eslint/lone-anonymous-operation': "error";
'@graphql-eslint/naming-convention': ["error", {
VariableDefinition: string;
OperationDefinition: {
style: string;
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
FragmentDefinition: {
style: string;
forbiddenPrefixes: string[];
forbiddenSuffixes: string[];
};
}];
'@graphql-eslint/no-anonymous-operations': "error";
'@graphql-eslint/no-deprecated': "error";
'@graphql-eslint/no-duplicate-fields': "error";
'@graphql-eslint/no-fragment-cycles': "error";
'@graphql-eslint/no-undefined-variables': "error";
'@graphql-eslint/no-unused-fragments': "error";
'@graphql-eslint/no-unused-variables': "error";
'@graphql-eslint/one-field-subscriptions': "error";
'@graphql-eslint/overlapping-fields-can-be-merged': "error";
'@graphql-eslint/possible-fragment-spread': "error";
'@graphql-eslint/provided-required-arguments': "error";
'@graphql-eslint/require-selections': "error";
'@graphql-eslint/scalar-leafs': "error";
'@graphql-eslint/selection-set-depth': ["error", {
maxDepth: number;
}];
'@graphql-eslint/unique-argument-names': "error";
'@graphql-eslint/unique-directive-names-per-location': "error";
'@graphql-eslint/unique-fragment-name': "error";
'@graphql-eslint/unique-input-field-names': "error";
'@graphql-eslint/unique-operation-name': "error";
'@graphql-eslint/unique-variable-names': "error";
'@graphql-eslint/value-literals-of-correct-type': "error";
'@graphql-eslint/variables-are-input-types': "error";
'@graphql-eslint/variables-in-allowed-position': "error";
};
};
};
export { configs };