1

; and $rootScope should have at most 2 line(s) between them at app/scripts/services/betslipfactory.js :

  131 |            }
   132 |            $rootScope.copyLineStatus += '</div>';
   133 |          });
---------------------^
   134 |
   135 |

1 code style errors found!

that is the error I am getting here

_.each(status.selections, function(selection) {
            $rootScope.copyLineStatus += '<div class="well">';
            $rootScope.copyLineStatus += '<strong>' + selection.teamName  + ' </strong>';
            if (selection.lineChange) {
              $rootScope.copyLineStatus += '<div class="row">';
              $rootScope.copyLineStatus += '<div class="col-md-12">';
              $rootScope.copyLineStatus += '<strong>Lines:</strong>';
              $rootScope.copyLineStatus += '</div>';
              $rootScope.copyLineStatus += '</div>';
              $rootScope.copyLineStatus += '<div class="row">';
              $rootScope.copyLineStatus += '<div class="col-md-6">';
              $rootScope.copyLineStatus += '<strong>Before</strong>';
              $rootScope.copyLineStatus += '<div>' + selection.oldSpread + '(' + selection.oldMoneyLine + ')';
              $rootScope.copyLineStatus += '</div>';
              $rootScope.copyLineStatus += '</div>';
              $rootScope.copyLineStatus += '<div class="col-md-6">';
              $rootScope.copyLineStatus += '<strong>Current</strong>';
              $rootScope.copyLineStatus += '<div>' + selection.newSpread + '(' + selection.newMoneyLine + ')';
              $rootScope.copyLineStatus += '</div>';
              $rootScope.copyLineStatus += '</div>';
              $rootScope.copyLineStatus += '</div>';
            }

            if (selection.timeChange) {
              $rootScope.copyLineStatus += '<div class="row">';
              $rootScope.copyLineStatus += '<div class="col-md-6">';
              $rootScope.copyLineStatus += '<strong>Previous Time:</strong>';
              $rootScope.copyLineStatus += '<div>' + selection.oldDate + '</div>';
              $rootScope.copyLineStatus += '</div>';
              $rootScope.copyLineStatus += '<div class="col-md-6">';
              $rootScope.copyLineStatus += '<strong>Current Time:</strong>';
              $rootScope.copyLineStatus += '<div>' + selection.newDate + '</div>';
              $rootScope.copyLineStatus += '</div>';
              $rootScope.copyLineStatus += '</div>';
            }

            if (selection.statusChange) {
              $rootScope.copyLineStatus += '<div class="row">';
              $rootScope.copyLineStatus += '<div class="col-md-6">';
              $rootScope.copyLineStatus += '<strong>Old Status:</strong>';
              $rootScope.copyLineStatus += '<div>' + selection.oldStatus + '</div>';
              $rootScope.copyLineStatus += '</div>';
              $rootScope.copyLineStatus += '<div class="col-md-6">';
              $rootScope.copyLineStatus += '<strong>New Status:</strong>';
              $rootScope.copyLineStatus += '<div>' + selection.newStatus + '</div>';
              $rootScope.copyLineStatus += '</div>';
              $rootScope.copyLineStatus += '</div>';
            }

            if (selection.pitchingChangeThis) {
              $rootScope.copyLineStatus += '<div class="row">';
              $rootScope.copyLineStatus += '<div class="col-md-12">';
              $rootScope.copyLineStatus += '<strong>New Pitcher On Your Team:</strong>';
              $rootScope.copyLineStatus += '<div>' + selection.newPlayerNameThis + '</div>';
              $rootScope.copyLineStatus += '</div>';
            }

            if (selection.pitchingChangeOther) {
              $rootScope.copyLineStatus += '<div class="row">';
              $rootScope.copyLineStatus += '<div class="col-md-12">';
              $rootScope.copyLineStatus += '<strong>New Pitcher On The Other Team:</strong>';
              $rootScope.copyLineStatus += '<div>' + selection.newPlayerNameOther + '</div>';
              $rootScope.copyLineStatus += '</div>';
            }
            $rootScope.copyLineStatus += '</div>'; //closing the '<div .well>' tag...       
          });
             //HERE IS THE ERROR ^
Non
  • 8,409
  • 20
  • 71
  • 123

2 Answers2

3

This is a little aside from what the OP was after but may serve others that look for this error:

If you want to be able to have multiple line breaks to space out your code for a bit more readability, you can remove this line from your .jscsrc file. Note that you cannot set this to false as it's either true or needs to be removed.

"disallowMultipleLineBreaks": true

While this gives you more flexibility, that also means you may need to apply a common approach across your development team to stay consistent.

Simon
  • 1,630
  • 1
  • 17
  • 23
1

well, you probably have 2 blank lines between:

  $rootScope.copyLineStatus += '</div>'; //closing the '<div .well>' tag...       
});

and the next line of code.


Auto fixing code

With JSCS only

In the console run:

jscs "myfile.js" --fix

You can also point it to a directory or a list of files. Check the documentation for more info

In Sublime

There's a puglin called SublimeJSCSFormatter that should do that for you. Never used it though.

WebStorm/PHPStorm

Just press CTRL+ALT+L or CMD+ALT+L (in mac)

Tivie
  • 18,864
  • 5
  • 58
  • 77
  • yes, actually were 2 blank lines that will never notice if you don't start going line by line watching and deleting every blank line. Is there a way to set up Sublime to remove that kind of lines ? – Non Jul 08 '15 at 16:20