无法解决“错误解析错误:意外令牌..”

问题描述

我正在尝试通过 eslint,但我不断收到这个对我来说没有意义的错误。有什么想法吗?

控制台输出

➜  indb-graphgw-api git:(feat/create-online-order) ✗ docker-compose -f docker-compose.yml -f docker-compose.tests.yml exec graphgw-api-node bash
app@3c189a5907a7:/srv/indb-graphgw-api/current$ npm run check
> graphql-api@1.0.0 check /srv/indb-graphgw-api/current
> $(npm bin)/eslint . && $(npm bin)/editorconfig-checker .
/srv/indb-graphgw-api/current/tests/functional/online/absentee-bids.spec.js
  34:18  error  Parsing error: Unexpected token ..
✖ 1 problem (1 error,0 warnings)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! graphql-api@1.0.0 check: `$(npm bin)/eslint . && $(npm bin)/editorconfig-checker .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the graphql-api@1.0.0 check script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/app/.npm/_logs/2021-02-22T17_46_10_163Z-debug.log
app@3c189a5907a7:/srv/indb-graphgw-api/current$

所谓的有罪代码(带有 return 的那一行):

    function absenteeBidDataBuilder (fieldsToBeReassigned = {}) {
        const absenteeBidDataTemplate = {
            id: `${Faker.random.number()}`,subscription_id: `${Faker.random.number()}`,amount: Faker.random.number()
        };
        return { ...absenteeBidDataTemplate,...fieldsToBeReassigned };
    }

这与点差运算符有关吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)