I am using ESLint to format my Javascript code. There I have the following piece of code:
'<div id="' + sId + '" '; ...
I get an ESLint warning telling me 'Strings should use double quotes', so I went ahead and changed the surrounding single quotes to double quotes and escaped the inner double quote. This lead to an ESLint error, which suggested I use the single quotes exactly as you see above.
Is there a way to solve this conflict so that I don't get the error or the warning? Info: I am stuck with ES5.
Many thanks in advance!
You can:
"<div id=\"" + sId + "\" ";
)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.