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

Features Request for the Report

Expand Messages
  • Jean-Charles Meyrignac
    I m current testing JsLint on our source code, and it displays quite a lot of interesting warnings, even though I don t always agree with them. For example, I
    Message 1 of 2 , May 15, 2009
      I'm current testing JsLint on our source code, and it displays quite a lot
      of interesting warnings, even though I don't always agree with them.
      For example, I get the following error:
      Lint at line 14 character 38: Expected '{' and instead saw 'return'.
      if(typeof(idOrObject)!='string') return idOrObject;

      I see the point in the parser, since it expects:
      if(typeof(idOrObject)!='string') {return idOrObject;}

      but in my opinion, this is not an error.


      I'd like to integrate JsLint into our build system, which is Nant based (
      http://nant.sf.net).

      For the reports, I need some XML output.
      Since the rhino's version contains exactly what we need, I just call JsLint
      with:

      java -jar js.jar rhino.js source.js

      where js.jar comes from the Rhino package:
      http://www.mozilla.org/rhino/download.html

      However, I'm not entirely satisfied with the reporting, since it doesn't
      output the unused and unexpected global variables.
      The unused variables will help me clean the useless declarations.
      The unexpected global variables will help me fix the bad scopes (like for
      (j=0;...) when var j is missing).

      How could the Rhino script report the unused and unexpected global variables
      ?

      JC


      [Non-text portions of this message have been removed]
    • santini.alberto
      ... From jslint commmented code: You can request a Function Report, which shows all of the functions and the parameters and vars that they use. This can be
      Message 2 of 2 , May 15, 2009
        --- In jslint_com@yahoogroups.com, Jean-Charles Meyrignac <jcmeyrignac@...> wrote:
        >
        > How could the Rhino script report the unused and unexpected global variables
        >

        From jslint commmented code:

        "You can request a Function Report, which shows all of the functions and the parameters and vars that they use. This can be used to find implied global variables and other problems. The report is in HTML and can be inserted in an HTML <body>.

        var myReport = JSLINT.report(limited);

        If limited is true, then the report will be limited to only errors."

        I think you can integrate the report call in your rhino script.

        Regards,
        Alberto
      Your message has been successfully submitted and would be delivered to recipients shortly.