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

Feature Request; jslint.org enhancement

Expand Messages
  • James Abley
    Hi, I ve got a suggestion for a small addition. This is directly taken from using the feed validator at http://feedvalidator.org/. With that service, you
    Message 1 of 2 , Oct 11, 2010
    • 0 Attachment
      Hi,

      I've got a suggestion for a small addition. This is directly taken from
      using the feed validator at http://feedvalidator.org/. With that service,
      you submit an item to be validated and it comes back with errors, warnings,
      etc. Each error is linked to an explanatory page.

      I think this would be a useful addition to jslint. e.g.

      Someone submits

      var methods = ['remove', 'show', 'hide', 'stop'];
      for (var i=0; i<methods.length; i++) {
      var method = methods[i];
      Frame.prototype[methods[i]] = function () {
      for (var j=0; j<this.elements.length; j++) {
      this.elements[j][method]();
      }
      };
      }

      They get back an error:

      *"Error:*

      Problem at line 8 character 4: Don't make functions within a loop."
      A link to a page explaining why that is a bad idea would be helpful - not
      everyone has a copy of "Javascript: The Good Parts" yet!

      Cheers,

      James


      [Non-text portions of this message have been removed]
    • Rob Richardson
      I ve found the answer to this question on most of these things falls into one of these groups: - Read the section in JavaScript: The Good Parts that talks
      Message 2 of 2 , Oct 12, 2010
      • 0 Attachment
        I've found the answer to this question on most of these things falls into
        one of these groups:

        - Read the section in "JavaScript: The Good Parts" that talks about this

        - JSLint will hurt your feelings: If you follow the recommendation, your
        code will be better

        Since these are the answers, links to documentation that say that every time
        seems less effective. :D

        Alternatively, I'd love to find a copy of "The Good Parts" in PDF and/or
        online that is searchable for just such an occasion.

        Rob


        -----Original Message-----
        From: jslint_com@yahoogroups.com [mailto:jslint_com@yahoogroups.com] On
        Behalf Of James Abley
        Sent: Monday, October 11, 2010 11:55 PM
        To: jslint_com@yahoogroups.com
        Subject: [jslint] Feature Request; jslint.org enhancement

        Hi,

        I've got a suggestion for a small addition. This is directly taken from
        using the feed validator at http://feedvalidator.org/. With that service,
        you submit an item to be validated and it comes back with errors, warnings,
        etc. Each error is linked to an explanatory page.

        I think this would be a useful addition to jslint. e.g.

        Someone submits

        var methods = ['remove', 'show', 'hide', 'stop'];
        for (var i=0; i<methods.length; i++) {
        var method = methods[i];
        Frame.prototype[methods[i]] = function () {
        for (var j=0; j<this.elements.length; j++) {
        this.elements[j][method]();
        }
        };
        }

        They get back an error:

        *"Error:*

        Problem at line 8 character 4: Don't make functions within a loop."
        A link to a page explaining why that is a bad idea would be helpful - not
        everyone has a copy of "Javascript: The Good Parts" yet!

        Cheers,

        James


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