即使使用react-script 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模板。有什么解决方案吗?
发布于 2020-10-20 17:25:08
您可能错过了将"parser": "babel-eslint"作为eslintConfig添加到package.json文件中:
"eslintConfig": {
"extends": "react-app",
"parser": "babel-eslint"
},https://stackoverflow.com/questions/64376610
复制相似问题