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

Re: jslint as a CommonJS module

Expand Messages
  • AJ ONeal
    Mr. Crockford, What s your stance on this? Are you opposed to making any changes at all or is this something that you re considering? ... [Non-text portions of
    Message 1 of 3 , Apr 5, 2011
    • 0 Attachment
      Mr. Crockford,

      What's your stance on this?

      Are you opposed to making any changes at all or is this something that
      you're considering?


      On Tue, Mar 29, 2011 at 2:41 PM, AJ ONeal <coolaj86@...> wrote:

      > Doug,
      >
      > I saw that someone tried to push a commit with the CommonJS export and it
      > was rejected.
      >
      > However, since your JSLINT file can't be exported as a module there are at
      > least 6 different node-xyz-jslint projects on github with over 24 forks.
      > Can we discuss a simple change that would make your jslint a module and
      > hence lead to less fragmentation in the community?
      >
      > Here's a decent, valid JavaScript solution that makes no crazy assumptions:
      >
      > var global = global || (function () { return this; }());
      > (function () {
      > "use strict";
      >
      > //
      > // your current code as is
      > //
      >
      > if (global.window) {
      > global.window.JSLINT = JSLINT;
      > }
      > if (global.module) {
      > global.module.exports = JSLINT;
      > }
      > }());
      >
      > Do you have a better suggestion?
      >
      > What would be acceptable to you?
      >
      > AJ ONeal
      >


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.