@graphql-eslint/eslint-plugin
Version:
GraphQL plugin for ESLint
38 lines (37 loc) • 1.93 kB
text/typescript
import { ASTNode, GraphQLSchema, Kind } from 'graphql';
import { AST } from 'eslint';
import { Position } from 'estree';
import { GraphQLESLintRuleContext } from './types.cjs';
import { SiblingOperations } from './documents.cjs';
export declare function requireSiblingsOperations(ruleId: string, context: GraphQLESLintRuleContext): SiblingOperations | never;
export declare function requireGraphQLSchemaFromContext(ruleId: string, context: GraphQLESLintRuleContext): GraphQLSchema | never;
export declare const logger: {
error: (...args: unknown[]) => void;
warn: (...args: unknown[]) => void;
};
export declare const normalizePath: (path: string) => string;
export declare const VIRTUAL_DOCUMENT_REGEX: RegExp;
export declare const CWD: string;
export declare const getTypeName: (node: ASTNode) => string;
export 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];
export type CaseStyle = 'camelCase' | 'PascalCase' | 'snake_case' | 'UPPER_CASE' | 'kebab-case';
export declare const pascalCase: (str: string) => string;
export declare const camelCase: (str: string) => string;
export declare const convertCase: (style: CaseStyle, str: string) => string;
export declare function getLocation(start: Position, fieldName?: string): AST.SourceLocation;
export declare const REPORT_ON_FIRST_CHARACTER: {
column: number;
line: number;
};
export declare const ARRAY_DEFAULT_OPTIONS: {
readonly type: "array";
readonly uniqueItems: true;
readonly minItems: 1;
readonly items: {
readonly type: "string";
};
};
export declare const englishJoinWords: (words: string[]) => string;
type Truthy<T> = T extends false | '' | 0 | null | undefined ? never : T;
export declare function truthy<T>(value: T): value is Truthy<T>;
export {};