@graphql-eslint/eslint-plugin
Version:
GraphQL plugin for ESLint
149 lines (146 loc) • 6.21 kB
text/typescript
import { CaseStyle } from '../utils.cjs';
import * as graphql from 'graphql';
import { GraphQLESLintRule } from '../types.cjs';
import 'eslint';
import 'estree';
import '../estree-converter/types.cjs';
import '../siblings.cjs';
import '@graphql-tools/utils';
import 'graphql-config';
import 'json-schema-to-ts';
declare const rules: {
alphabetize: GraphQLESLintRule<{
definitions?: boolean | undefined;
selections?: ("OperationDefinition" | "FragmentDefinition")[] | undefined;
arguments?: ("Field" | "Directive" | "FieldDefinition" | "DirectiveDefinition")[] | undefined;
values?: boolean | undefined;
fields?: ("ObjectTypeDefinition" | "InterfaceTypeDefinition" | "InputObjectTypeDefinition")[] | undefined;
variables?: boolean | undefined;
groups?: string[] | undefined;
}[]>;
'description-style': GraphQLESLintRule<{
style: "block" | "inline";
}[]>;
'input-name': GraphQLESLintRule<{
checkInputType?: boolean | undefined;
caseSensitiveInputType?: boolean | undefined;
checkQueries?: boolean | undefined;
checkMutations?: boolean | undefined;
}[]>;
'lone-executable-definition': GraphQLESLintRule<{
ignore?: (graphql.OperationTypeNode | "fragment")[] | undefined;
}[]>;
'match-document-filename': GraphQLESLintRule<{
fragment?: (CaseStyle | "matchDocumentStyle") | {
style?: (CaseStyle | "matchDocumentStyle") | undefined;
suffix?: string | undefined;
prefix?: string | undefined;
} | undefined;
query?: (CaseStyle | "matchDocumentStyle") | {
style?: (CaseStyle | "matchDocumentStyle") | undefined;
suffix?: string | undefined;
prefix?: string | undefined;
} | undefined;
mutation?: (CaseStyle | "matchDocumentStyle") | {
style?: (CaseStyle | "matchDocumentStyle") | undefined;
suffix?: string | undefined;
prefix?: string | undefined;
} | undefined;
subscription?: (CaseStyle | "matchDocumentStyle") | {
style?: (CaseStyle | "matchDocumentStyle") | undefined;
suffix?: string | undefined;
prefix?: string | undefined;
} | undefined;
fileExtension?: ".gql" | ".graphql" | undefined;
}[]>;
'naming-convention': GraphQLESLintRule<{
[x: string]: unknown;
types?: ("camelCase" | "PascalCase" | "snake_case" | "UPPER_CASE") | {
style?: ("camelCase" | "PascalCase" | "snake_case" | "UPPER_CASE") | undefined;
suffix?: string | undefined;
prefix?: string | undefined;
forbiddenPatterns?: {
[x: string]: unknown;
}[] | undefined;
requiredPattern?: {
[x: string]: unknown;
} | undefined;
forbiddenPrefixes?: string[] | undefined;
forbiddenSuffixes?: string[] | undefined;
requiredPrefixes?: string[] | undefined;
requiredSuffixes?: string[] | undefined;
ignorePattern?: string | undefined;
} | undefined;
allowLeadingUnderscore?: boolean | undefined;
allowTrailingUnderscore?: boolean | undefined;
}[]>;
'no-anonymous-operations': GraphQLESLintRule;
'no-deprecated': GraphQLESLintRule<[], true>;
'no-duplicate-fields': GraphQLESLintRule;
'no-hashtag-description': GraphQLESLintRule;
'no-one-place-fragments': GraphQLESLintRule;
'no-root-type': GraphQLESLintRule<{
disallow: ("mutation" | "subscription")[];
}[]>;
'no-scalar-result-type-on-mutation': GraphQLESLintRule;
'no-typename-prefix': GraphQLESLintRule;
'no-unreachable-types': GraphQLESLintRule;
'no-unused-fields': GraphQLESLintRule<{
ignoredFieldSelectors?: string[] | undefined;
}[]>;
'relay-arguments': GraphQLESLintRule<{
includeBoth: boolean;
}[], true>;
'relay-connection-types': GraphQLESLintRule;
'relay-edge-types': GraphQLESLintRule<{
withEdgeSuffix?: boolean | undefined;
shouldImplementNode?: boolean | undefined;
listTypeCanWrapOnlyEdgeType?: boolean | undefined;
}[], true>;
'relay-page-info': GraphQLESLintRule;
'require-deprecation-date': GraphQLESLintRule<{
argumentName?: string | undefined;
}[]>;
'require-deprecation-reason': GraphQLESLintRule;
'require-description': GraphQLESLintRule<{
types?: true | undefined;
OperationDefinition?: boolean | undefined;
ScalarTypeDefinition?: boolean | undefined;
ObjectTypeDefinition?: boolean | undefined;
FieldDefinition?: boolean | undefined;
InputValueDefinition?: boolean | undefined;
InterfaceTypeDefinition?: boolean | undefined;
UnionTypeDefinition?: boolean | undefined;
EnumTypeDefinition?: boolean | undefined;
EnumValueDefinition?: boolean | undefined;
InputObjectTypeDefinition?: boolean | undefined;
DirectiveDefinition?: boolean | undefined;
rootField?: true | undefined;
ignoredSelectors?: string[] | undefined;
}[]>;
'require-field-of-type-query-in-mutation-result': GraphQLESLintRule;
'require-import-fragment': GraphQLESLintRule;
'require-nullable-fields-with-oneof': GraphQLESLintRule;
'require-nullable-result-in-root': GraphQLESLintRule;
'require-selections': GraphQLESLintRule<{
requireAllFields?: boolean | undefined;
fieldName: string | string[];
}[], true>;
'require-type-pattern-with-oneof': GraphQLESLintRule;
'selection-set-depth': GraphQLESLintRule<{
ignore?: string[] | undefined;
maxDepth: number;
}[]>;
'strict-id-in-types': GraphQLESLintRule<{
acceptedIdNames?: string[] | undefined;
acceptedIdTypes?: string[] | undefined;
exceptions?: {
types?: string[] | undefined;
suffixes?: string[] | undefined;
} | undefined;
}[]>;
'unique-enum-value-names': GraphQLESLintRule;
'unique-fragment-name': GraphQLESLintRule;
'unique-operation-name': GraphQLESLintRule;
};
export { rules };