asmmahmud
asmmahmud

Reputation: 5054

can not read .eslintrc.json file in vs code in ubuntu

I'm using a .eslintrc.json file for my react.js project in my vs code editor in ubuntu platform, but, for some reasons the .eslintrc.json file can not be processed/read by the vs code editor. As soon as I open my project in vs code, I get this following error:

Cannot read config file: /home/[nonrootuser]/Desktop/react-projects/.eslintrc.json Error: Unexpected end of JSON input

The file permission and ownership has been properly set and it is the following:

-rw-rw-r--   1 [nonrootuser] [nonrootuser]    748 Apr  5 09:34 .eslintrc.json

But, still the .eslintrc.json file is not being processed/read by the vs code editor.

My help would be greatly appreciated.

Upvotes: 2

Views: 1771

Answers (1)

Nanor
Nanor

Reputation: 2570

I had a similar issue which I fixed by copying the contents of eslintrc.json into a new file, deleting the old and renaming the new file to eslintrc.json. I also deleted the contents of node_modules and ran npm install but for some reason I had to explicitly run npm install eslint-plugin-node --save-dev.

Upvotes: 2

Related Questions