解决方案:在 package.json 文件中添加以下配置
"rules": {
"no-console": "off",
"no-restricted-syntax": ["error", {
"selector": "CallExpression[callee.object.name='console'][callee.property.name!=/^(log|warn|error|info|trace)$/]",
"message": "Unexpected property on console object was called"
}]
},