无法读取 ubuntu 中 vs 代码中的 .eslintrc.json 文件

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

我在 ubuntu 平台的 vs 代码编辑器中为我的 react.js 项目使用 .eslintrc.json 文件,但是,由于某些原因,.eslintrc.json vs 代码编辑器无法 processed/read 文件。一旦我在 vs 代码中打开我的项目,我就会收到以下错误:

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

已正确设置文件权限和所有权,如下所示:

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

但是,.eslintrc.json 文件仍然没有被 vs 代码编辑器 processed/read。

我将不胜感激。

我有一个类似的问题,我通过将 eslintrc.json 的内容复制到一个新文件中,删除旧文件并将新文件重命名为 eslintrc.json 来解决这个问题。我还删除了 node_modules 和 运行 npm install 的内容,但出于某种原因我不得不明确地 运行 npm install eslint-plugin-node --save-dev.