Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grunt lint task needs to be updated with Grunt upgrade. #80

Closed
nicovalencia opened this issue Jan 8, 2014 · 2 comments
Closed

Grunt lint task needs to be updated with Grunt upgrade. #80

nicovalencia opened this issue Jan 8, 2014 · 2 comments
Assignees

Comments

@nicovalencia
Copy link

The current Grunt lint test isn't identifying issues properly, and should probably just be substituted with grunt-contrib-jshint when Grunt is upgraded. This will identify a handfull of errors (below) that need to be cleaned up.

Running "jshint:src" (jshint) task
Linting src/showdown.js ...ERROR
[L120:C19] W122: Invalid typeof value 'undefind'
if (typeof module !== 'undefind' && typeof exports !== 'undefined' && typeof require !== 'undefind') {
[L120:C86] W122: Invalid typeof value 'undefind'
if (typeof module !== 'undefind' && typeof exports !== 'undefined' && typeof require !== 'undefind') {
[L272:C4] W099: Mixed spaces and tabs.
          [ \t]*
[L273:C4] W099: Mixed spaces and tabs.
          \n?        // maybe one newline
[L274:C4] W099: Mixed spaces and tabs.
          [ \t]*
[L276:C4] W099: Mixed spaces and tabs.
          [ \t]*
[L277:C4] W099: Mixed spaces and tabs.
          \n?        // maybe one newline
[L278:C4] W099: Mixed spaces and tabs.
          [ \t]*
[L280:C4] W099: Mixed spaces and tabs.
          (\n*)        // any lines skipped = $3 attacklab: lookbehind removed
[L281:C4] W099: Mixed spaces and tabs.
          ["(]
[L282:C4] W099: Mixed spaces and tabs.
          (.+?)        // title = $4
[L283:C4] W099: Mixed spaces and tabs.
          [")]
[L284:C4] W099: Mixed spaces and tabs.
          [ \t]*
[L287:C3] W099: Mixed spaces and tabs.
        /gm,
[L288:C3] W099: Mixed spaces and tabs.
        function(){...});
[L315:C2] W033: Missing semicolon.
}
[L440:C2] W033: Missing semicolon.
}
[L512:C2] W033: Missing semicolon.
}
[L531:C2] W033: Missing semicolon.
}
[L606:C5] W099: Mixed spaces and tabs.
    (               // wrap whole match in $1
[L616:C2] W033: Missing semicolon.
}
[L619:C12] W041: Use '===' to compare with 'undefined'.
  if (m7 == undefined) m7 = "";
[L622:C13] W099: Mixed spaces and tabs.
  var link_id   = m3.toLowerCase();
[L626:C13] W041: Use '===' to compare with ''.
  if (url == "") {
[L627:C21] W041: Use '===' to compare with ''.
    if (link_id == "") {
[L633:C29] W041: Use '!==' to compare with 'undefined'.
    if (g_urls[link_id] != undefined) {
[L635:C35] W041: Use '!==' to compare with 'undefined'.
      if (g_titles[link_id] != undefined) {
[L652:C15] W041: Use '!==' to compare with ''.
  if (title != "") {
[L661:C2] W033: Missing semicolon.
}
[L720:C2] W033: Missing semicolon.
}
[L725:C13] W099: Mixed spaces and tabs.
  var link_id   = m3.toLowerCase();
[L731:C13] W041: Use '===' to compare with ''.
  if (url == "") {
[L732:C21] W041: Use '===' to compare with ''.
    if (link_id == "") {
[L738:C29] W041: Use '!==' to compare with 'undefined'.
    if (g_urls[link_id] != undefined) {
[L740:C35] W041: Use '!==' to compare with 'undefined'.
      if (g_titles[link_id] != undefined) {
[L765:C2] W033: Missing semicolon.
}
[L812:C2] W033: Missing semicolon.
}
[L858:C53] W032: Unnecessary semicolon.
      list = list.replace(/\n{2,}/g,"\n\n\n");;
[L878:C22] W004: 'list' is already defined.
      var list = list.replace(/\n{2,}/g,"\n\n\n");;
[L878:C57] W032: Unnecessary semicolon.
      var list = list.replace(/\n{2,}/g,"\n\n\n");;
[L889:C2] W033: Missing semicolon.
}
[L960:C2] W033: Missing semicolon.
}
[L1041:C2] W033: Missing semicolon.
}
[L1046:C2] W033: Missing semicolon.
}
[L1053:C3] W099: Mixed spaces and tabs.
//   include literal backticks in the code span. So, this input:
[L1055:C4] W099: Mixed spaces and tabs.
//     Just type ``foo `bar` baz`` at the prompt.
[L1057:C3] W099: Mixed spaces and tabs.
//     Will translate to:
[L1059:C4] W099: Mixed spaces and tabs.
//     <p>Just type <code>foo `bar` baz</code> at the prompt.</p>
[L1067:C4] W099: Mixed spaces and tabs.
//     ... type `` `bar` `` ...
[L1069:C3] W099: Mixed spaces and tabs.
//     Turns to:
>> Too many errors. (73% scanned).

I'm working on getting this all cleaned up 🚰

nicovalencia added a commit to nicovalencia/showdown that referenced this issue Jan 8, 2014
closes showdownjs#80
- Fixed tabbing of showdown source
- Added proper comparison operators
- Added missing semicolons
@tivie tivie self-assigned this Jan 5, 2015
@tivie
Copy link
Member

tivie commented Jan 6, 2015

I've disabled the jshint in the grunt test job. No use to "fix" the code formatting since a major re-factor is on it's way anyway.

@tivie tivie closed this as completed Jan 6, 2015
@nicovalencia
Copy link
Author

Awesome, stoked y'all are working on this. Really appreciate it!

🍋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants