CRA可选链接即使使用react脚本3.4.3也不起作用



即使使用react脚本3.4.3(例如(,CRA中的可选链接也不起作用

modelClass.withId(payload.modelRef.id)?.delete();

引发以下错误:Expected an assignment or function call and instead saw an expression no-unused-expressions

依赖项:

"@reduxjs/toolkit": "^1.4.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"antd": "^4.6.6",
"axios": "^0.20.0",
"js-cookie": "^2.2.1",
"moment": "^2.29.1",
"node-sass": "^4.14.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3",
"redux-orm": "^0.16.2",
"source-map-explorer": "^2.5.0"
},

我正在使用CRA的Redux模板。有什么解决方案吗?

您可能错过了将"parser": "babel-eslint"作为eslintConfig:添加到您的package.json文件中

"eslintConfig": {
"extends": "react-app",
"parser": "babel-eslint"
},

相关内容

  • 没有找到相关文章

最新更新