question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.eslintrc.js is not loaded when using graphql plugin

See original GitHub issue

Hey,

I try to make use of the new graphql plugin for eslint. Therefore we are forced to use a eslintrc.js. I also tried to set eslint.validate with different settings for javascript and jsx. But:

On the console it keeps saying:

“Cannot read config file: /Users/blabla/.eslintrc.js Error: Unexpected token …”

My config looks like this:

const schema = require('./src/server/graphql/schema')
const { printSchema } = require('graphql')

const schemaString = printSchema(schema)

module.exports = {
  parser: 'babel-eslint',
  rules: {
    'graphql/template-strings': ['error', {
      env: 'apollo',
      schemaString
    }]
  },
  plugins: [
    'graphql'
  ]
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dbaeumercommented, Jul 6, 2018

I assume that the graphql plugin uses JS syntax that needs a modern JS runtime. We load ESLint into VS Code node runtime which is still 7.9.0 (given by Electron). Does this reproduce for you if you execute this in a terminal using node 7.9.0?

If not can you provide me with a GitHub repository I can clone that demos this.

P.S.: VS Code is working on moving to Electron 2.0 which will gives us a decent new JS runtime.

0reactions
vscodebot[bot]commented, Jul 13, 2018

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslintrc.js is not loaded when using graphql plugin · Issue #488
I assume that the graphql plugin uses JS syntax that needs a modern JS runtime. We load ESLint into VS Code node runtime...
Read more >
ESLint: no error highlighting for GraphQL : WEB-49805
Create a .eslintrc.js configuration file and place it at the root of the project. Configure an override to use an ESLint plugin that...
Read more >
@graphql-eslint/eslint-plugin - npm
Integrates with ESLint core (as a ESTree parser) · Works on . · Lints both GraphQL schema and GraphQL operations · Extended type...
Read more >
Failed to load plugin 'import' declared in '... » eslint-config ...
js This can happen for a couple of reasons: - The plugin name is spelled incorrectly in an ESLint configuration file (e.g. ....
Read more >
eslint/eslint - Gitter
Failed to load plugin 'react' declared in 'project-igi/.eslintrc.js': Cannot find module 'eslint-plugin-react' This can happen for a couple of ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found