-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support extracting GraphQL documents from vue
/svelte
files
#480
Comments
As I mention in your last issue #479 I need a reproduction repo with minimal dependencies |
Closing due to inactivity. Please feel free to reopen if you still need help. |
I still experience this bug. @B2o5T do you have a template that I could use to produce a reproduction? I would also suggest to add such a template prominently in the new issue template. |
Just a simple reproduction with minimal dependencies installed, take a look of examples folder for inspiration |
Okay, here you go: https://stackblitz.com/edit/github-7j6u77?file=.eslintrc.cjs,test.vue |
@tobiasdiez your error goes from eslint as he doesn't know how to parse add https://www.npmjs.com/package/vue-eslint-parser for parsing add |
Thanks for looking into this @B2o5T. However, I still cannot make it work. In my production env, I do use vue-eslint-parser but that doesn't fix the error. And even after installing
Debugging a bit, I think the issue is here: |
@tobiasdiez You are right, sorry for my misunderstanding (since I don't use vue 😜). I replaced You can try alpha version |
vue
/svelte
files
should be fixed in |
Thanks a lot, it is indeed working now. Nice! Two things I've observed so far:
|
could you send a code snippet with wrong line? |
Just add a template tag at the beginning of the existing example: <template>
<span>test</span>
</template>
<script>
/* eslint-disable no-unused-vars */
const GET_USER = /* GraphQL */ `
query {
user {
name
}
}
`;
const GET_ANOTHER_USER = /* GraphQL */ `
query UserQuery {
user {
name
}
}
`;
</script> The errors are still claimed to be on line 5 and 13 although they should be 3 lines (= lines of template) further down. |
Now that graphql-hive/graphql-eslint#480 is fixed.
Describe the bug
Linting vue files with the graphql plugin enabled leads to the following error:
To Reproduce
Enable linting of vue files using the plugin by specifying the following override:
and invoke
eslint --ext .graphql,.vue
. The error appears and points to the first instance where a html tag has some attribute, e.g. the above error is created by the following register.vue file:Expected behavior
No error, and linting of the vue file proceeds.
Environment:
@graphql-eslint/...
: 1.0.1Additional context
According to the documentation,
graphql-tag-pluck
should be able to parse vue files so hopefully this is only a config problem.The text was updated successfully, but these errors were encountered: