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

JSCS finds whitespace errors in the wrong place, even with jscs:disable #2226

Closed graingert closed 8 years ago

graingert commented 8 years ago

see https://github.com/graingert/jscs-error

running "npm install" "./node_modules/.bin/jscs ./all.js" fails with:

disallowTrailingWhitespace: Illegal trailing whitespace at all.js :
     1 |// jscs:disable
     2 |
--------^
     3 |(function($){
     4 |    

disallowTrailingWhitespace: Illegal trailing whitespace at all.js :
     1 |// jscs:disable
     2 |
--------^
     3 |(function($){
     4 |    

disallowTrailingWhitespace: Illegal trailing whitespace at all.js :
     1 |// jscs:disable
     2 |
     3 |(function($){
--------^
     4 |    
     5 |    

disallowTrailingWhitespace: Illegal trailing whitespace at all.js :
     1 |// jscs:disable
     2 |
     3 |(function($){
--------^
     4 |    
     5 |    

disallowTrailingWhitespace: Illegal trailing whitespace at all.js :
     2 |
     3 |(function($){
     4 |    
--------^
     5 |    
     6 |    function myfun(){

disallowTrailingWhitespace: Illegal trailing whitespace at all.js :
     3 |(function($){
     4 |    
     5 |    
--------^
     6 |    function myfun(){
     7 |    

disallowTrailingWhitespace: Illegal trailing whitespace at all.js :
     4 |    
     5 |    
     6 |    function myfun(){
--------^
     7 |    
     8 |        

7 code style errors found.
graingert commented 8 years ago

This is with jscs@3.03

qfox commented 8 years ago

Thank you for the report.

graingert commented 8 years ago

@zxqfox any update on this?

qfox commented 8 years ago

Need to check this with the latest patched cst version. There are huge chance this is fixed.

graingert commented 8 years ago

@zxqfox still fails on latest master :(

markelog commented 8 years ago

It does work in current master