即使使用react-script 3.4.3,CRA可选链接也不起作用

问题描述

即使使用react-script 3.4.3,可选的链接在CRA中也不起作用

Error: POST https://api.digitalocean.com/v2/apps: 500 Server Error

引发以下错误modelClass.withId(payload.modelRef.id)?.delete();

依赖项:

Expected an assignment or function call and instead saw an expression  no-unused-expressions

我正在使用CRA的Redux模板。有解决办法吗?

解决方法

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

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