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

jslint in cli without WSH and Rhino

Expand Messages
  • roltar@ymail.com
    Hi, I thought it can be intresting for those who don t have WSH (for example, I have Linux - there is no WSH) and do not want to install Java and Rhino, but
    Message 1 of 5 , Jul 19 3:13 AM
    • 0 Attachment
      Hi,

      I thought it can be intresting
      for those who don't have WSH (for example, I have Linux - there is no WSH) and do not want to install Java and Rhino, but want to use jslint in console.

      There is Perl module jslint, which have jslint cli version, wrapped in
      perl and using spidermonkey library. However, this module consist
      outdated version of JSLint library and seems broken.

      I found easy way to run JSLint from cli using smjs tool from spidermonkey package and small code:


      var source=[];
      var line;

      while((line=readline())){
      source.push(line);
      }

      if(!JSLINT(source)){
      for(var i in JSLINT.errors){
      if(JSLINT.errors[i]) {
      print(i+') L:'+(JSLINT.errors[i].line+1)+'
      C:'+(JSLINT.errors[i].character+1)+' ['+JSLINT.errors[i].reason+'] >
      '+JSLINT.errors[i].evidence);
      }
      }
      }

      It can be used by 'smjs jslint.js < some.js'
    • Frederik Dohr
      ... FWIW, a while back I wrote a simple Python wrapper to invoke JSLint: http://pypi.python.org/pypi/jslint The main advantage, to me, is that it provides a
      Message 2 of 5 , Jul 19 3:25 AM
      • 0 Attachment
        > I found easy way to run JSLint from cli using smjs tool from
        > spidermonkey package and small code

        FWIW, a while back I wrote a simple Python wrapper to invoke JSLint:
        http://pypi.python.org/pypi/jslint

        The main advantage, to me, is that it provides a report using standard
        error format, so it can easily be used it within editors like Vim.


        -- F.
      • roltar@ymail.com
        Interesting. Standard format is very good, but I don t like extra dependence (Python).
        Message 3 of 5 , Jul 19 4:00 AM
        • 0 Attachment
          Interesting. Standard format is very good, but I don't like extra dependence (Python).
        • Arthur Blake
          You could use NodeJS. Should be a lot faster too. http://github.com/reid/node-jslint ... [Non-text portions of this message have been removed]
          Message 4 of 5 , Jul 19 6:55 AM
          • 0 Attachment
            You could use NodeJS. Should be a lot faster too.

            http://github.com/reid/node-jslint


            On Mon, Jul 19, 2010 at 7:00 AM, roltar@... <mr.roltar@...>wrote:

            >
            >
            > Interesting. Standard format is very good, but I don't like extra
            > dependence (Python).
            >
            >
            >


            [Non-text portions of this message have been removed]
          • Dominic Mitchell
            ... Sorry about that. It s my module , and I haven t figured out why it s breaking so badly. I must
            Message 5 of 5 , Jul 19 7:55 AM
            • 0 Attachment
              On Mon, Jul 19, 2010 at 11:13 AM, roltar@... <mr.roltar@...>wrote:

              > Hi,
              >
              > I thought it can be intresting
              > for those who don't have WSH (for example, I have Linux - there is no WSH)
              > and do not want to install Java and Rhino, but want to use jslint in
              > console.
              >
              > There is Perl module jslint, which have jslint cli version, wrapped in
              > perl and using spidermonkey library. However, this module consist
              > outdated version of JSLint library and seems broken.
              >
              >
              Sorry about that. It's my
              module<http://search.cpan.org/%7Ehdm/JavaScript-JSLint-0.06/>,
              and I haven't figured out why it's breaking so badly. I must come back and
              pick it up again sometime.

              In the meantime, there is also
              jslint4java<http://code.google.com/p/jslint4java/>,
              which comes with a command line version.

              -Dom


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