New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-eslint/eslint-plugin

Package Overview
Dependencies
Maintainers
2
Versions
723
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-eslint/eslint-plugin - npm Package Compare versions

Comparing version 1.0.2-alpha-3234cb6.0 to 1.0.2

docs/rules/no-unused-fields.md

1

docs/README.md

@@ -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';

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc