November 26, 2024
@graphql-eslint/[email protected]
Major Changes
-
#2598
e771499
Thanks @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
1c2d220
Thanks @dimaMachina! - - bring backpossible-type-extension
rule 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
1c2d220
Thanks @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
1c2d220
Thanks @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
c53cb4e
Thanks @maciesielka! - Add new config option
ignoredFieldSelectorstono-unused-fieldsrule to ignore all the relay pagination fields for
every connection exposed in schema for example -
#1813
1c2d220
Thanks @dimaMachina! - drop support of Node.js 12/14/16, GraphQL
14/15 -
#2418
c2d5386
Thanks @comatory! - exposing GraphQLESTreeNode type -
#2768
241936a
Thanks @dimaMachina! - - renamerequireSiblingsOperationsto
requireGraphQLOperations- rename
requireGraphQLSchemaFromContexttorequireGraphQLSchema
- rename
-
#1813
1c2d220
Thanks @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
b3c73dc
Thanks @maciesielka! - Enforcerequire-selectionson
FragmentSpreads withinGraphQLUnionTypes
Minor Changes
-
#2385
afa8b8a
Thanks @deathemperor! - feat: add a new option{for
alphabetize rule to sort fieldsselection set -
#2293
01f7087
Thanks @yoavsion! - Support the fragment spread group when defining
alphabetize rule's groups with new option... -
#2719
57d6edf
Thanks @dimaMachina! - check for deprecated arguments and object
field nodes in graphql operations inno-deprecatedrule
Patch Changes
-
#1813
1c2d220
Thanks @dimaMachina! - dependencies updates:- Removed dependency
@babel/code-frame@^7.18.6↗︎
(fromdependencies)
- Removed dependency
-
#1813
1c2d220
Thanks @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↗︎ (from
dependencies) - Removed dependency
tslib@^2.4.1↗︎ (from
dependencies) - 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↗︎ (to
peerDependencies)
- Updated dependency
-
#2455
08a8a13
Thanks @dimaMachina! - fix caching issues for
no-unreachable-types/no-unused-fieldsrules for multi projects -
#2483
d52585a
Thanks @dimaMachina! - fix compatibility with Node.js v22 -
#2743
03ccb9d
Thanks @dimaMachina! - fix error fromno-deprecatedrule
4.0.0-alpha.13: node.typeInfo(...).inputType.getFields is not a function -
#2466
da608d7
Thanks @dimaMachina! - fixrequire is not definedin flat
configs for Vue/Svelte projects -
#2277
3b35bae
Thanks @yoavain-sundaysky! - fix false positive cases for
require-import-fragmenton Windows, whengraphql-config'sdocumentskey contained glob
pattern => source file path of document contained always forward slashes -
#2735
ccd9303
Thanks @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
733a66e
Thanks @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
c0f1b07
Thanks @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
2ae64e1
Thanks @dimaMachina! - fix types exports by
@arethetypeswrong/clipackage -
#2458
9096458
Thanks @dimaMachina! - addmetaobject withnameand
versiontoparserandprocessorto be compatible with ESLint 9 -
#2692
dcf4e35
Thanks @dimaMachina! - fix some issues on Windows by running
tests with matrix on github CI -
#2711
b15df66
Thanks @dimaMachina! - Reenable running
require-id-when-availableonFragmentDefinition -
#2752
1e3e966
Thanks @dimaMachina! - fix - Config types don't satisfy
FlatConfig.Config -
#2721
cda7929
Thanks @dimaMachina! - fixno-unreachable-typesto consider
wrapped request directive argument types -
#2763
baba639
Thanks @dimaMachina! - fix
https://bit.ly/graphql-eslint-operations links -
#2713
8b6d46b
Thanks @dimaMachina! -naming-conventionrule should not fail
when aliasing underscore fields