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

Re: JSLint errors wiki?

Expand Messages
  • sandyhead25
    Robert, I am sure the community would love you if you set this up for us. You can start here: http://www.jslint.com/msgs.html Austin
    Message 1 of 18 , Sep 22, 2011
      Robert,

      I am sure the community would love you if you set this up for us. You can start here: http://www.jslint.com/msgs.html

      Austin

      --- In jslint_com@yahoogroups.com, Robert Ferney <capnregex@...> wrote:
      >
      > I've been using JSLint for a bit now, and I have noticed that often
      > there are error messages where I wonder why JSLint is complaining
      > about it..
      >
      > I'm wondering if it would be possible to have a wiki or something
      > where the error would have a link to the wiki that would have a more
      > detailed explanation as to why JSLint is complaining about this, what
      > makes it important, and what to do about it.
      >
      > To take a recent example..
      > whitespace at the end of a line..
      > why should we care?
      > Does it cause some JavaScript engines to interpret the code differently?
      > if so, which ones?
      >
      > Is it for readability? What are the pros and cons..
      >
      > Is there an option to make JSLint not care?
      >
      > So that when I see a new error pop up, I can click the link, and read
      > more about it.
      >
      > Secondly, I find that there are some things that I do consistently,
      > that I wonder if there may not be some sort of filter to fix
      > automatically..
      > like forgetting the space between function and ().. or adding extra
      > space inside the () for an argument list, or not putting a space after
      > the , in an argument list..
      > Does anybody know a good filter that could be used before lint to
      > catch these things?
      >
      > - Robert Ferney
      >
    • Robert Ferney
      Ok, I ve gotten a wiki started.. I do have it set to require logins to edit, simply to help people to be accountable for their edits.
      Message 2 of 18 , Sep 23, 2011
        Ok, I've gotten a wiki started..
        I do have it set to require logins to edit, simply to help people to be
        accountable for their edits.

        http://jslint.wikinet.org/wiki/Main_Page
        <http://jslint.wikinet.org/wiki/Main_Page>
        - Robert Ferney

        On Thu, Sep 22, 2011 at 9:28 PM, sandyhead25 <austin.cheney@...>wrote:

        > **
        >
        >
        > Robert,
        >
        > I am sure the community would love you if you set this up for us. You can
        > start here: http://www.jslint.com/msgs.html
        >
        > Austin
        >
        >
        > --- In jslint_com@yahoogroups.com, Robert Ferney <capnregex@...> wrote:
        > >
        > > I've been using JSLint for a bit now, and I have noticed that often
        > > there are error messages where I wonder why JSLint is complaining
        > > about it..
        > >
        > > I'm wondering if it would be possible to have a wiki or something
        > > where the error would have a link to the wiki that would have a more
        > > detailed explanation as to why JSLint is complaining about this, what
        > > makes it important, and what to do about it.
        > >
        > > To take a recent example..
        > > whitespace at the end of a line..
        > > why should we care?
        > > Does it cause some JavaScript engines to interpret the code differently?
        > > if so, which ones?
        > >
        > > Is it for readability? What are the pros and cons..
        > >
        > > Is there an option to make JSLint not care?
        > >
        > > So that when I see a new error pop up, I can click the link, and read
        > > more about it.
        > >
        > > Secondly, I find that there are some things that I do consistently,
        > > that I wonder if there may not be some sort of filter to fix
        > > automatically..
        > > like forgetting the space between function and ().. or adding extra
        > > space inside the () for an argument list, or not putting a space after
        > > the , in an argument list..
        > > Does anybody know a good filter that could be used before lint to
        > > catch these things?
        > >
        > > - Robert Ferney
        > >
        >
        >
        >


        [Non-text portions of this message have been removed]
      • Frederik Dohr
        I very much like this idea of collecting background info on JSLint s various warnings/errors. ... Perhaps it would make sense to use GitHub s wiki facilities
        Message 3 of 18 , Sep 24, 2011
          I very much like this idea of collecting background info on JSLint's
          various warnings/errors.

          > http://jslint.wikinet.org/wiki/Main_Page

          Perhaps it would make sense to use GitHub's wiki facilities instead,
          simply for discoverability? However, as the repo owner, Mr. Crockford
          would have to enable this.


          -- F.
        • Doc Emmett Splendid
          It s an excellent idea, as modern JS is the first computer language which is versioned in the same way as human language: on custom rather than central,
          Message 4 of 18 , Sep 24, 2011
            It's an excellent idea, as modern JS is the first computer language which is versioned in the same way as human language: on custom rather than central, arbitrary rules. JSLINT is an evolving platform to test those customs, and justifying its mandatory approval before a commit in the various organisations I've been a developer advocate would have been greatly assisted by such a wiki.

            D. Emmett S.
            http://docsplendid.com


            ________________________________
            From: Frederik Dohr <fdg001@...>
            To: jslint_com@yahoogroups.com
            Sent: Saturday, 24 September 2011, 1:07
            Subject: Re: [jslint] Re: JSLint errors wiki?


             
            I very much like this idea of collecting background info on JSLint's
            various warnings/errors.

            > http://jslint.wikinet.org/wiki/Main_Page

            Perhaps it would make sense to use GitHub's wiki facilities instead,
            simply for discoverability? However, as the repo owner, Mr. Crockford
            would have to enable this.

            -- F.



            [Non-text portions of this message have been removed]
          • Robert Ferney
            ... If and When Mr. Crockford does enable the GitHub s wiki, we can move the posts from http://jslint.wikinet.org/wiki/Main_Page . In the mean time, We will
            Message 5 of 18 , Sep 24, 2011
              On Sat, Sep 24, 2011 at 2:07 AM, Frederik Dohr <fdg001@...> wrote:

              > **
              >
              > Perhaps it would make sense to use GitHub's wiki facilities instead,
              > simply for discoverability? However, as the repo owner, Mr. Crockford
              > would have to enable this.
              >

              If and When Mr. Crockford does enable the GitHub's wiki, we can move the
              posts from http://jslint.wikinet.org/wiki/Main_Page .

              In the mean time,
              We will have a place to document Why things like extra space at the end of a
              line is a problem.
              Apparently Google thinks so too, because the Closure Linter also complains
              about it.

              - Robert Ferney


              [Non-text portions of this message have been removed]
            • Jordan Harband
              How are extra bytes in your file that serve no purpose and can easily be removed by most editors, pre-commit hooks, or a command line tool NOT a problem? As
              Message 6 of 18 , Sep 24, 2011
                How are extra bytes in your file that serve no purpose and can easily be removed by most editors, pre-commit hooks, or a command line tool NOT a problem?

                As far as I'm aware, no file should ever have trailing whitespace, ever, and every character in your code should be there for an explicit purpose, or else removed.

                - Jordan

                On Sep 24, 2011, at 2:00 AM, Robert Ferney wrote:

                > On Sat, Sep 24, 2011 at 2:07 AM, Frederik Dohr <fdg001@...> wrote:
                >
                > > **
                > >
                > > Perhaps it would make sense to use GitHub's wiki facilities instead,
                > > simply for discoverability? However, as the repo owner, Mr. Crockford
                > > would have to enable this.
                > >
                >
                > If and When Mr. Crockford does enable the GitHub's wiki, we can move the
                > posts from http://jslint.wikinet.org/wiki/Main_Page .
                >
                > In the mean time,
                > We will have a place to document Why things like extra space at the end of a
                > line is a problem.
                > Apparently Google thinks so too, because the Closure Linter also complains
                > about it.
                >
                > - Robert Ferney
                >
                > [Non-text portions of this message have been removed]
                >
                >



                [Non-text portions of this message have been removed]
              • Robert Ferney
                does extra space at the end of the line cause any browsers out there to interpret the javascript differently? ... removed by most editors, pre-commit hooks, or
                Message 7 of 18 , Sep 26, 2011
                  does extra space at the end of the line cause any browsers out there to
                  interpret the javascript differently?
                  On Sep 24, 2011 10:13 AM, "Jordan Harband" <ljharb@...> wrote:
                  > How are extra bytes in your file that serve no purpose and can easily be
                  removed by most editors, pre-commit hooks, or a command line tool NOT a
                  problem?
                  >
                  > As far as I'm aware, no file should ever have trailing whitespace, ever,
                  and every character in your code should be there for an explicit purpose, or
                  else removed.
                  >
                  > - Jordan
                  >
                  > On Sep 24, 2011, at 2:00 AM, Robert Ferney wrote:
                  >
                  >> On Sat, Sep 24, 2011 at 2:07 AM, Frederik Dohr <fdg001@...> wrote:
                  >>
                  >> > **
                  >> >
                  >> > Perhaps it would make sense to use GitHub's wiki facilities instead,
                  >> > simply for discoverability? However, as the repo owner, Mr. Crockford
                  >> > would have to enable this.
                  >> >
                  >>
                  >> If and When Mr. Crockford does enable the GitHub's wiki, we can move the
                  >> posts from http://jslint.wikinet.org/wiki/Main_Page .
                  >>
                  >> In the mean time,
                  >> We will have a place to document Why things like extra space at the end
                  of a
                  >> line is a problem.
                  >> Apparently Google thinks so too, because the Closure Linter also
                  complains
                  >> about it.
                  >>
                  >> - Robert Ferney
                  >>
                  >> [Non-text portions of this message have been removed]
                  >>
                  >>
                  >
                  >
                  >
                  > [Non-text portions of this message have been removed]
                  >
                  >
                  >
                  > ------------------------------------
                  >
                  > Yahoo! Groups Links
                  >
                  >
                  >


                  [Non-text portions of this message have been removed]
                • urangatang@att.net
                  The same could be said about comments. Has anyone come across an error caused by spaces on a blank line in JavaScript?
                  Message 8 of 18 , Sep 26, 2011
                    The same could be said about comments.

                    Has anyone come across an error caused by spaces on a blank line in JavaScript?

                    --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
                    >
                    > How are extra bytes in your file that serve no purpose and can easily be removed by most editors, pre-commit hooks, or a command line tool NOT a problem?
                  • Jordan Harband
                    Comments serve a purpose, trailing whitespace does not. If you avoid ASI by properly using semicolons, I doubt trailing whitespace will break your code, even
                    Message 9 of 18 , Sep 26, 2011
                      Comments serve a purpose, trailing whitespace does not.

                      If you avoid ASI by properly using semicolons, I doubt trailing whitespace will break your code, even with minification. However, it is still useless and unnecessary, and that should be regarded equally as repulsive as broken code.

                      On Sep 26, 2011, at 9:01 AM, urangatang@... wrote:

                      > The same could be said about comments.
                      >
                      > Has anyone come across an error caused by spaces on a blank line in JavaScript?
                      >
                      > --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
                      > >
                      > > How are extra bytes in your file that serve no purpose and can easily be removed by most editors, pre-commit hooks, or a command line tool NOT a problem?
                      >
                      >



                      [Non-text portions of this message have been removed]
                    • tom.haggie@sap.com
                      There s an option to say I don t care about whitespace it should honour it. In most production systems the js code is processed by minification before it gets
                      Message 10 of 18 , Sep 26, 2011
                        There's an option to say I don't care about whitespace it should honour it.

                        In most production systems the js code is processed by minification before it gets deployed, these checks are just more work for no value for people who work in such an environment.

                        -*TOM*-

                        --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
                        >
                        > Comments serve a purpose, trailing whitespace does not.
                        >
                        > If you avoid ASI by properly using semicolons, I doubt trailing whitespace will break your code, even with minification. However, it is still useless and unnecessary, and that should be regarded equally as repulsive as broken code.
                        >
                        > On Sep 26, 2011, at 9:01 AM, urangatang@... wrote:
                        >
                        > > The same could be said about comments.
                        > >
                        > > Has anyone come across an error caused by spaces on a blank line in JavaScript?
                        > >
                        > > --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@> wrote:
                        > > >
                        > > > How are extra bytes in your file that serve no purpose and can easily be removed by most editors, pre-commit hooks, or a command line tool NOT a problem?
                        > >
                        > >
                        >
                        >
                        >
                        > [Non-text portions of this message have been removed]
                        >
                      • Robert Ferney
                        If I am having to triage ( because I have more problems to fix than I have time), broken code has to take priority compared to something that does not break
                        Message 11 of 18 , Sep 26, 2011
                          If I am having to triage ( because I have more problems to fix than I
                          have time), broken code has to take priority compared to something
                          that does not break code.

                          Objectively, something that does not break, has to be less important
                          than something that does.. Just as someone that is bleeding out will
                          get treated before someone that has simply broken their nose.. Not
                          that it is not important to have both injuries treated.. but a broken
                          nose is usually not life threatening..

                          If there is a problem with my script that will cause it to not work,
                          then I want to fix that right away..

                          If it's something that will help with readability, for the developer
                          that has to tackle the code next, ( even if that's me a week from now
                          ) I still want to fix that, but that's secondary to having it work in
                          the first place.

                          If it's just a byte or two extra for file transfer reasons, I may not
                          care much, especially if the minimizer will take care of it anyway.

                          I still want to know *why* it's a problem.. So I can figure out if
                          it's a case where my code is bleeding out on the table, or if it's
                          just spilled water over it'self..

                          - Robert Ferney


                          On Mon, Sep 26, 2011 at 10:32 AM, Jordan Harband <ljharb@...> wrote:
                          > Comments serve a purpose, trailing whitespace does not.
                          >
                          > If you avoid ASI by properly using semicolons, I doubt trailing whitespace will break your code, even with minification. However, it is still useless and unnecessary, and that should be regarded equally as repulsive as broken code.
                          >
                          > On Sep 26, 2011, at 9:01 AM, urangatang@... wrote:
                          >
                          >> The same could be said about comments.
                          >>
                          >> Has anyone come across an error caused by spaces on a blank line in JavaScript?
                          >>
                          >> --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
                          >> >
                          >> > How are extra bytes in your file that serve no purpose and can easily be removed by most editors, pre-commit hooks, or a command line tool NOT a problem?
                          >>
                          >>
                          >
                          >
                          >
                          > [Non-text portions of this message have been removed]
                          >
                          >
                          >
                          > ------------------------------------
                          >
                          > Yahoo! Groups Links
                          >
                          >
                          >
                          >
                        • Erik Eckhardt
                          This flamboyantly defies logic. Extra whitespace may be useless and unnecessary but also is completely harmless. If you were a boss would you seriously take
                          Message 12 of 18 , Sep 26, 2011
                            This flamboyantly defies logic.

                            Extra whitespace may be useless and unnecessary but also is completely
                            harmless. If you were a boss would you seriously take your staff to task
                            equally harshly for carelessly including extra trailing whitespace in the
                            code as you would for irresponsibly breaking the build?

                            The option to ignore whitespace should (drum roll please ... wait for it
                            .... wait for it ... ) *ignore whitespace*. TADAAAHHHH!!!

                            And since when do we make our programming decisions based on repulsiveness
                            rather than efficiency? Feeling enough angst about whitepsace to waste a lot
                            of time on it is not healthy.

                            Erik

                            On Mon, Sep 26, 2011 at 9:32 AM, Jordan Harband <ljharb@...> wrote:

                            > trailing whitespace ... is still useless and unnecessary, and that should
                            > be regarded equally as repulsive as broken code.
                            >
                            >


                            [Non-text portions of this message have been removed]
                          • paulcrowder1979
                            ... This statement is ridiculous. I use a rather popular editor called Visual Studio (some of you may have heard of it) that preserves indentation on blank
                            Message 13 of 18 , Sep 28, 2011
                              --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
                              >
                              > Comments serve a purpose, trailing whitespace does not.
                              >
                              > If you avoid ASI by properly using semicolons, I doubt trailing whitespace will break your code, even with minification. However, it is still useless and unnecessary, and that should be regarded equally as repulsive as broken code.

                              This statement is ridiculous. I use a rather popular editor called Visual Studio (some of you may have heard of it) that preserves indentation on blank lines so that if you place the cursor there, anything you type will already be indented properly. As far as I know there's no way to change this behavior. Because my code is always minified before being put into production, this extra whitespace has absolutely no effect on the end product. I'm really starting to sour on JSLint because of the recent nonsense that's been added. It's a real shame because I've championed it for years.
                            • sandyhead25
                              Output generated by JavaScript rarely exists in a vacuum. There are other areas where white space characters have specific meaning. Even in JavaScript white
                              Message 14 of 18 , Sep 28, 2011
                                Output generated by JavaScript rarely exists in a vacuum. There are other areas where white space characters have specific meaning. Even in JavaScript white space characters, at certain times, have syntactical value. In XML/HTML white space has meaning. It either alters the length of an existing text node or creates an entirely new text node when not adjacent to a prior existing text node. Improper use of white space will break TCL. Web servers also do funny things with white space characters during a post/get request and sometimes properly encoding the white space characters in URI can still throw errors.

                                Always yield on the side of caution. Just because you are not aware that extra white space characters ever do anything does not mean you are void of harm.

                                --- In jslint_com@yahoogroups.com, "urangatang@..." <urangatang@...> wrote:
                                >
                                > The same could be said about comments.
                                >
                                > Has anyone come across an error caused by spaces on a blank line in JavaScript?
                                >
                                > --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@> wrote:
                                > >
                                > > How are extra bytes in your file that serve no purpose and can easily be removed by most editors, pre-commit hooks, or a command line tool NOT a problem?
                                >
                              • Erik Eckhardt
                                Based on past experiences I am one of the most conservative developers there are. My desire to do things right and cover all the eventualities are often
                                Message 15 of 18 , Sep 28, 2011
                                  Based on past experiences I am one of the most conservative developers there
                                  are. My desire to "do things right" and "cover all the eventualities" are
                                  often scoffed at--until systems start breaking and the "almost never
                                  happens" exception takes everything to a screeching halt.

                                  However, I have to say that not all risks are equal, and in the real world
                                  efficiency is right up there in value next to correctness or
                                  comprehensiveness. It doesn't matter if you're doing it right if it never
                                  gets built at all. And, spending a relatively high amount of effort on an
                                  extremely low risk item is extremely inefficient. Placing caution where it
                                  is not due actually has a formal word: paranoia.

                                  Sanity just doesn't care that in different contexts, white space can screw
                                  things up. In the context of most code, be it javascript. C++, C#, VBScript
                                  or whatever, extra whitespace is harmless.
                                  If we were to use the same logic in real life, based on the knowledge that
                                  SOME buttons launch nuclear missiles, we should NEVER ever push any button,
                                  for fear of it launching a missile that kills thousands or millions of
                                  people. No. We use our domain knowledge to shape our understanding of the
                                  risk and concomitantly structure our behavior.

                                  In theory there is no difference between theory in practice. In practice,
                                  there is.

                                  On Wed, Sep 28, 2011 at 2:42 PM, sandyhead25 <austin.cheney@...>wrote:

                                  > **
                                  >
                                  >
                                  > Output generated by JavaScript rarely exists in a vacuum. There are other
                                  > areas where white space characters have specific meaning. Even in JavaScript
                                  > white space characters, at certain times, have syntactical value. In
                                  > XML/HTML white space has meaning. It either alters the length of an existing
                                  > text node or creates an entirely new text node when not adjacent to a prior
                                  > existing text node. Improper use of white space will break TCL. Web servers
                                  > also do funny things with white space characters during a post/get request
                                  > and sometimes properly encoding the white space characters in URI can still
                                  > throw errors.
                                  >
                                  > Always yield on the side of caution. Just because you are not aware that
                                  > extra white space characters ever do anything does not mean you are void of
                                  > harm.
                                  >
                                  >
                                  > --- In jslint_com@yahoogroups.com, "urangatang@..." <urangatang@...>
                                  > wrote:
                                  > >
                                  > > The same could be said about comments.
                                  > >
                                  > > Has anyone come across an error caused by spaces on a blank line in
                                  > JavaScript?
                                  > >
                                  > > --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@> wrote:
                                  > > >
                                  > > > How are extra bytes in your file that serve no purpose and can easily
                                  > be removed by most editors, pre-commit hooks, or a command line tool NOT a
                                  > problem?
                                  > >
                                  >
                                  >
                                  >


                                  [Non-text portions of this message have been removed]
                                • Luke Page
                                  Visual studio often pretends there is whitespace to make editing easier and then inserts the whitespace when you type the first character. However like most
                                  Message 16 of 18 , Sep 28, 2011
                                    Visual studio often pretends there is whitespace to make editing easier and
                                    then inserts the whitespace when you type the first character.

                                    However like most other editors it does appear sometimes. I'm sure that
                                    there is either an option to trim at save or an extension that does it...
                                    On 28 Sep 2011 22:33, "paulcrowder1979" <paul@...> wrote:
                                    > --- In jslint_com@yahoogroups.com, Jordan Harband <ljharb@...> wrote:
                                    >>
                                    >> Comments serve a purpose, trailing whitespace does not.
                                    >>
                                    >> If you avoid ASI by properly using semicolons, I doubt trailing
                                    whitespace will break your code, even with minification. However, it is
                                    still useless and unnecessary, and that should be regarded equally as
                                    repulsive as broken code.
                                    >
                                    > This statement is ridiculous. I use a rather popular editor called Visual
                                    Studio (some of you may have heard of it) that preserves indentation on
                                    blank lines so that if you place the cursor there, anything you type will
                                    already be indented properly. As far as I know there's no way to change this
                                    behavior. Because my code is always minified before being put into
                                    production, this extra whitespace has absolutely no effect on the end
                                    product. I'm really starting to sour on JSLint because of the recent
                                    nonsense that's been added. It's a real shame because I've championed it for
                                    years.
                                    >


                                    [Non-text portions of this message have been removed]
                                  • paulcrowder1979
                                    ... At my company we have hundreds of thousands of lines of JavaScript, all of which get validated at some point using JSLint. There s no way I m going to fix
                                    Message 17 of 18 , Sep 30, 2011
                                      --- In jslint_com@yahoogroups.com, Luke Page <luke.a.page@...> wrote:
                                      >
                                      > Visual studio often pretends there is whitespace to make editing easier and
                                      > then inserts the whitespace when you type the first character.
                                      >
                                      > However like most other editors it does appear sometimes. I'm sure that
                                      > there is either an option to trim at save or an extension that does it...

                                      At my company we have hundreds of thousands of lines of JavaScript, all of which get validated at some point using JSLint. There's no way I'm going to fix up all those files as well as modify the settings and/or extensions on 100+ developer machines just so we can enforce a rule that has absolutely zero effect on the end result.
                                    Your message has been successfully submitted and would be delivered to recipients shortly.