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

Error: Unexpected end of JSON input #2540

Closed
vanvilecks-not-dead opened this issue Jan 13, 2022 · 8 comments
Closed

Error: Unexpected end of JSON input #2540

vanvilecks-not-dead opened this issue Jan 13, 2022 · 8 comments

Comments

@vanvilecks-not-dead
Copy link

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?

@ljharb
Copy link
Collaborator

ljharb commented Jan 13, 2022

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

@ljharb
Copy link
Collaborator

ljharb commented Jan 13, 2022

@vanvilecks-not-dead
Copy link
Author

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

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

@vanvilecks-not-dead
Copy link
Author

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

@ljharb
Copy link
Collaborator

ljharb commented Jan 13, 2022

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?

@ljharb
Copy link
Collaborator

ljharb commented Jan 13, 2022

Also, what's your eslint config look like?

@ljharb
Copy link
Collaborator

ljharb commented Mar 6, 2022

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

@ljharb ljharb closed this as completed Mar 6, 2022
@kapilsriram
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@ljharb @kapilsriram @vanvilecks-not-dead and others