Skip to content

Commit

Permalink
fix: graphql linting rule tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
rintaun committed Oct 2, 2021
1 parent 72d921d commit 54af855
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,40 @@ module.exports = {
],
},
},
/* GraphQL files */
/* ALL GraphQL files */
{
files: '**/*.g{,raph}ql',
extends: ['plugin:@graphql-eslint/recommended'],
rules: {
'prettier/prettier': 'error',
'@graphql-eslint/naming-convention': [
'error',
{
/*
* This is a workaround for introspection fields like __typename.
* See: https://github.com/dotansimha/graphql-eslint/issues/664
*/
leadingUnderscore: 'allow',
},
],
'@graphql-eslint/strict-id-in-types': [
'error',
{
acceptedIdNames: ['id'],
acceptedIdTypes: ['ID'],
exceptions: {
types: ['Query', 'Mutation', 'Subscription'],
suffixes: ['Payload', 'Error'],
},
},
],
},
},
/* GraphQL Schema files */
{
files: '**/schema.g{,raph}ql',
rules: {
'@graphql-eslint/executable-definitions': 'off',
},
},
/* JavaScript/TypeScript JSX files ONLY */
Expand Down

0 comments on commit 54af855

Please sign in to comment.