Changelog
Every GraphQL ESLint release with its changes and the pull requests behind them.
4.4.1
Patch Changes
-
#2946
51fe6bdThanks @roli-lpci! - FixTypeError: context.getSourceCode is not a functionwhen running with ESLint v10context.getSourceCode()was deprecated in ESLint v8.40 and removed in v10. All remaining call sites now use thecontext.sourceCodeproperty, which is available in every supported ESLint version (peer dependency is>=8.44.0).
4.4.0
Minor Changes
-
#2902
86af780Thanks @dotansimha! - ImproveparseForESLintAPI and allow to pass context schema as inline string.You can now use it this way:
parseForESLint(code, { schemaSdl: 'type Query { foo: String }', filePath: 'test.graphql' }) -
#2838
10b9975Thanks @dimaMachina! - - allow to confignaming-conventionfor Relay fragment convention<module_name>_<property_name>viarequiredPatternoption- replace
requiredPatterns: RegEx[]byrequiredPattern: RegExoption
- replace
Patch Changes
- #2845
00b4617Thanks @dimaMachina! - add"./*"toexportsfield inpackage.json
4.3.0
Minor Changes
- #2814
ccc302dThanks @dimaMachina! - lint federation subgraphs schemas without parse errors
Patch Changes
-
#2814
ccc302dThanks @dimaMachina! - dependencies updates:- Updated dependency
@graphql-tools/graphql-tag-pluck@^8.3.4↗︎ (from8.3.4, independencies) - Added dependency
@apollo/subgraph@^2↗︎ (topeerDependencies)
- Updated dependency
-
#2797
b904515Thanks @dimaMachina! - removetruthyhelper function
4.2.1
Patch Changes
- #2805
fc2bf85Thanks @FloEdelmann! - fix(deps): increase minimum graphql-config version
4.2.0
Minor Changes
- #2790
438078dThanks @dimaMachina! - feat(require-selectionsrule): introduce new optionrequireAllFieldsto require all values offieldName: string[]option
4.1.1
Patch Changes
-
#2785
99b0703Thanks @dimaMachina! -allowLeadingUnderscoreandallowTrailingUnderscoreshould not conflict withignorePatterninnaming-conventionrule -
#2787
f370359Thanks @dimaMachina! - add an example with custom graphql rules
4.1.0
Minor Changes
-
#2780
98e0b56Thanks @dimaMachina! - introduceforbiddenPatternsandrequiredPatternsoptions fornaming-conventionrule and deprecateforbiddenPrefixes,forbiddenSuffixesandrequiredPrefixesandrequiredSuffixes -
#2782
4c20cddThanks @dimaMachina! - add new optionignoredSelectorsforrequire-descriptionrule, to ignore eslint selectors, e.g. types which ends withConnectionorEdge -
#2783
6e354c9Thanks @dimaMachina! - addjson-schema-to-tsas optional peer dependency
Patch Changes
- #2783
6e354c9Thanks @dimaMachina! - dependencies updates:- Added dependency
json-schema-to-ts@^3↗︎ (topeerDependencies)
- Added dependency
4.0.1
Patch Changes
- #2775
84d78b7Thanks @dimaMachina! - fix errorTypeError: Cannot read properties of undefined (reading 'type')inrequire-descriptionrule
4.0.0
Major Changes
-
#2598
e771499Thanks @bmulholland! - 1. graphql plugin can now we be specified asplugins: { - '@graphql-eslint': { - graphqlPlugin.rules - } + '@graphql-eslint': graphqlPlugin }-
Config rules should now be accessed through the
rulespropertyrules: { - ...graphqlESLint.configs['flat/operations-recommended'] + ...graphqlESLint.configs['flat/operations-recommended'].rules -
processor can now be specified with accessing
processorproperty- processor: graphql.processors.graphql + processor: graphqlPlugin.processor -
The plugin can now be imported using a default import
- import * as graphql from '@graphql-eslint/eslint-plugin' + import graphqlPlugin from '@graphql-eslint/eslint-plugin'
-
-
#1813
1c2d220Thanks @dimaMachina! - - bring backpossible-type-extensionrule toschema-recommendedconfig- add
unique-operation-nameandunique-fragment-namerules tooperations-recommendedconfig
The concept of sibling operations provided by graphql-config’s
documentsfields 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
relayconfig toschema-relay
To avoid confusing when users extend this config for executable definitions (operations and fragments)
- add
-
#1813
1c2d220Thanks @dimaMachina! - -alphabetizerule changes-
add
definitions: trueoption forschema-all/operations-allconfigs -
rename
values: ['EnumTypeDefinition']tovalues: true -
rename
variables: ['OperationDefinition']tovariables: true -
add
groups: ['id', '*', 'createdAt', 'updatedAt']forschema-all/operations-allconfigs -
require-id-when-availablerule changes- rename rule to
require-selections
- rename rule to
-
update
schema-all/operations-allconfigs -
require-descriptionrule changes- add
rootField: trueoption forschema-recommendedconfig
- add
-
require
eslintat least>=8.44.0as peerDependency -
naming-convention- add new options for
schema-recommendedconfig
{ 'EnumTypeDefinition,EnumTypeExtension': { forbiddenPrefixes: ['Enum'], forbiddenSuffixes: ['Enum'] }, 'InterfaceTypeDefinition,InterfaceTypeExtension': { forbiddenPrefixes: ['Interface'], forbiddenSuffixes: ['Interface'] }, 'UnionTypeDefinition,UnionTypeExtension': { forbiddenPrefixes: ['Union'], forbiddenSuffixes: ['Union'] }, 'ObjectTypeDefinition,ObjectTypeExtension': { forbiddenPrefixes: ['Type'], forbiddenSuffixes: ['Type'] } } - add new options for
-
remove graphql-js’
unique-enum-value-namesrule -
rename
no-case-insensitive-enum-values-duplicatestounique-enum-value-namesSince this rule reports case-insensitive enum values duplicates too
-
require-nullable-result-in-rootrule changesDo not check subscriptions
-
-
#1813
1c2d220Thanks @dimaMachina! - - removeparserOptions.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?: IGraphQLConfigfor programmatic usage
- remove
-
#2281
c53cb4eThanks @maciesielka! - Add new config optionignoredFieldSelectorstono-unused-fieldsrule to ignore all the relay pagination fields for every connection exposed in schema for example -
#1813
1c2d220Thanks @dimaMachina! - drop support of Node.js 12/14/16, GraphQL 14/15 -
#2418
c2d5386Thanks @comatory! - exposing GraphQLESTreeNode type -
#2768
241936aThanks @dimaMachina! - - renamerequireSiblingsOperationstorequireGraphQLOperations- rename
requireGraphQLSchemaFromContexttorequireGraphQLSchema
- rename
-
#1813
1c2d220Thanks @dimaMachina! - RemoveGraphQLRuleTesterfrom bundle, to test your rules use regularRuleTesterfrom eslintNote: with this change unnecessary dependency
@babel/code-framewas removed tooimport { RuleTester } from 'eslint' const ruleTester = new RuleTester({ parser: require.resolve('@graphql-eslint/eslint-plugin') }) -
#2319
b3c73dcThanks @maciesielka! - Enforcerequire-selectionsonFragmentSpreads withinGraphQLUnionTypes
Minor Changes
-
#2385
afa8b8aThanks @deathemperor! - feat: add a new option{for alphabetize rule to sort fieldsselection set -
#2293
01f7087Thanks @yoavsion! - Support the fragment spread group when defining alphabetize rule’s groups with new option... -
#2719
57d6edfThanks @dimaMachina! - check for deprecated arguments and object field nodes in graphql operations inno-deprecatedrule
Patch Changes
-
#1813
1c2d220Thanks @dimaMachina! - dependencies updates:- Removed dependency
@babel/code-frame@^7.18.6↗︎ (fromdependencies)
- Removed dependency
-
#1813
1c2d220Thanks @dimaMachina! - dependencies updates:- Updated dependency
graphql-config@^4.5.0↗︎ (from^4.4.0, independencies) - Removed dependency
@babel/code-frame@^7.18.6↗︎ (fromdependencies) - Removed dependency
chalk@^4.1.2↗︎ (fromdependencies) - Removed dependency
tslib@^2.4.1↗︎ (fromdependencies) - Updated dependency
graphql@^16↗︎ (from^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0, inpeerDependencies) - Added dependency
eslint@>=8.44.0↗︎ (topeerDependencies)
- Updated dependency
-
#2455
08a8a13Thanks @dimaMachina! - fix caching issues forno-unreachable-types/no-unused-fieldsrules for multi projects -
#2483
d52585aThanks @dimaMachina! - fix compatibility with Node.js v22 -
#2743
03ccb9dThanks @dimaMachina! - fix error fromno-deprecatedrule4.0.0-alpha.13: node.typeInfo(...).inputType.getFields is not a function -
#2466
da608d7Thanks @dimaMachina! - fixrequire is not definedin flat configs for Vue/Svelte projects -
#2277
3b35baeThanks @yoavain-sundaysky! - fix false positive cases forrequire-import-fragmenton Windows, whengraphql-config’sdocumentskey contained glob pattern => source file path of document contained always forward slashes -
#2735
ccd9303Thanks @dimaMachina! - fix reporting lint issues not on first char of file for.vueand support ESLint fixes and suggestions for them. Use new official example -
#2468
733a66eThanks @dimaMachina! - - rename flat configs exports-graphql.flatConfigs['schema-recommended'] +graphql.configs['flat/schema-recommended'] -graphql.flatConfigs['schema-relay'] +graphql.configs['flat/schema-relay'] -graphql.flatConfigs['schema-all'] +graphql.configs['flat/schema-all'] -graphql.flatConfigs['operations-recommended'] +graphql.configs['flat/operations-recommended'] -graphql.flatConfigs['operations-all'] +graphql.configs['flat/operations-all']- fix with programmatic usage when passing large schema as string causes
pattern too longerror - fix loading ESM
graphql.config.jsconfigs
- fix with programmatic usage when passing large schema as string causes
-
#2616
c0f1b07Thanks @fcortes! - The import attribute syntax (with { type: “json” }) is still experimental so warnings showed up when using the library as it was being used to import the package.json file to extract the package versionAs an alternative, the current version will be injected on build time through tsup configuration.
-
#2605
2ae64e1Thanks @dimaMachina! - fix types exports by@arethetypeswrong/clipackage -
#2458
9096458Thanks @dimaMachina! - addmetaobject withnameandversiontoparserandprocessorto be compatible with ESLint 9 -
#2692
dcf4e35Thanks @dimaMachina! - fix some issues on Windows by running tests with matrix on github CI -
#2711
b15df66Thanks @dimaMachina! - Reenable runningrequire-id-when-availableonFragmentDefinition -
#2752
1e3e966Thanks @dimaMachina! - fix - Config types don’t satisfyFlatConfig.Config -
#2721
cda7929Thanks @dimaMachina! - fixno-unreachable-typesto consider wrapped request directive argument types -
#2763
baba639Thanks @dimaMachina! - fix https://bit.ly/graphql-eslint-operations links -
#2713
8b6d46bThanks @dimaMachina! -naming-conventionrule should not fail when aliasing underscore fields
4.0.0-alpha.16
Patch Changes
- #2752
1e3e966Thanks @dimaMachina! - fix - Config types don’t satisfyFlatConfig.Config
4.0.0-alpha.15
Patch Changes
-
#2743
03ccb9dThanks @dimaMachina! - fix error fromno-deprecatedrule4.0.0-alpha.13: node.typeInfo(...).inputType.getFields is not a function -
#2735
ccd9303Thanks @dimaMachina! - fix reporting lint issues not on first char of file for.vueand support ESLint fixes and suggestions for them. Use new official example
4.0.0-alpha.14
Patch Changes
- #2721
cda7929Thanks @dimaMachina! - fixno-unreachable-typesto consider wrapped request directive argument types
4.0.0-alpha.13
Minor Changes
- #2719
57d6edfThanks @dimaMachina! - check for deprecated arguments and object field nodes in graphql operations inno-deprecatedrule
4.0.0-alpha.12
Patch Changes
-
#2711
b15df66Thanks @dimaMachina! - Reenable runningrequire-id-when-availableonFragmentDefinition -
#2713
8b6d46bThanks @dimaMachina! -naming-conventionrule should not fail when aliasing underscore fields
4.0.0-alpha.11
Major Changes
- #2281
c53cb4eThanks @maciesielka! - Add new config optionignoredFieldSelectorstono-unused-fieldsrule to ignore all the relay pagination fields for every connection exposed in schema for example
4.0.0-alpha.10
Major Changes
- #2319
b3c73dcThanks @maciesielka! - Enforcerequire-selectionsonFragmentSpreads withinGraphQLUnionTypes
4.0.0-alpha.9
Patch Changes
- #2277
3b35baeThanks @yoavain-sundaysky! - fix false positive cases forrequire-import-fragmenton Windows, whengraphql-config’sdocumentskey contained glob pattern => source file path of document contained always forward slashes
4.0.0-alpha.8
Minor Changes
-
#2385
afa8b8aThanks @deathemperor! - feat: add a new option{for alphabetize rule to sort fieldsselection set -
#2293
01f7087Thanks @yoavsion! - Support the fragment spread group when defining alphabetize rule’s groups with new option...
4.0.0-alpha.7
Major Changes
-
#2598
e771499Thanks @bmulholland! - 1. graphql plugin can now we be specified asplugins: { - '@graphql-eslint': { - graphqlPlugin.rules - } + '@graphql-eslint': graphqlPlugin }-
Config rules should now be accessed through the
rulespropertyrules: { - ...graphqlESLint.configs['flat/operations-recommended'] + ...graphqlESLint.configs['flat/operations-recommended'].rules -
processor can now be specified with accessing
processorproperty- processor: graphql.processors.graphql + processor: graphqlPlugin.processor -
The plugin can now be imported using a default import
- import * as graphql from '@graphql-eslint/eslint-plugin' + import graphqlPlugin from '@graphql-eslint/eslint-plugin'
-
Patch Changes
- #2692
dcf4e35Thanks @dimaMachina! - fix some issues on Windows by running tests with matrix on github CI
4.0.0-alpha.6
Patch Changes
-
#2616
c0f1b07Thanks @fcortes! - The import attribute syntax (with { type: “json” }) is still experimental so warnings showed up when using the library as it was being used to import the package.json file to extract the package versionAs an alternative, the current version will be injected on build time through tsup configuration.
4.0.0-alpha.5
Patch Changes
- #2605
2ae64e1Thanks @dimaMachina! - fix types exports by@arethetypeswrong/clipackage
4.0.0-alpha.4
Patch Changes
- #2483
d52585aThanks @dimaMachina! - fix compatibility with Node.js v22
4.0.0-alpha.3
Patch Changes
-
#2466
da608d7Thanks @dimaMachina! - fixrequire is not definedin flat configs for Vue/Svelte projects -
#2468
733a66eThanks @dimaMachina! - - rename flat configs exports-graphql.flatConfigs['schema-recommended'].rules +graphql.configs['flat/schema-recommended'] -graphql.flatConfigs['schema-relay'].rules +graphql.configs['flat/schema-relay'] -graphql.flatConfigs['schema-all'].rules +graphql.configs['flat/schema-all'] -graphql.flatConfigs['operations-recommended'].rules +graphql.configs['flat/operations-recommended'] -graphql.flatConfigs['operations-all'].rules +graphql.configs['flat/operations-all']- fix with programmatic usage when passing large schema as string causes
pattern too longerror - fix loading ESM
graphql.config.jsconfigs
- fix with programmatic usage when passing large schema as string causes
4.0.0-alpha.2
Patch Changes
-
#2455
08a8a13Thanks @dimaMachina! - fix caching issues forno-unreachable-types/no-unused-fieldsrules for multi projects -
#2458
9096458Thanks @dimaMachina! - addmetaobject withnameandversiontoparserandprocessorto be compatible with ESLint 9
4.0.0-alpha.1
Major Changes
4.0.0-alpha.0
Major Changes
-
#1794
4079167eThanks @B2o5T! - - bring backpossible-type-extensionrule toschema-recommendedconfig- add
unique-operation-nameandunique-fragment-namerules tooperations-recommendedconfig
The concept of sibling operations provided by graphql-config’s
documentsfields 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
relayconfig toschema-relay
To avoid confusing when users extend this config for executable definitions (operations and fragments)
- add
-
#1812
bf475e88Thanks @B2o5T! - -alphabetizerule changes-
add
definitions: trueoption forschema-all/operations-allconfigs -
rename
values: ['EnumTypeDefinition']tovalues: true -
rename
variables: ['OperationDefinition']tovariables: true -
add
groups: ['id', '*', 'createdAt', 'updatedAt']forschema-all/operations-allconfigs -
require-id-when-availablerule changes- rename rule to
require-selections
- rename rule to
-
update
schema-all/operations-allconfigs -
require-descriptionrule changes- add
rootField: trueoption forschema-recommendedconfig
- add
-
require
eslintat least>=8.44.0as peerDependency -
naming-convention- add new options for
schema-recommendedconfig
{ 'EnumTypeDefinition,EnumTypeExtension': { forbiddenPrefixes: ['Enum'], forbiddenSuffixes: ['Enum'] }, 'InterfaceTypeDefinition,InterfaceTypeExtension': { forbiddenPrefixes: ['Interface'], forbiddenSuffixes: ['Interface'] }, 'UnionTypeDefinition,UnionTypeExtension': { forbiddenPrefixes: ['Union'], forbiddenSuffixes: ['Union'] }, 'ObjectTypeDefinition,ObjectTypeExtension': { forbiddenPrefixes: ['Type'], forbiddenSuffixes: ['Type'] } } - add new options for
-
remove graphql-js’
unique-enum-value-namesrule -
rename
no-case-insensitive-enum-values-duplicatestounique-enum-value-namesSince this rule reports case-insensitive enum values duplicates too
-
require-nullable-result-in-rootrule changesDo not check subscriptions
-
-
#1795
2f46a717Thanks @B2o5T! - - removeparserOptions.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?: IGraphQLConfigfor programmatic usage
-
-
#1793
6593482bThanks @B2o5T! - drop support of Node.js 12/14/16, GraphQL 14/15 -
#1792
804f8b61Thanks @B2o5T! - RemoveGraphQLRuleTesterfrom bundle, to test your rules use regularRuleTesterfrom eslintNote: with this change unnecessary dependency
@babel/code-framewas removed tooimport { RuleTester } from 'eslint' const ruleTester = new RuleTester({ parser: require.resolve('@graphql-eslint/eslint-plugin') })
Patch Changes
-
#1813
1c2d220Thanks @B2o5T! - dependencies updates:- Updated dependency
graphql-config@^4.5.0↗︎ (from^4.4.0, independencies) - Removed dependency
@babel/code-frame@^7.18.6↗︎ (fromdependencies) - Removed dependency
chalk@^4.1.2↗︎ (fromdependencies) - Removed dependency
tslib@^2.4.1↗︎ (fromdependencies) - Updated dependency
graphql@^16↗︎ (from^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0, inpeerDependencies) - Added dependency
eslint@>=8.44.0↗︎ (topeerDependencies)
- Updated dependency
-
#1792
804f8b61Thanks @B2o5T! - dependencies updates:- Removed dependency
@babel/code-frame@^7.18.6↗︎ (fromdependencies)
- Removed dependency
3.20.1
Patch Changes
- #1750
7b461a1Thanks @B2o5T! - ESLint configuration in … is invalid. Unexpected top-level property “default”. Fix targeting for legacy Node.js versions
3.20.0
Minor Changes
3.19.3
Patch Changes
- #1725
5f3f1a5Thanks @B2o5T! - fixParsing error: Cannot read properties of undefined (reading '0') eslintin VSCode
3.19.2
Patch Changes
- #1716
40c1523Thanks @BlakeGardner! - broken rule url forrequire-import-fragmentandrequire-nullable-result-in-root
3.19.1
Patch Changes
- #1665
73b1087Thanks @B2o5T! - fixTypeError: Cannot read properties of undefined (reading 'kind')forrequire-nullable-result-in-rootrule
3.19.0
Minor Changes
- #1657
0a571bbThanks @nishtahir! - Addrequire-nullable-result-in-rootrule to report on non-null fields in root types
3.18.0
Minor Changes
- #1540
afea5feThanks @louisscruz! - [naming-convention]: add new optionsrequiredPrefixes,requiredSuffixes
3.17.0
Minor Changes
3.16.2
Patch Changes
3.16.1
Patch Changes
-
#1467
12f802cThanks @B2o5T! - fixrequire-id-when-availablecheck unions as well -
#1469
6b4e20cThanks @B2o5T! - fixno-unreachable-typesignore types from directive arguments with request locations
3.16.0
Minor Changes
- #1443
9916d8dThanks @FloEdelmann! - Add newrequire-import-fragmentrule that reports fragments which were not imported via an import expression.
3.15.0
Minor Changes
-
#1386
c5fb2dcThanks @B2o5T! - The new version no longer crashes on VSCode-ESLint, when schema/siblings contain validation errors, also, GraphQL-ESLint now hasstrict: trueintsconfig.jsonand extends@typescript-eslintrecommended 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
3.14.3
Patch Changes
3.14.2
Patch Changes
- #1346
f031f56Thanks @B2o5T! - report errors on first character for*.vue/*.sveltecode, due graphql-tag-pluck limitation we can’t know right location
3.14.1
Patch Changes
-
#1344
8e40946Thanks @B2o5T! - dependencies updates:- Added dependency
tslib@^2.4.1↗︎ (todependencies)
- Added dependency
-
#1344
8e40946Thanks @B2o5T! - fixschema-all/operations-allconfigs error - ESLint couldn’t find the config ”./configs/base” addtslibto dependencies
3.14.0
Minor Changes
-
#1335
2e4dfa0Thanks @B2o5T! - support new ESLint flat config system, exportflatConfigs -
#1330
bab45ccThanks @B2o5T! - add new rulerequire-nullable-fields-with-oneof -
#1331
0f7afa5Thanks @B2o5T! - add new rulerequire-type-pattern-with-oneof -
#1144
43e2861Thanks @TuvalSimha! - Add new optiongroupstoalphabetizerule -
#1303
c6d5bb7Thanks @tshedor! - [require-description] addrootFieldoption for only field definitions withinQuery,Mutation, andSubscriptionroot types -
#1141
b1f2730Thanks @TuvalSimha! - add new optionprefixformatch-document-filenamerule -
#1314
a4f885aThanks @B2o5T! - add ESLint suggestions for followinggraphql-jsrules:fields-on-correct-typeknown-argument-namesknown-type-namespossible-type-extensionscalar-leafsvalue-literals-of-correct-type
-
#1316
1f21fc8Thanks @FloEdelmann! - feat: addlone-executable-definitionto require all queries, mutations, subscriptions and fragments to be located in separate files -
#1338
fedec34Thanks @B2o5T! - updategraphql-configto v4.4.0 that no longer requirestypescriptto be installed -
#1334
abcfc14Thanks @B2o5T! - add new ruleno-one-place-fragments
Patch Changes
- #1338
fedec34Thanks @B2o5T! - dependencies updates:- Updated dependency
graphql-config@^4.4.0↗︎ (from^4.3.6, independencies)
- Updated dependency
3.13.1
Patch Changes
-
#1240
6a27f2aThanks @renovate! - dependencies updates:- Updated dependency
@graphql-tools/utils@^9.0.0↗︎ (from^8.12.0, independencies)
- Updated dependency
-
#1251
cf659f3Thanks @B2o5T! - fix increased memory usage for ESLint CLI
3.13.0
Minor Changes
- #1222
cf59b0aThanks @B2o5T! - feat: reload schema/documents cache (only for current project) in VSCode
3.12.0
Minor Changes
Patch Changes
-
#1201
ba26511Thanks @B2o5T! - dependencies updates:- Updated dependency
graphql-config@^4.3.6↗︎ (from^4.3.5, independencies)
- Updated dependency
-
#1198
2886adfThanks @B2o5T! - fix passing pluck config viagraphql-config#extensionsfield renameextensions.graphqlTagPlucktoextensions.pluckConfigfix performance regression while usingprocessor: '@graphql-eslint/graphql'
3.11.2
Patch Changes
- #1170
0b8acdcThanks @B2o5T! - fix race condition of loadingloadGraphQLConfig()whenprocessor.preprocess()can be called beforeparseForESLint()
3.11.1
Patch Changes
-
#1168
9bc4e1bThanks @B2o5T! - return code as-is inpreprocessin case of parsing error, sort eslint/graphql-eslint errors inpostprocessby line/column -
#1165
eab5492Thanks @B2o5T! - fix race condition ofloadGraphQLConfig() -
#1167
2f6c02fThanks @B2o5T! - makeRuleDocsInfotype optional
3.11.0
Minor Changes
-
#1156
6ac42cfThanks @JimmyPaolini! - Using configuration options forgraphql-tag-pluckthroughgraphql-configAllow setup customglobalGqlIdentifierName,modules.identifierandgqlMagicComment -
#1163
0d3fe5bThanks @B2o5T! - improveRuleDocsInfotype, setdescriptionandurlas required fields
3.10.7
Patch Changes
- b6de7ff: fix(GraphQLRuleTester): provide output field for
GraphQLInvalidTestCasetype
3.10.6
Patch Changes
- 39ab684: fix(alphabetize): should not fail when selection is aliased
3.10.5
Patch Changes
- 712a8fe: fix(selection-set-depth): fix
TypeErrorfrom ESLint suggestions, don’t provide suggestions for fragment that can be in a separate file - 01421ae: fix(no-unreachable-types): ignore directives with Request Definitions locations
3.10.4
Patch Changes
- 5593891: fix(known-directives): support
ignoreClientDirectivesforOperationDefinition
3.10.3
Patch Changes
- 8a3b584: fix broken report highlighting when processor is used
3.10.2
Patch Changes
- daa04bb: feat: support select
idfield with an alias inrequire-id-when-availablerule - 2efc772: fix: processor should always return code string in preprocess method
3.10.1
Patch Changes
- cf687a5: [relay-page-info]: allow nullable
startCursorandendCursorif there are no results
3.10.0
Minor Changes
- 7251269: feat: new rule
relay-connection-types - 7251269: feat: new rule
relay-edge-types - 7251269: feat: new rule
relay-page-info - 7251269: feat: new rule
relay-arguments - 7251269: feat: new config
plugin:@graphql-eslint/relay - 7251269: fix: adjust suggestion fix location for code-files
- edbec90: feat: update
graphql-configto fix loading schema via url
Patch Changes
- 4bcee4a: fix: surface the original error while loading schema in ESLint server
- 4bcee4a: fix: clarify error message for outdated version of
graphqlpackage - 3e821de: fix: allow single letter for snake_case and UPPER_CASE in
naming-conventionrule
Special thanks to @connorjs
3.9.1
Patch Changes
- 56d6ff3: [known-fragment-names]: fix when fragment used on interface and union
- 3fe3761: print debug information with
DEBUGenv variable, exampleDEBUG=graphql-eslint:* eslint .
3.9.0
Minor Changes
- 9c575c6: feat: add
definitionsoption foralphabetizerule - bcbda42: feat: add suggestions for
require-id-when-available,require-deprecation-date,no-deprecatedandno-scalar-result-type-on-mutationrules - 1f697f0: feat: add suggestions for
no-duplicate-fields,no-hashtag-descriptionandselection-set-depthrules - db22ba5: feat: add suggestions for
no-typename-prefix,no-root-type,no-case-insensitive-enum-values-duplicatesrules - b04a8d5: feat: add
ignoreClientDirectivesoption forknown-directivesrule - 63c5c78: feat: add suggestions for
description-style,input-nameandno-anonymous-operationsrules
Patch Changes
- 58b5bfd: fix: false negative case when nested fragments used in
require-id-when-availablerule - 2cbaa60: fix: check nested selections in fragments in
require-id-when-availablerule - d9386ad: fix autofix sort for variables in
alphabetizerule
3.8.0
Minor Changes
- 0da135f: feat: add new option
OperationDefinitioninrequire-descriptionrule - 1729313: feat: add autofix for
alphabetizerule and change sort order to lexicographic - d9bdbd3: feat: add new style
matchDocumentStyleformatch-document-filenamerule
Patch Changes
- 7a5ebe0: fix error in
no-unreachable-typesrule on graphql@16.3.0 - af22d9d: chore: clarify report message for
require-descriptionrule - 1729313: fix ESTree parser, convert
loc.columnto 0-based column number
3.7.0
Minor Changes
- 6f8c3b6: fix: find graphqlrc files relative to linted file
3.6.0
Minor Changes
- 624d604: fix: ignore root types in
strict-id-in-typesrule
3.5.0
Minor Changes
- cc9a561: feat: ignore fragments in
require-id-when-availablerule
3.4.0
Minor Changes
- 75ec7d1: fix false positive case in
possible-type-extensionrule when schema is separate into multiple files
3.3.0
Minor Changes
- b4c5d55: feat: add new option ignorePattern for
naming-conventionrule - f20f7de: feat: remove the need of
#importcomments in favor ofparserOptions.operations
3.2.0
Minor Changes
- 2c73cb7: feat: add suggestions for
naming-conventionrule - 11b3af6: feat: support multiple id field names in
require-id-when-availablerule
Patch Changes
- 503dd9f: fix error report location for
graphql-jsrules - 9378d24: Fix exports in package.json for react-native projects
3.1.0
Minor Changes
- 37c1579: feat: convert fix to suggestions in
no-unreachable-typesandno-unused-fieldsrules
Patch Changes
- 988e445: fix: ignore operations and fragments in
no-hashtag-descriptionrule
3.0.1
Patch Changes
- 32ec2cb: fix: ignore arguments in
require-field-of-type-query-in-mutation-resultrule - 5a259ce: chore: remove
unique-enum-value-namesrule from recommended config - 36d5334: fix: ignore arguments in
no-scalar-result-type-on-mutationrule
3.0.0
Major Changes
-
a69f0be: ❗ BREAKING CHANGE ❗
Split
recommendedconfig to 2 modes: “schema” and “operations”.This was done in order to use
recommendedandallconfigs inschema-onlyprojects where it is not possible to provide operations.recommendedandallconfigs were divided to 4 configs:schema-recommended- enables recommended rules for schema (SDL) developmentschema-all- enables all rules for schema (SDL) developmentoperations-recommended- enables recommended rules for consuming GraphQL (operations) developmentoperations-all- enables all rules for consuming GraphQL (operations) development
If you are migrating from v2 where
recommendedwas introduced, please change the following:{ "overrides": [ { "files": ["*.js"], "processor": "@graphql-eslint/graphql" }, { "files": ["*.graphql"], - "extends": "plugin:@graphql-eslint/recommended" + "extends": "plugin:@graphql-eslint/schema-recommended" } ] }If you are in a project that develops the GraphQL schema, you’ll need
schemarules.If you are in a project that develops GraphQL operations (query/mutation/subscription), you’ll need
operationsrules.If you are in a monorepo project, you probably need both sets of rules.
-
a69f0be: ❗ BREAKING CHANGE ❗
feat:
description-stylenow have default description styleblock. -
a69f0be: ❗ BREAKING CHANGE ❗
feat: remove
queryoption inno-root-typeas it’s impossible to have write-only schema. -
a69f0be: ❗ BREAKING CHANGE ❗
- rename
avoidprefix in rules tono. - remove
avoid-operation-name-prefixandno-operation-name-suffix
All rules that had a
avoidprefix now have anoprefix.Rules
avoid-operation-name-prefixandno-operation-name-suffixwere removed because the same things can be validated bynaming-conventionrule.Before
{ '@graphql-eslint/avoid-operation-name-prefix': [ 'error', { keywords: ['Query', 'Mutation', 'Subscription', 'Get'] } ], '@graphql-eslint/no-operation-name-suffix': 'error' }After
{ '@graphql-eslint/naming-convention': [ 'error', { OperationDefinition: { style: 'PascalCase', forbiddenPrefixes: ['Query', 'Mutation', 'Subscription', 'Get'], forbiddenSuffixes: ['Query', 'Mutation', 'Subscription'] } } ] } - rename
-
a69f0be: ❗ BREAKING CHANGE ❗
feat: add new options for
naming-conventionruleOptions for
naming-conventionare changed. New optiontypesincludes the following kinds:ObjectTypeDefinitionInterfaceTypeDefinitionEnumTypeDefinitionScalarTypeDefinitionInputObjectTypeDefinitionUnionTypeDefinition
Added new options:
ArgumentDirectiveDefinitionVariableDefinition
Option
QueryDefinitionwas removed in favor ofASTspecific selectorFieldDefinition[parent.name.value=Query].Before
{ '@graphql-eslint/naming-convention': [ 'error', { ObjectTypeDefinition: 'PascalCase', InterfaceTypeDefinition: 'PascalCase', EnumTypeDefinition: 'PascalCase', ScalarTypeDefinition: 'PascalCase', InputObjectTypeDefinition: 'PascalCase', UnionTypeDefinition: 'PascalCase', FieldDefinition: 'camelCase', InputValueDefinition: 'camelCase', QueryDefinition: { forbiddenPrefixes: ['get'] }, leadingUnderscore: 'allow', trailingUnderscore: 'allow' } ] }After
{ '@graphql-eslint/naming-convention': [ 'error', { types: 'PascalCase', FieldDefinition: 'camelCase', InputValueDefinition: 'camelCase', 'FieldDefinition[parent.name.value=Query]': { forbiddenPrefixes: ['get'] }, allowLeadingUnderscore: true, allowTrailingUnderscore: true } ] } -
a69f0be: ❗ BREAKING CHANGE ❗
feat: add new options for
require-descriptionruleOptions for
require-descriptionare changed. New optiontypesincludes the following kinds:ObjectTypeDefinitionInterfaceTypeDefinitionEnumTypeDefinitionScalarTypeDefinition(new in v3)InputObjectTypeDefinitionUnionTypeDefinition
Before
{ '@graphql-eslint/require-description': [ 'error', { on: [ 'ObjectTypeDefinition', 'InterfaceTypeDefinition', 'EnumTypeDefinition', 'InputObjectTypeDefinition', 'UnionTypeDefinition', 'FieldDefinition', 'InputValueDefinition', 'EnumValueDefinition', 'DirectiveDefinition' ] } ] }After
{ '@graphql-eslint/require-description': [ 'error', { types: true, FieldDefinition: true, InputValueDefinition: true, EnumValueDefinition: true, DirectiveDefinition: true } ] }
2.5.0
Minor Changes
- 64c302c: feat: add new rule
no-root-type - c837c99: fix false positive case in
no-unreachable-typesrule when directive on root schema is used - 1914d6a: fix false positive case in
known-fragment-nameswhen import nested fragment
Patch Changes
- 4c29de7: fix: make works graphql-eslint in yarn berry
2.4.1
Patch Changes
- dc29c27: update graphql-js peer dependency range
2.4.0
Minor Changes
- 81fae5a: GraphQL v16 support
2.3.2
Patch Changes
- 86b3709: fix error report for
no-unused-fieldsandno-unreachable-typesrule - cf3cc4f: fix error report for
require-deprecation-reasonandrequire-field-of-type-query-in-mutation-resultrule - 578b890: fix error report for
require-deprecation-daterule - ebab010: fix error report for
alphabetizerule - 7dacfe5: fix error report for
avoid-scalar-result-type-on-mutationrule - f712780: fix error report for
unique-fragment-nameandunique-operation-namerule - d081fcc: fix error report for
selection-set-depthrule and forgraphql-jsrules - 46f03f7: fix error report for
description-stylerule - b36a32c: fix error report for
strict-id-in-typesandnaming-conventionrule - 7aa8157: fix error report for
input-namerule - a285de3: fix error report for
require-deprecation-reasonandrequire-field-of-type-query-in-mutation-resultrule - ced6789: fix error report for
no-deprecatedrule
2.3.1
Patch Changes
- 98b6bcb: fix: adjust report location for
no-operation-name-suffixrule - 1bacedd: fix: adjust report location for
no-anonymous-operationsrule - c42cee5: fix: adjust report location for
avoid-typename-prefixrule - eb4a851: fix: adjust report location for
require-descriptionrule
2.3.0
Minor Changes
- f2a6635: add new rule
require-field-of-type-query-in-mutation-result - 44a6c73: fix false negative case for
no-undefined-variablesrule - ed6644b: feat: support ESLint 8
- f713823: fix false positive case for
no-unused-variablesrule - c7a8b33: add new rule
alphabetize
2.2.0
Minor Changes
- 1dd2f43: feat: add recommended and all configs
- 1dd2f43: add new rule require-deprecation-date
- 1dd2f43: add new rule avoid-scalar-result-type-on-mutation
2.1.0
Minor Changes
- c6886ba: [New rule] Compare operation/fragment name to the file name
- 2032a66: fix
no-unreachable-typesrule when interface implementing other interface
Patch Changes
- c6886ba: NEW PLUGIN: Compare operation/fragment name to the file name
- 7b12bbf: fix(no-hashtag-description): allow hashtag comments between fields and arguments
2.0.2
Patch Changes
- 403b946: enhance(eslint-plugin): refactor the parts using tools
2.0.1
Patch Changes
- 0fb8d51: Update range of graphql-config and graphql-tools to fix documents loading issues
2.0.0
Major Changes
- 17014ee: Drop support for Node 10, update to latest graphql-tools
Patch Changes
- c0b12a5: fix(siblings): return virtual path for code files instead of real path
- 3701b2a: use
graphql-configeven there is nographql-configconsmiconfig file - 44f0d73: fix false negative cases for
no-unreachable-typesrule - 5065482: fix caching for
no-unreachable-typesandno-unused-fieldsrules - 5e8ebd8: add tests for schema loaders
1.1.4
Patch Changes
- 34b4300: fix(graphql-config): pass real filepath to
gqlConfig.getProjectForFile
1.1.3
Patch Changes
- ca8b521: fix: code filepath in unique-fragment-name and unique-operation-name rules
1.1.2
Patch Changes
- e7d8496: fix: documents in graphql-config can be null
1.1.1
Patch Changes
- f428d46: feat: improve generate-docs and types
- 5a7e9a7: fix comments in files that contains import comments
- 4348dcc: update eslint, various improvements
- 01ade2e: fix unique-fragment-name and no-unused-fragments rule
1.1.0
Minor Changes
- a44d426: support #import in known-fragment-names rule
1.0.2
Patch Changes
- 85d842e: add
no-unused-fieldsrule - 6b5b90b: graphql-js migrate to .ts, fix links
- f0560b0: Fix for missing exports for testkit
1.0.1
Patch Changes
- 1d85025: fix: allow anonymous operations for naming-convention rule
- a92267b: fixes for graphql-js rules issues
- 45acfde: Fix console.warn typo in selection-set-depth rule
- 533d123: Fix issues with Windows paths
1.0.0
Major Changes
-
14211d6: feat: remove
prettierrule, add related docsBREAKING CHANGE: Remove
prettierRuleSince prettier itself support now linting GraphQL code and syntax, we removed the need for this rule from this package.
For more information, see:
-
61251e7: BREAKING CHANGE: Remove deprecated rule
validate-against-schema.BREAKING CHANGE: Remove deprecated rule
validate-against-schema.If you are using
validate-against-schema, please remove it and specify the exact rules that you need.As a drop-in replacement for the whole set of rules we had in
validate-against-schema, you can use this:{ '@graphql-eslint/executable-definitions': 'error', '@graphql-eslint/fields-on-correct-type': 'error', '@graphql-eslint/fragments-on-composite-type': 'error', '@graphql-eslint/known-argument-names': 'error', '@graphql-eslint/known-directives': 'error', '@graphql-eslint/known-fragment-names': 'error', '@graphql-eslint/known-type-names': 'error', '@graphql-eslint/lone-anonymous-operation': 'error', '@graphql-eslint/lone-schema-definition': 'error', '@graphql-eslint/no-fragment-cycles': 'error', '@graphql-eslint/no-undefined-variables': 'error', '@graphql-eslint/no-unused-fragments': 'error', '@graphql-eslint/no-unused-variables': 'error', '@graphql-eslint/overlapping-fields-can-be-merged': 'error', '@graphql-eslint/possible-fragment-spread': 'error', '@graphql-eslint/possible-type-extension': 'error', '@graphql-eslint/provided-required-arguments': 'error', '@graphql-eslint/scalar-leafs': 'error', '@graphql-eslint/one-field-subscriptions': 'error', '@graphql-eslint/unique-argument-names': 'error', '@graphql-eslint/unique-directive-names': 'error', '@graphql-eslint/unique-directive-names-per-location': 'error', '@graphql-eslint/unique-enum-value-names': 'error', '@graphql-eslint/unique-field-definition-names': 'error', '@graphql-eslint/unique-input-field-names': 'error', '@graphql-eslint/unique-operation-types': 'error', '@graphql-eslint/unique-type-names': 'error', '@graphql-eslint/unique-variable-names': 'error', '@graphql-eslint/value-literals-of-correct-type': 'error', '@graphql-eslint/variables-are-input-types': 'error', '@graphql-eslint/variables-in-allowed-position': 'error' } -
61251e7: Bump dependencies and update minimum Node version to
v12
Minor Changes
- 63dc00a: NEW RULE: avoid-typename-prefix
Patch Changes
-
9a40163: Fix issues with
avoid-operation-name-prefixand error with caseSensitive -
1257d51: fix: original file should not be considered as file block
Related #88
ESLint supports
textdirectly, no need to use the hacky way. See https://github.com/eslint/eslint/blob/master/lib/linter/linter.js#L1298Related
eslint-plugin-prettier’s issue hae been fixed at https://github.com/prettier/eslint-plugin-prettier/pull/401 -
6d4a356: Fix loadSiblings file location
-
388a0bf: Support OperationDefinition in naming-convention rule
-
5ff184b: Fix issues with
lone-schema-definitionrule -
7a04e1e: Added support for direcrives in
no-unreachable-typesrule -
ef8d776: Fix errors always thrown with unique-type-names rule
0.9.1
Patch Changes
- beb3b14: Support possible types in no-unreachable-types rule
0.9.0
Minor Changes
- 4693f27: [New rule] strict-id-in-types: use this to enforce output types to have a unique indentifier field unless being in exceptions
0.8.1
Patch Changes
- 46742f0: no-hashtag-description allows eslint directives
- 77eafd2: no-unreachable-types pass if type implements reachable interface
- 13fd2fa: Fix compatibility issues with graphql v14
0.8.0
Minor Changes
- 5b35139: Add options to input-name rule.
- 46d759e: [naming-convention] Add forbiddenPrefixes and forbiddenSuffixes options. Add QueryDefinition which targets queries ( may break existing config if FieldDefinition is used )
Patch Changes
- 619d9eb: fix for
no-unreachable-typesdoes not recognize implemented interfaces - 2f6313b: Fix issues with built artifact containing parts of graphql-js library
0.7.2
Patch Changes
- 80f9090: Fix missing “no-unreachable-types”
0.7.1
Patch Changes
- a5e1e6e: Fix issues with processor parsing errors breaking the eslint execution
0.7.0
Minor Changes
- 5e1bbe6: NEW RULE: avoid-duplicate-fields
- b093f88: NEW RULE: selection-set-depth
- 2df9134: NEW RULE: no-hashtag-description
- 625f083: New rule: no-unreachable-types
- 174a66f: [naming-convention] Allow each definition to take either a strng or object. Object can take the following keys: style (naming style), prefix (value must have prefix) and suffix (value must have suffix)
- d3ff768: NEW RULE: no-deprecated
- 63cecdd: Added code file compatibility for graphql-config projects
Patch Changes
- 0094548: Load graphql config file only once
- e26a5d4: Fix issues with loading schemas from code-files
- e6edc88: Added prefix to error thrown by the parser
- 1594288: Improve error messages for parserServices
- 4942b58: Optimisation of sibling operations loading (cache by project)
- 2df9134: Fixed missing
locproperty when rawNode is called on Document node - a57d4f5: fix(naming-convention): fix issues with numeric values
0.6.0
Minor Changes
- e9d1d53: NEW RULE: unique-operation-name
- e9d1d53: Port all graphql-js validation rules to standalone rules
- e9d1d53: New rule: unique-fragment-name
Patch Changes
- e9d1d53: Fix issues with AST converter and root Document causing to invalid ASTs when rawNode is called
- e9d1d53: Fix issue with siblings operations and getOperation method
0.5.0
Minor Changes
- 937b322: test release
- 937b322: Allow to load siblings operations
- 937b322: feature(processor): apply processor automatically on code files
Patch Changes
- 937b322: Fix processor compatibility with other plugins
- 937b322: Better integration of siblings operations and graphql-config
- 937b322: fix(parser): better performance, make sure schema is loaded and cached
- 937b322: fix(parser): better support for graphql-config intergration and project detection
0.4.4
Patch Changes
- c9bbdbe: Added
supportsAutofixto the processor. Fixes can be applied in JS,TS files now.
0.4.3
Patch Changes
- 0fe0f68: Fix a bug in the input-name rule to make sure it only checks fields on the Mutation type
0.4.2
Patch Changes
- 0dab062: [require-id-when-available] fix for inline fragments on interfaces (#139)
0.4.1
Patch Changes
- 52a98df: Ignore NoUnusedFragmentsRule validation for fragments operations
- 52a98df: Improve error reported from validate-against-schema (added the rule name to the error)
0.4.0
Minor Changes
- 80e922c: Improved
validate-against-schemarule configuration (allow to customize rules)
Patch Changes
- 80e922c: Fix issues with
.rawNode()values
0.3.3
Patch Changes
- 2b87cb1: Fix compatibility with GraphQL v14
0.3.2
Patch Changes
- da77db6: Fix
schemaOptionssupport
0.3.1
Patch Changes
- 9f0ab04: Fixes README and missing docs in published package
0.3.0
Minor Changes
- 3838852: Initial minor release from this repo.
- 5809bdc: Fixes for docs and package publish