Open pleunv opened 6 years ago
It would also be useful to do this on a per-line basis. Would this be difficult?
const query = gql`
{
whatever {
field # eslint-disable-line
}
}
`
In case it helps to unblock anyone, I just tested the following locally on eslint-plugin-graphql@3.0.3
.
This does not work:
// eslint-disable-next-line graphql/no-deprecated-fields
const query = gql`
{
whatever {
deprecatedField
}
}
`;
This works:
/* eslint-disable graphql/no-deprecated-fields */
const query = gql`
{
whatever {
deprecatedField
}
}
`;
/* eslint-enable graphql/no-deprecated-fields */
Unfortunately this means that until one can migrate away from the deprecated field, any other fields within this query which are subsequently deprecated will not be caught by the linter.
Running into the same issue with # import
and fragments. Specifically, the graphql/template-strings
rule is complaining about unused variables. The variables are used in the fragments.
#import "./serverOnlyFragment.graphql"
#import "./sharedFragment.graphql"
# eslint-disable graphql/template-strings
# eslint-disable-next-line graphql/template-strings
query HomePageServer( # eslint-disable-line graphql/template-strings
# eslint-disable-next-line graphql/template-strings
$isAuthenticated: Boolean! # eslint-disable-line graphql/template-strings
$gpid: Long! # eslint-disable-line graphql/template-strings
$latitude: Float! # eslint-disable-line graphql/template-strings
$longitude: Float! # eslint-disable-line graphql/template-strings
$tld: String! # eslint-disable-line graphql/template-strings
) {
...ServerOnlyFragment
...SharedFragment
}
Expected # eslint-disable graphql/template-strings
, # eslint-disable-line graphql/template-strings
, or # eslint-disable-next-line graphql/template-strings
to disable the rule, but it doesn't.
Would be stoked to get support for eslint-disable functionality, or of exhaustive checking of imports for rules
Also having the same is as @cosmonot1
+1 for per-line disabling
Hey guys, thanks for this plugin! Probably going to make our life a lot easier :)
I'm having a couple problematic queries that I cannot immediately change in order to be validated (mostly unions with field type conflicts behind the same alias - query executes, but the validator is not a big fan), and I noticed that
# eslint-disable
does not seem to have any effect right now. Would it be feasible to add support for this, or is there currently a workaround?