jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.97k stars 515 forks source link

Possible bug in validateQuoteMarks #2198

Closed monoblaine closed 8 years ago

monoblaine commented 8 years ago

With a simple .jscsrc file like the following:

{
  "validateQuoteMarks": { "mark": "'", "escape": true }
}

This line:

var foo = "\\";

is converted (I'm using the "fix" option) into this:

var foo = '\';

I'm using gulp-jscs btw, but this issue possibly belongs here.

Repo here: https://github.com/monoblaine/jscs-backslash-bug

markelog commented 8 years ago

We use https://github.com/sindresorhus/to-single-quotes package for fixing this, you probably should open an issue there instead