Skip to content

Error: Unexpected end of JSON input #2540

Closed

Description

@vanvilecks-not-dead

I get this error when I run eslint with eslint-config-airbnb in my project written in gatsby.js.

SyntaxError: Cannot read config file: C:\Users\vanvilecks\Desktop\prj\tmp\gatsby-demo\node_modules\eslint-config-airbnb\whitespace.js
Error: Unexpected end of JSON input
Referenced from: C:\Users\vanvilecks\Desktop\prj\tmp\gatsby-demo\.eslintrc.js
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (C:\Users\vanvilecks\Desktop\prj\tmp\gatsby-demo\node_modules\eslint-config-airbnb\whitespace.js:54:25)
    at Module._compile (C:\Users\vanvilecks\Desktop\prj\tmp\gatsby-demo\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)      
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Object.module.exports [as default] (C:\Users\vanvilecks\Desktop\prj\tmp\gatsby-demo\node_modules\import-fresh\index.js:32:59)
    at loadJSConfigFile (C:\Users\vanvilecks\Desktop\prj\tmp\gatsby-demo\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:2531:47)
    at loadConfigFile (C:\Users\vanvilecks\Desktop\prj\tmp\gatsby-demo\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:2615:20)

How do I fix it?

Activity

  1. ljharb commented on Jan 13, 2022

    @ljharb
    Collaborator

    What version are you using of eslint and eslint-config-airbnb?

  2. ljharb commented on Jan 13, 2022

    @ljharb
    Collaborator
  3. vanvilecks-not-dead commented on Jan 13, 2022

    @vanvilecks-not-dead
    Author

    What version are you using of eslint and eslint-config-airbnb?

    "eslint-config-airbnb": "^19.0.2" and "eslint": "^8.4.1"

  4. vanvilecks-not-dead commented on Jan 13, 2022

    @vanvilecks-not-dead
    Author

    Hmm, so the error is elsewhere?
    Okay, I'll keep looking for the error. Thanks for the answer)

  5. ljharb commented on Jan 13, 2022

    @ljharb
    Collaborator

    I'm not saying that just yet - I'm just not sure how this could be erroring.

    What's import-fresh? is that something of yours, or something eslint uses?

  6. ljharb commented on Jan 13, 2022

    @ljharb
    Collaborator

    Also, what's your eslint config look like?

  7. ljharb commented on Mar 6, 2022

    @ljharb
    Collaborator

    Closing for now, since there’s no response to my questions.

  8. kapilsriram commented on Dec 27, 2022

    @kapilsriram

    I am facing the exact issue, whenever I use "airbnb/whitespace" I get this error
    image

    eslint 8.2.0
    this package: latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions