UNPKG

@graphql-eslint/eslint-plugin

Version:
45 lines (42 loc) 2.56 kB
import { AST } from 'eslint'; import { Position } from 'estree'; import { GraphQLSchema, ASTNode, Kind } from 'graphql'; import { GraphQLESTreeNode } from './estree-converter/types.cjs'; import { SiblingOperations } from './siblings.cjs'; import { GraphQLESLintRuleContext } from './types.cjs'; import '@graphql-tools/utils'; import 'graphql-config'; import 'json-schema-to-ts'; declare function requireGraphQLOperations(ruleId: string, context: GraphQLESLintRuleContext): SiblingOperations | never; declare function requireGraphQLSchema(ruleId: string, context: GraphQLESLintRuleContext): GraphQLSchema | never; declare const logger: { error: (...args: unknown[]) => void; warn: (...args: unknown[]) => void; }; declare const slash: (path: string) => string; declare const VIRTUAL_DOCUMENT_REGEX: RegExp; declare const CWD: string; declare const getTypeName: (node: ASTNode) => string; declare const TYPES_KINDS: readonly [Kind.OBJECT_TYPE_DEFINITION, Kind.INTERFACE_TYPE_DEFINITION, Kind.ENUM_TYPE_DEFINITION, Kind.SCALAR_TYPE_DEFINITION, Kind.INPUT_OBJECT_TYPE_DEFINITION, Kind.UNION_TYPE_DEFINITION]; type CaseStyle = 'camelCase' | 'kebab-case' | 'PascalCase' | 'snake_case' | 'UPPER_CASE'; declare const pascalCase: (str: string) => string; declare const camelCase: (str: string) => string; declare const convertCase: (style: CaseStyle, str: string) => string; declare function getLocation(start: Position, fieldName?: string): AST.SourceLocation; declare const REPORT_ON_FIRST_CHARACTER: { column: number; line: number; }; declare const ARRAY_DEFAULT_OPTIONS: { readonly type: "array"; readonly uniqueItems: true; readonly minItems: 1; readonly items: { readonly type: "string"; }; }; declare const englishJoinWords: (words: string[]) => string; declare function displayNodeName(node: GraphQLESTreeNode<ASTNode, boolean>): string; declare function getNodeName(node: GraphQLESTreeNode<ASTNode>): string; declare const eslintSelectorsTip = "> [!TIP]\n>\n> These fields are defined by ESLint [`selectors`](https://eslint.org/docs/developer-guide/selectors).\n> Paste or drop code into the editor in [ASTExplorer](https://astexplorer.net) and inspect the generated AST to compose your selector."; export { ARRAY_DEFAULT_OPTIONS, CWD, type CaseStyle, REPORT_ON_FIRST_CHARACTER, TYPES_KINDS, VIRTUAL_DOCUMENT_REGEX, camelCase, convertCase, displayNodeName, englishJoinWords, eslintSelectorsTip, getLocation, getNodeName, getTypeName, logger, pascalCase, requireGraphQLOperations, requireGraphQLSchema, slash };