Skip to content

It's impossible to disable unused-fields and must-colocate-fragment-spreads with reportUnusedDisableDirectives #152

Open
@alecmev

Description

The problem is pretty simple, this plugin has its own handling of eslint-disable directives in GraphQL strings:

if (hasPrecedingEslintDisableComment(node, ESLINT_DISABLE_COMMENT)) {
return;
}

Which is at odds with ESLint's overall approach of "run every rule enabled in the configuration, and then just swallow the errors reported by eslint-disabled code". Currently I get the following error:

Unused eslint-disable directive (no problems were reported from 'relay/unused-fields')

And there's no way around it sans just disabling reportUnusedDisableDirectives, which I don't want to do. My current workaround is to wrap offending template literals in /* eslint-disable relay/unused-fields */.

The only solution I see is to do what graphql-eslint does and utilize a processor (very preferably the same one, so that they don't clash with each other). See #153 for a related problem.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions