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

SciTE integration...

Expand Messages
  • santini.alberto
    I use the snippet I attached below to integrate JSLint and SciTE editor. Is it possible to get a text report (and not a html report), because I wouldn t
    Message 1 of 2 , Jul 16, 2008
    • 0 Attachment
      I use the snippet I attached below to integrate JSLint and SciTE editor.

      Is it possible to get a text report (and not a html report), because
      I wouldn't visualize the output of the report in a browser.

      An easy (for me) solution, but not ideal, could be to add to o.push(...)
      a final endline ('\n') in itself.report() function to create a pseudo formatted
      text report (with html tags embedded).

      Thanks in advance,
      Alberto Santini

      /*global ActiveXObject, WScript, */
      /*members Arguments, Count, Close, OpenTextFile, Quit, ReadAll, StdErr,
          WriteLine */
      (function () {
          if (WScript.Arguments.Count() !== 1) {
              WScript.StdErr.WriteLine("Usage: cscript fulljslint.js {file.js}");
              WScript.Quit(1);
          }

          var filename = WScript.Arguments(0);
          var objFSO = new ActiveXObject("Scripting.FileSystemObject");
          var objTextFile = objFSO.OpenTextFile(filename);
          var sReadAll = objTextFile.ReadAll();
          objTextFile.Close();

          // Customize the options to change the behaviour of the validation
          // See allOptions about the options available
          var options = { // good part options
              bitwise: true,
              eqeqeq: true,
              glovar: true,
              nomen: true,
              passfail: false,
              plusplus: true,
              regexp: true,
              undef: true,
              white: true
          };

          if (!JSLINT(sReadAll, options)) {
              var e = JSLINT.errors;
              for (var i = 0; i < e.length; i = i + 1) {
                  // Customize the output to integrate JSlint in your editor
                  // See JSLINT.errors about object members
                  if (e[i] !== null) {
                      WScript.StdErr.WriteLine(filename +
                              ':' + (e[i].line + 1) + ': ' + e[i].reason);
                  }
              }
              // WScript.StdErr.WriteLine(JSLINT.report());

              WScript.Quit(1);
          }
      })();

    • Douglas Crockford
      ... Currently, I am not planning for a text report. I will consider your suggestion.
      Message 2 of 2 , Jul 19, 2008
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "santini.alberto"
        <albertosantini@...> wrote:
        > Is it possible to get a text report (and not a html report), because

        Currently, I am not planning for a text report. I will consider your
        suggestion.
      Your message has been successfully submitted and would be delivered to recipients shortly.