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

jscs3 fails to detect maximumLineLength violation location in comments #2233

Closed minj closed 8 years ago

minj commented 8 years ago

Given this config:

{
    "maximumLineLength": {
        "value": 80
    }
}

Compare:

if (true) {
    if (true) {
        if (true) {
            if (true) {

                var arg = 'foo';

                try {
                    window.someUnnecessarilyExtremelyLongPropertyName = arg.split('').reverse().join('');
                }
                catch (e) {
                    console.log(e);
                }

            }
        }
    }
}
maximumLineLength: Line must be at most 80 characters at foo.js :
     7 |
     8 |    try {
     9 |     window.someUnnecessarilyExtremelyLongPropertyName = arg.split('').reverse().join('');
-------------------------------------------------------------------------------------------------^
    10 |    }
    11 |    catch (e) {
if (true) {
    if (true) {
        if (true) {
            if (true) {

                var arg = 'foo';

                // try {
                //  window.someUnnecessarilyExtremelyLongPropertyName = arg.split('').reverse().join('');
                // }
                // catch (e) {
                //  console.log(e);
                // }

            }
        }
    }
}
maximumLineLength: Line must be at most 80 characters at foo.js :
     1 |if (true) {
--------^
     2 | if (true) {
     3 |  if (true) {