Skip to content
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

vscode-eslint error when running in mono repo packages #105

Closed
jaydenseric opened this issue Jan 22, 2018 · 5 comments
Closed

vscode-eslint error when running in mono repo packages #105

jaydenseric opened this issue Jan 22, 2018 · 5 comments

Comments

@jaydenseric
Copy link
Contributor

jaydenseric commented Jan 22, 2018

With this repo/project structure:

  • api/
  • app/
    • components/
    • schema.graphql
    • .graphqlconfig (with "schemaPath": "schema.graphql")
    • package.json (with eslintConfig and eslint-plugin-graphql configured)

vscode-eslint displays this error when attempting to lint files in /app/components containing GraphQL syntax:

screen shot 2018-01-22 at 3 40 02 pm

The error (which BTW in a narrow window cuts off with an ellipses without being able scroll) suggests looking at the ESLint output, which doesn't show any errors:

screen shot 2018-01-22 at 3 40 42 pm

Interestingly, moving .graphqlconfig and schema.graphql out into the root of the project solves the errors. This is not a solution though.

Adding ./ to the schemaPath in app/.graphqlconfig has no effect.

Running eslint . in Terminal within /app works ok.

@jnwng
Copy link
Contributor

jnwng commented Jan 22, 2018 via email

@jaydenseric
Copy link
Contributor Author

Looks like graphql-config does not have a package.json engines field. I can't easily tell what versions of Node.js are supported.

@jnwng
Copy link
Contributor

jnwng commented Jan 22, 2018 via email

@jaydenseric
Copy link
Contributor Author

As a really gross temporary workaround, you can create symbolic links in the project root:

ln -s app/.graphqlconfig .graphqlconfig
ln -s app/schema.graphql schema.graphql

@jnwng
Copy link
Contributor

jnwng commented Jan 29, 2018

this affects atom too.

see kamilkisiela/graphql-config#84 and ardatan/graphql-import#63 which should allow us to use getConfigForFile here in in the supported Node range of this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants