cjoudrey / graphql-schema-linter

Validate GraphQL schema definitions against a set of rules
MIT License
694 stars 62 forks source link

lint-disable-line doesn't work when a field has a description #289

Open vikstrous2 opened 3 years ago

vikstrous2 commented 3 years ago

linter version: 2.0.1

$ graphql-schema-linter example.graphql
<redacted>/example.graphql
1:1 A `PageInfo` object type is required as per the Relay spec.  relay-page-info-spec
4:1 The object type `Query` is missing a description.            types-have-descriptions
5:3 The field `Query.A` is not camel cased.                      fields-are-camel-cased
5:3 The field `Query.A` is missing a description.                fields-have-descriptions
7:1 The enum type `A` is missing a description.                  types-have-descriptions
8:3 The enum value `A.Wrong` should be uppercase.                enum-values-all-caps

✖ 1 error detected
$ cat example.graphql
schema {
  query: Query
}
type Query {
  A: String
}
enum A {
  """
  description
  """
  Wrong # lint-disable-line enum-values-all-caps
}

I expected the last linter violation to be ignored.

mcwoodle commented 2 years ago

Encountered the same issue. Only workaround was to disable multiple lines like:

enum A {
  # lint-disable enum-values-all-caps
  """
  description
  """
  Wrong 
  # lint-disable enum-values-all-caps
}