/* eslint-disable global-require */
/**
* @type {import('eslint').ESLint.Options}
*/
module.exports = {
extends: [
'eslint-config-ns-ts',
],
plugins: ['graphql']
overrides: [
{
files: ['*.graphql', '.gql'],
rules: {
/**
* Graphql linting
*
* This plugin also lints GraphQL literal files ending on .gql or .graphql.
* In order to do so set env to 'literal' to tell eslint to check these
* files as well.
*/
'graphql/template-strings': [
'error',
{
env: 'apollo',
schemaJson: require('./graphql/schema.json'),
},
{
validators: [
'FieldsOnCorrectTypeRule',
'NoFragmentCyclesRule',
'UniqueOperationNamesRule',
'UniqueArgumentNamesRule',
],
env: 'literal',
schemaJson: require('./graphql/schema.json'),
},
],
'graphql/named-operations': [
'error',
{
env: 'literal',
schemaJson: require('./graphql/schema.json'),
},
],
'graphql/no-deprecated-fields': [
'warn',
{
env: 'literal',
schemaJson: require('./graphql/schema.json'),
},
],
// 'graphql/required-fields': [
// 'error',
// {
// env: 'literal',
// schemaJson: require('./graphql/schema.json'),
// /**
// * ensure that we never miss adding `id` to queries, as this can
// * lead to nasty issues with apollo.
// */
// requiredFields: ['id'],
// },
// ],
},
},
],
}