简体   繁体   中英

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM