mihai-vlc / sublime-jsfmt

jsfmt plugin for Sublime Text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with quotes in string ' and "

Peiya opened this issue · comments

Hi, thanks for bringing us this great tool.

I got some error with my strings.
Testing string:

var str = "aaaddd = '' ";

jsfmt gave me

var str = 'aaaddd = \'' ';  // not a valid string

And if I save this file again, it throws an error.

Just noticed that this is an issue in jsfmt.
I'll turn to jsfmt project.
Sorry for disturbing.

You probably use the esformatter-quotes plugin.
To fix problems like this use avoidEscape:true in your settings:

  "quotes": {
    "avoidEscape": true,
    "type": "single"
  }

Problem solved by adding those options to esformatter config. Thanks @ionutvmi !