jscs-dev / node-jscs

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

jscs autofix failed to convert escaped slash #2172

Closed AuthorProxy closed 8 years ago

AuthorProxy commented 8 years ago

Simple test case: console.log("\\" + 'test'); Converted to: console.log('\' + 'test'); (which is not valid js string)

JSCS should preserve escaping console.log('\\' + 'test'); Config file: https://gist.github.com/AuthorProxy/bffb5f9aa733e3ca6279#file-jscsrc

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