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

Re: Testfile, wsh and stop error

Expand Messages
  • douglascrockford
    ... Yes. Fix your code, then it won t stop. For example, var i, x; i = 1; x = 2;
    Message 1 of 5 , Apr 10, 2012
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "larserik78" <lea@...> wrote:
      > I've created a plugin for resharper that highglights warnings from JSLint in js files.
      > To test it, I've started creating small testfiles, and I've gotten to the comma rule. :)
      > When trying to create an extended testfile with all rules, JSLint stops after 20ish warnings anyway, specifically on a line like this:
      > var i, x;
      > i = 1, x = 2; // stops here
      > Is there a way to make it not stop at all?

      Yes. Fix your code, then it won't stop. For example,

      var i, x;
      i = 1;
      x = 2;
    • larserik78
      ... Thanks, but that s missing the point. I m testing the highlighting from my plugin, not trying to fool JSLint into letting my own javascripts look bad. ;)
      Message 2 of 5 , Apr 10, 2012
      • 0 Attachment
        > Yes. Fix your code, then it won't stop.

        Thanks, but that's missing the point. I'm testing the highlighting from my plugin, not trying to fool JSLint into letting my own javascripts look bad. ;)

        I'd like to have a test covering all errors.
        But if it isn't possible, I'll just go ahead and create multiple test files.

        Any feedback on my other questions?
      • mariana.schiff
        If you go to the Database section of this group, you ll find a link to SeanK s blog with a WSH implementation. That s the one I m using.
        Message 3 of 5 , Apr 10, 2012
        • 0 Attachment
          If you go to the Database section of this group, you'll find a link to SeanK's blog with a WSH implementation. That's the one I'm using.

          --- In jslint_com@yahoogroups.com, "larserik78" <lea@...> wrote:
          >
          > > Yes. Fix your code, then it won't stop.
          >
          > Thanks, but that's missing the point. I'm testing the highlighting from my plugin, not trying to fool JSLint into letting my own javascripts look bad. ;)
          >
          > I'd like to have a test covering all errors.
          > But if it isn't possible, I'll just go ahead and create multiple test files.
          >
          > Any feedback on my other questions?
          >
        • larserik78
          Ah, didn t notice that menu item. My plugin should be in there. :) (http://resharperjslint.codeplex.com) I m using the wsh snippet JSLint.VS is using.
          Message 4 of 5 , Apr 10, 2012
          • 0 Attachment
            Ah, didn't notice that menu item.
            My plugin should be in there. :) (http://resharperjslint.codeplex.com)

            I'm using the wsh snippet JSLint.VS is using.
            Apparently it has been in the main repository once and there's some strays around other repos.

            // wsh.js
            // 2006-08-15

            // This is the WSH companion to fulljslint.js.
            /*
            Copyright (c) 2002 Douglas Crockford (www.JSLint.com) WSH Edition
            */

            /*extern JSLINT, WScript */

            (function () {

            // Predrag: options placeholder for JSLint.VS
            var options = /*[[0]]*/null;

            if (!JSLINT(WScript.StdIn.ReadAll(), options)) {
            for (var i = 0 ; i < JSLINT.errors.length ; i++) {
            var e = JSLINT.errors[i];
            WScript.StdErr.Write(
            (e.line + 1) + '\t' +
            (e.character + 1) + '\t' +
            (e.reason) + '\t' +
            (e.evidence || '').replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1") + '\n'
            );
            }
            WScript.Quit(1);
            }
            })();


            It's a bit shorter, and apparently Mr. Crockford wrote it years ago. That's why I'm questioning not finding it on github.
            I modified it according to the post about linecount the other day though. (Not this one, that's the one from JSLint.VS)

            Anyway it's not that advanced, so I'll just keep using it.

            About my other two questions, I gather I'll just have to live with the stopping scans. As long as I indicate it somehow in the plugin, and I guess peeps using it are already aquinted with JSLint anyway.
            I'll write multiple small testcases instead of one big.
          Your message has been successfully submitted and would be delivered to recipients shortly.