@graphql-eslint/eslint-plugin
Advanced tools
Comparing version 1.0.2-alpha-3234cb6.0 to 1.0.2
@@ -6,2 +6,3 @@ ## Available Rules | ||
- [`no-unreachable-types`](./rules/no-unreachable-types.md) | ||
- [`no-unused-fields`](./rules/no-unused-fields.md) | ||
- [`no-deprecated`](./rules/no-deprecated.md) | ||
@@ -8,0 +9,0 @@ - [`unique-fragment-name`](./rules/unique-fragment-name.md) |
import { GraphQLSchema } from 'graphql'; | ||
import { SiblingOperations } from './sibling-operations'; | ||
export declare function createReachableTypesService(schema: GraphQLSchema): () => Set<string>; | ||
export declare function collectReachableTypes(schema: GraphQLSchema): Set<string>; | ||
export declare type FieldsCache = Record<string, Set<string>>; | ||
export declare function createUsedFieldsService(schema: GraphQLSchema, operations: SiblingOperations): () => FieldsCache | null; | ||
export declare function collectUsedFields(schema: GraphQLSchema, operations: SiblingOperations): FieldsCache; |
@@ -7,1 +7,2 @@ export { rules } from './rules'; | ||
export * from './estree-parser'; | ||
export * from './testkit'; |
{ | ||
"name": "@graphql-eslint/eslint-plugin", | ||
"version": "1.0.2-alpha-3234cb6.0", | ||
"version": "1.0.2", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "peerDependencies": { |
@@ -143,8 +143,7 @@ This project integrates GraphQL and ESLint, for a better developer experience. | ||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "graphql"], | ||
"eslint.options": { | ||
"extentions": [".js", ".graphql"] | ||
} | ||
} | ||
``` | ||
Currently, you also need a GraphQL IDE extension for syntax highlighting installed (which may potentially have its own linting) - for example [GraphQL (by GraphQL Foundation)](https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql). | ||
### Disabling Rules | ||
@@ -151,0 +150,0 @@ |
export declare const rules: { | ||
'avoid-typename-prefix': import("..").GraphQLESLintRule<any[], false>; | ||
'no-unreachable-types': import("..").GraphQLESLintRule<any[], false>; | ||
'no-unused-fields': import("..").GraphQLESLintRule<any[], false>; | ||
'no-deprecated': import("..").GraphQLESLintRule<[], true>; | ||
@@ -18,3 +19,3 @@ 'unique-fragment-name': import("..").GraphQLESLintRule<[], false>; | ||
'require-description': import("..").GraphQLESLintRule<[{ | ||
on: ("ObjectTypeDefinition" | "InputObjectTypeDefinition" | "SchemaDefinition" | "FieldDefinition" | "InputValueDefinition" | "InterfaceTypeDefinition" | "UnionTypeDefinition" | "EnumTypeDefinition" | "EnumValueDefinition" | "DirectiveDefinition")[]; | ||
on: ("SchemaDefinition" | "ObjectTypeDefinition" | "FieldDefinition" | "InputValueDefinition" | "InterfaceTypeDefinition" | "UnionTypeDefinition" | "EnumTypeDefinition" | "EnumValueDefinition" | "InputObjectTypeDefinition" | "DirectiveDefinition")[]; | ||
}], false>; | ||
@@ -21,0 +22,0 @@ 'require-id-when-available': import("..").GraphQLESLintRule<[{ |
import { GraphQLESLintRule } from '../types'; | ||
declare const DESCRIBABLE_NODES: ("ObjectTypeDefinition" | "InputObjectTypeDefinition" | "SchemaDefinition" | "FieldDefinition" | "InputValueDefinition" | "InterfaceTypeDefinition" | "UnionTypeDefinition" | "EnumTypeDefinition" | "EnumValueDefinition" | "DirectiveDefinition")[]; | ||
declare const DESCRIBABLE_NODES: ("SchemaDefinition" | "ObjectTypeDefinition" | "FieldDefinition" | "InputValueDefinition" | "InterfaceTypeDefinition" | "UnionTypeDefinition" | "EnumTypeDefinition" | "EnumValueDefinition" | "InputObjectTypeDefinition" | "DirectiveDefinition")[]; | ||
declare type RequireDescriptionRuleConfig = [{ | ||
@@ -4,0 +4,0 @@ on: typeof DESCRIBABLE_NODES; |
@@ -20,3 +20,4 @@ import { RuleTester } from 'eslint'; | ||
fromMockFile(path: string): string; | ||
runGraphQLTests<Config>(name: string, rule: any, tests: { | ||
runGraphQLTests<Config>(name: string, rule: any, // Actually, it's GraphQLESLintRule, but TS has issues with that | ||
tests: { | ||
valid?: Array<string | GraphQLValidTestCase<Config>>; | ||
@@ -23,0 +24,0 @@ invalid?: Array<string | GraphQLInvalidTestCase<Config>>; |
@@ -7,2 +7,3 @@ import { Rule, AST, Linter } from 'eslint'; | ||
import { SiblingOperations } from './sibling-operations'; | ||
import { FieldsCache } from './graphql-ast'; | ||
export interface ParserOptions { | ||
@@ -21,2 +22,3 @@ schema?: string | string[]; | ||
getReachableTypes: () => Set<string> | null; | ||
getUsedFields: () => FieldsCache | null; | ||
}; | ||
@@ -23,0 +25,0 @@ export declare type GraphQLESLintParseResult = Linter.ESLintParseResult & { |
@@ -5,7 +5,9 @@ import { GraphQLSchema, Token, DocumentNode } from 'graphql'; | ||
import { SiblingOperations } from './sibling-operations'; | ||
import { FieldsCache } from './graphql-ast'; | ||
export declare function requireSiblingsOperations(ruleName: string, context: GraphQLESlintRuleContext<any>): SiblingOperations; | ||
export declare function requireGraphQLSchemaFromContext(ruleName: string, context: GraphQLESlintRuleContext<any>): GraphQLSchema; | ||
export declare function requireReachableTypesFromContext(ruleName: string, context: GraphQLESlintRuleContext<any>): Set<string>; | ||
export declare function requireUsedFieldsFromContext(ruleName: string, context: GraphQLESlintRuleContext<any>): FieldsCache; | ||
export declare function extractTokens(source: string): AST.Token[]; | ||
export declare function checkForEslint(token: Token, rawNode: DocumentNode): boolean; | ||
export declare const normalizePath: (path: string) => string; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
98
1
760882
6527
237