-
Notifications
You must be signed in to change notification settings - Fork 18
adding eslint-plugin-graphql as dependency #165
Conversation
1735dda
to
2f9ff4a
Compare
Presumably we'd want to expose a config for GraphQL that just passes a bunch of stuff through to the ESLint plugin rules? |
the base graphql config for the plugin (as per the online docs) module.exports = {
parser: 'babel-eslint',
rules: {
"graphql/template-strings": ['error', {
env: 'literal'
}]
},
plugins: [
'graphql'
]
} |
Oh right, it doesn't even need schema info. We can probably just have a new config for |
on it! just updating the test |
@lemonmade should this be added to the |
d7ef74c
to
fdec394
Compare
I think so, IIRC |
how does that work if the rule from the config is not exposed (like the |
72de33c
to
2e6a921
Compare
In order to test the |
package.json
Outdated
@@ -96,6 +97,7 @@ | |||
"eslint-plugin-react": "7.11.1", | |||
"eslint-plugin-sort-class-members": "1.3.1", | |||
"eslint-plugin-typescript": "0.12.0", | |||
"graphql": "^0.13.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint-plugin-graphql
declares a peerDependency
on graphql. Isn't that enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess we only need it for testing, i can relegate to a dev dep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, ty 👍
2e6a921
to
06d7fb2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very much appreciated 👍 Thank you for pulling on this thread, then following through so quickly.
relates to https://github.com/Shopify/sewing-kit/issues/971 and https://github.com/Shopify/web/pull/6689
This plugin is used by
sewing-kit
. Rather than having sewing kit depend on both this plugin andeslint-plugin-shopify
, we can instead shuffleeslint-plugin-graphql
as a dependency of this plugin and pull in all plugins from a single dependency requirement.