自动保存时,Pretiier失败,出现SyntaxError:意外令牌*

问题描述

我对漂亮的配置有疑问。我已经将eslint以及漂亮和eslint-config-prettier添加到了项目中。我已经将漂亮的文件监视程序添加到WebStorm配置文件中。但是,当我尝试保存文件时,漂亮的文件会运行并失败,并显示以下错误

/Users/anjapopovic/Projects/docker/my-app/node_modules/.bin/prettier --write src/app/app.component.ts
/Users/anjapopovic/Projects/docker/my-app/node_modules/prettier/bin-prettier.js:6704
  return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
                        ^
SyntaxError: Unexpected token *
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:390:7)
    at startup (bootstrap_node.js:150:9

Process finished with exit code 1

这也是WebStorm更漂亮的设置:

WebStorm编辑器中更漂亮的配置

enter image description here

如果有人遇到此错误,请提供我的见解:)

解决方法

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

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

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