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

unexpected reports from requireTemplateStrings #2195

Closed GarryFlemings closed 8 years ago

GarryFlemings commented 8 years ago

No complaint here; just reporting.

I have

My .jscsrc file includes this line:

"requireTemplateStrings": {"allExcept": ["stringConcatenation"] },

http://jscs.info/rule/requireTemplateStrings indicates that'll cause "ignores strings concatenated with other strings"

As I interpret that documentation, I don't expect to see this report, yet I see it.

requireTemplateStrings: Illegal use of string concatenation. Use template strings instead. at <file> :
    18 |   let a = `a`
    19 |     , forJSCS = a + `b`
--------------------------^

This is a great project! Thanks for your time on it.

hzoo commented 8 years ago

Looking at http://jscs.info/rule/requireTemplateStrings the stringConcatenation option is actually for a string + a string. For a +b``, its a variable and a string and we would probably want that to be a template string