eslint not recognizing template literal

心不动则不痛 提交于 2019-12-11 12:48:56

问题


const perunString = perun.times(100).toFixed(2).toString();
return `%{perunString} %`;

Which gives two errors

  1. 'perunString' is defined but never used
  2. Strings must use single quotes

回答1:


You have an error in your template interpolation syntax that is probably causing both errors:

// Before
`%{perunString} %`

// After
`${perunString} %`

Note the change from %{ to ${.



来源:https://stackoverflow.com/questions/36162158/eslint-not-recognizing-template-literal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!