Visual studio code 冲突的eslint规则:尾随逗号与意外标记

Visual studio code 冲突的eslint规则:尾随逗号与意外标记,visual-studio-code,eslint,prettier,Visual Studio Code,Eslint,Prettier,关于一个配置了eslint+prettier的项目的问题,该项目已经使用了一段时间 正在运行eslint--“修复我的项目”会更新文件以添加尾随逗号,例如: server.get( '/devices/ventilation/set-level/:level', executeSetLevel(domoticz.setVentilationLevel), ); 之后使用vscode时,编辑器显示关于最后一行的错误: Parsing error: Unexpected token ) e

关于一个配置了eslint+prettier的项目的问题,该项目已经使用了一段时间

正在运行eslint--“修复我的项目”会更新文件以添加尾随逗号,例如:

server.get(
  '/devices/ventilation/set-level/:level',
  executeSetLevel(domoticz.setVentilationLevel),
);
之后使用vscode时,编辑器显示关于最后一行的错误:

Parsing error: Unexpected token ) eslint
删除后面的逗号会删除上面的错误,但是再次抱怨我应该再次添加逗号,导致上面的错误

My.eslintrc.json如下所示:

{
  "extends": ["plugin:prettier/recommended"],
  "plugins": ["prettier"],
  "parserOptions": {
    "ecmaVersion": 6,
    "sourceType": "module",
    "ecmaFeatures": {
        "jsx": true
    }
  }
}
{
  "singleQuote": true,
  "trailingComma": "all"
}
而且,prettierrc看起来是这样的:

{
  "extends": ["plugin:prettier/recommended"],
  "plugins": ["prettier"],
  "parserOptions": {
    "ecmaVersion": 6,
    "sourceType": "module",
    "ecmaFeatures": {
        "jsx": true
    }
  }
}
{
  "singleQuote": true,
  "trailingComma": "all"
}

这里出了什么问题?

您解决了吗?这个问题是在我上次更新npm时出现的。