graphql-eslint

ESLint parser, plugin and set rules for GraphQL (for schema and operations). Easily customizable with custom rules. Integrates with IDEs and modern GraphQL tools.

MIT License

Stars
762
Committers
47

Bot releases are visible (Hide)

graphql-eslint - August 29, 2023 Latest Release

Published by github-actions[bot] about 1 year ago

@graphql-eslint/[email protected]

Major Changes

  • #1794
    4079167e
    Thanks @B2o5T! - - bring back possible-type-extension rule to
    schema-recommended config

    • add unique-operation-name and unique-fragment-name rules to operations-recommended config

    The concept of sibling operations provided by graphql-config's documents fields is based on
    uniquely named operations and fragments, for omitting false-positive/negative cases when
    operations and fragments are located in separate files. For this reason, these rules must be
    included in the recommended config

    • rename relay config to schema-relay

    To avoid confusing when users extend this config for executable definitions (operations and
    fragments)

  • #1812
    bf475e88
    Thanks @B2o5T! - - alphabetize rule changes

    • add definitions: true option for schema-all/operations-all configs

    • rename values: ['EnumTypeDefinition'] to values: true

    • rename variables: ['OperationDefinition'] to variables: true

    • add groups: ['id', '*', 'createdAt', 'updatedAt'] for schema-all/operations-all configs

    • require-id-when-available rule changes

      • rename rule to require-selections
    • update schema-all/operations-all configs

    • require-description rule changes

      • add rootField: true option for schema-recommended config
    • require eslint at least >=8.44.0 as peerDependency

    • naming-convention

      • add new options for schema-recommended config
      {
        'EnumTypeDefinition,EnumTypeExtension': {
          forbiddenPrefixes: ['Enum'],
          forbiddenSuffixes: ['Enum']
        },
        'InterfaceTypeDefinition,InterfaceTypeExtension': {
          forbiddenPrefixes: ['Interface'],
          forbiddenSuffixes: ['Interface']
        },
        'UnionTypeDefinition,UnionTypeExtension': {
          forbiddenPrefixes: ['Union'],
          forbiddenSuffixes: ['Union']
        },
        'ObjectTypeDefinition,ObjectTypeExtension': {
          forbiddenPrefixes: ['Type'],
          forbiddenSuffixes: ['Type']
        }
      }
      
    • remove graphql-js' unique-enum-value-names rule

    • rename no-case-insensitive-enum-values-duplicates to unique-enum-value-names

      Since this rule reports case-insensitive enum values duplicates too

    • require-nullable-result-in-root rule changes

      Do not check subscriptions

  • #1795
    2f46a717
    Thanks @B2o5T! - - remove parserOptions.schema

    • remove parserOptions.documents

    • remove parserOptions.extensions

    • remove parserOptions.include

    • remove parserOptions.exclude

    • remove parserOptions.projects

    • remove parserOptions.schemaOptions

    • remove parserOptions.graphQLParserOptions

    • remove parserOptions.skipGraphQLConfig

    • remove parserOptions.operations

    • add parserOptions.graphQLConfig?: IGraphQLConfig for programmatic usage

  • #1793
    6593482b
    Thanks @B2o5T! - drop support of Node.js 12/14/16, GraphQL 14/15

  • #1792
    804f8b61
    Thanks @B2o5T! - Remove GraphQLRuleTester from bundle, to test your
    rules use regular RuleTester from eslint

    Note: with this change unnecessary dependency @babel/code-frame was removed too

    import { RuleTester } from 'eslint'
    
    const ruleTester = new RuleTester({
      parser: require.resolve('@graphql-eslint/eslint-plugin')
    })
    

Patch Changes

graphql-eslint - July 13, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Patch Changes

  • #1750
    7b461a1
    Thanks @B2o5T! - ESLint configuration in ... is invalid. Unexpected
    top-level property "default". Fix targeting for legacy Node.js versions
graphql-eslint - July 04, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Minor Changes

  • #1729
    018b2da
    Thanks @B2o5T! - bundle with tsup to strip out development code, check
    with bob
graphql-eslint - July 02, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Patch Changes

  • #1725
    5f3f1a5
    Thanks @B2o5T! - fix
    Parsing error: Cannot read properties of undefined (reading '0') eslint in VSCode
graphql-eslint - June 30, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Patch Changes

graphql-eslint - May 23, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Patch Changes

  • #1665
    73b1087
    Thanks @B2o5T! - fix
    TypeError: Cannot read properties of undefined (reading 'kind') for
    require-nullable-result-in-root rule
graphql-eslint - May 22, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Minor Changes

  • #1657
    0a571bb
    Thanks @nishtahir! - Add require-nullable-result-in-root rule to
    report on non-null fields in root types
graphql-eslint - March 28, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Minor Changes

graphql-eslint - March 27, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Minor Changes

graphql-eslint - March 22, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Patch Changes

graphql-eslint - February 27, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Patch Changes

  • #1467
    12f802c
    Thanks @B2o5T! - fix require-id-when-available check unions as well

  • #1469
    6b4e20c
    Thanks @B2o5T! - fix no-unreachable-types ignore types from
    directive arguments with request locations

graphql-eslint - February 12, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Minor Changes

  • #1443
    9916d8d
    Thanks @FloEdelmann! - Add new require-import-fragment rule
    that reports fragments which were not imported via an import expression.
graphql-eslint - January 25, 2023

Published by github-actions[bot] over 1 year ago

@graphql-eslint/[email protected]

Minor Changes

  • #1386
    c5fb2dc
    Thanks @B2o5T! - The new version no longer crashes on VSCode-ESLint,
    when schema/siblings contain validation errors, also, GraphQL-ESLint now has strict: true in
    tsconfig.json and extends @typescript-eslint recommended config 🚀

    P.S. GraphQL-ESLint now has its own website, all documentation moved here. Also, it contains a new
    fancy playground page 💅 for both schema/operations testing
    https://the-guild.dev/graphql/eslint/play

Patch Changes

graphql-eslint - December 28, 2022

Published by github-actions[bot] almost 2 years ago

@graphql-eslint/[email protected]

Patch Changes

  • #1349
    6ce6dbb
    Thanks @B2o5T! - fix broken suggestions on code files when there are
    multiple choices
graphql-eslint - December 27, 2022

Published by github-actions[bot] almost 2 years ago

@graphql-eslint/[email protected]

Patch Changes

  • #1346
    f031f56
    Thanks @B2o5T! - report errors on first character for
    *.vue/*.svelte code, due graphql-tag-pluck limitation we can't know right location
graphql-eslint - December 27, 2022

Published by github-actions[bot] almost 2 years ago

@graphql-eslint/[email protected]

Patch Changes

graphql-eslint - December 26, 2022

Published by github-actions[bot] almost 2 years ago

@graphql-eslint/[email protected]

Minor Changes

  • #1335
    2e4dfa0
    Thanks @B2o5T! - support new ESLint flat config system, export
    flatConfigs

  • #1330
    bab45cc
    Thanks @B2o5T! - add new rule require-nullable-fields-with-oneof

  • #1331
    0f7afa5
    Thanks @B2o5T! - add new rule require-type-pattern-with-oneof

  • #1144
    43e2861
    Thanks @TuvalSimha! - Add new option groups to alphabetize
    rule

  • #1303
    c6d5bb7
    Thanks @tshedor! - [require-description] add rootField option for
    only field definitions within Query, Mutation, and Subscription root types

  • #1141
    b1f2730
    Thanks @TuvalSimha! - add new option prefix for
    match-document-filename rule

  • #1314
    a4f885a
    Thanks @B2o5T! - add ESLint suggestions for following graphql-js
    rules:

    • fields-on-correct-type
    • known-argument-names
    • known-type-names
    • possible-type-extension
    • scalar-leafs
    • value-literals-of-correct-type
  • #1316
    1f21fc8
    Thanks @FloEdelmann! - feat: add lone-executable-definition to
    require all queries, mutations, subscriptions and fragments to be located in separate files

  • #1338
    fedec34
    Thanks @B2o5T! - update graphql-config to v4.4.0 that no longer
    requires typescript to be installed

  • #1334
    abcfc14
    Thanks @B2o5T! - add new rule no-one-place-fragments

Patch Changes

graphql-eslint - November 05, 2022

Published by github-actions[bot] almost 2 years ago

@graphql-eslint/[email protected]

Patch Changes

graphql-eslint - November 01, 2022

Published by github-actions[bot] almost 2 years ago

@graphql-eslint/[email protected]

Minor Changes

  • #1222 cf59b0a Thanks @B2o5T! - feat: reload schema/documents cache (only for current project) in VSCode
graphql-eslint - October 10, 2022

Published by github-actions[bot] about 2 years ago

@graphql-eslint/[email protected]

Minor Changes

  • #1200 f193b5e Thanks @B2o5T! - support extracting GraphQL documents from *.vue/*.svelte code-files

Patch Changes

  • #1201 ba26511 Thanks @B2o5T! - dependencies updates:

  • #1198 2886adf Thanks @B2o5T! - fix passing pluck config via graphql-config#extensions field
    rename extensions.graphqlTagPluck to extensions.pluckConfig
    fix performance regression while using processor: '@graphql-eslint/graphql'

Badges
Extracted from project README
GraphQLConf 2024 Banner: September 10-12, San Francisco. Hosted by the GraphQL Foundation npm version
Related Projects