Loading ...
Sorry, an error occurred while loading the content.

2819The library underscore

Expand Messages
  • Rob Richardson
    Mar 3, 2012
    • 0 Attachment
      The library underscore.js (http://documentcloud.github.com/underscore/)
      exports a single variable: _ -- a single underscore. I've tried putting _
      in my /*global _ */ declaration but until I "tolerate dangling _ in
      identifiers", it's still seen as an error. I grant this library is
      unfortunately named, but I have little control over that. I also don't want
      to blatantly accept all leading underscores as I concur that variables such
      as "_myvar" are not effectively named. I propose we implement one or both
      of these alterations to JSLint:

      1. When the variable is in the global list, this should trump the other
      rules.

      2. If the entirety of the variable is a single underscore, it should not be
      considered "dangling" as removing this underscore leaves the code more
      broken.

      Rob
    • Show all 4 messages in this topic