0

Does anyone know if and/or how to get JSCS to see the follow code as valid without ignore statements?

var something = (this.something === true)
? 'one'
: 'two';
ryanzec
  • 27,284
  • 38
  • 112
  • 169
  • I don't know. But I will say I don't like the lack of indenting... – nnnnnn Mar 07 '15 at 23:06
  • `var something= this.something === true && "one" || "two";` – dandavis Mar 07 '15 at 23:53
  • @dandavis the actually ternary would be too long to have it on one line (which is why each section is on it own line). I have actually switched to using eslint (instead of jshint+jscs) and it does not complain. – ryanzec Mar 08 '15 at 15:40
  • well, it's a strange question becuse jscs is meant to enforce good code style, and you're asking about why your code style is not accepted, and how to fix it. If you don't care about the warning from a schema, just ignore it. jscs also support a range of scemas, and not all of them will complain about your ternary as-written. these are tools to improve code readability, so if they all complain about your style, you should attack that instead of the messenger. plus the tools are dumb, so it's ok to ignore the parts you know better than it, but they are at their best catching surprises. – dandavis Mar 08 '15 at 23:26
  • "jscs also support a range of scemas, and not all of them will complain about your ternary as-written". Maybe I did not write my original question properly but that was what I was originally looking for, how to configure the schema to not complain about that format of a ternary. – ryanzec Mar 09 '15 at 09:39

0 Answers0