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

The symbol XXX is declared but is apparently never used.

Expand Messages
  • Fred Lorrain
    Hello, JSLint generate an error if a symbol is not declared. That s perfect! What about generating a warning if a symbol is declared but never used? A switch
    Message 1 of 4 , Aug 14 2:36 AM
    • 0 Attachment
      Hello,

      JSLint generate an error if a symbol is not declared.
      That's perfect!

      What about generating a warning if a symbol is declared but never used?
      A switch to turn off this option is welcome too.

      I'm using yuicompressor-2.3.5.jar to compress my scripts and this tool typically generate such kind of message:

      [WARNING] The symbol myTH is declared but is apparently never used.
      This code can probably be written in a more compact way.
      ,myThead=null,myTfoot=null, ---> myTH <--- =null,myDiv=null;this.splitTable

      Regards

      Fred

    • Douglas Crockford
      ... JSLint does identify unused variables in the function report. Is hat not enough?
      Message 2 of 4 , Aug 14 8:35 AM
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "Fred Lorrain" <yahoo@...> wrote:
        >
        > Hello,
        >
        > JSLint generate an error if a symbol is not declared.
        > That's perfect!
        >
        > What about generating a warning if a symbol is declared but never used?
        > A switch to turn off this option is welcome too.
        >
        > I'm using yuicompressor-2.3.5.jar to compress my scripts and this tool
        > typically generate such kind of message:
        >
        > [WARNING] The symbol myTH is declared but is apparently never used.
        > This code can probably be written in a more compact way.
        > ,myThead=null,myTfoot=null, ---> myTH <---
        > =null,myDiv=null;this.splitTable

        JSLint does identify unused variables in the function report. Is hat
        not enough?
      • Fred Lorrain
        ... used? ... It s fine to have it in the report (I haven t seen it) but imagine I have 100 methods in my object. For every unused symbol I will have to track
        Message 3 of 4 , Aug 15 7:53 AM
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@...>
          wrote:
          >
          > --- In jslint_com@yahoogroups.com, "Fred Lorrain" <yahoo@> wrote:
          > >
          > > Hello,
          > >
          > > JSLint generate an error if a symbol is not declared.
          > > That's perfect!
          > >
          > > What about generating a warning if a symbol is declared but never
          used?
          > > A switch to turn off this option is welcome too.
          > >
          > > I'm using yuicompressor-2.3.5.jar to compress my scripts and this tool
          > > typically generate such kind of message:
          > >
          > > [WARNING] The symbol myTH is declared but is apparently never used.
          > > This code can probably be written in a more compact way.
          > > ,myThead=null,myTfoot=null, ---> myTH <---
          > > =null,myDiv=null;this.splitTable
          >
          > JSLint does identify unused variables in the function report. Is hat
          > not enough?
          >

          It's fine to have it in the report (I haven't seen it) but imagine I
          have 100 methods in my object.
          For every unused symbol I will have to track the method name and then
          search for the symbol.

          If you can at least add the line number in the report it will really help.
        • Fred Lorrain
          ... this tool ... help. ... In the new release of JSLint the symbol report has been improved to highlight unused symbols.
          Message 4 of 4 , Aug 18 11:53 PM
          • 0 Attachment
            --- In jslint_com@yahoogroups.com, "Fred Lorrain" <yahoo@...> wrote:
            >
            > --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@>
            > wrote:
            > >
            > > --- In jslint_com@yahoogroups.com, "Fred Lorrain" <yahoo@> wrote:
            > > >
            > > > Hello,
            > > >
            > > > JSLint generate an error if a symbol is not declared.
            > > > That's perfect!
            > > >
            > > > What about generating a warning if a symbol is declared but never
            > used?
            > > > A switch to turn off this option is welcome too.
            > > >
            > > > I'm using yuicompressor-2.3.5.jar to compress my scripts and
            this tool
            > > > typically generate such kind of message:
            > > >
            > > > [WARNING] The symbol myTH is declared but is apparently never used.
            > > > This code can probably be written in a more compact way.
            > > > ,myThead=null,myTfoot=null, ---> myTH <---
            > > > =null,myDiv=null;this.splitTable
            > >
            > > JSLint does identify unused variables in the function report. Is hat
            > > not enough?
            > >
            >
            > It's fine to have it in the report (I haven't seen it) but imagine I
            > have 100 methods in my object.
            > For every unused symbol I will have to track the method name and then
            > search for the symbol.
            >
            > If you can at least add the line number in the report it will really
            help.
            >


            In the new release of JSLint the symbol report has been improved to
            highlight unused symbols.
          Your message has been successfully submitted and would be delivered to recipients shortly.