automatic indent and clean up of js code?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ivanhoe

    automatic indent and clean up of js code?

    I need something like html tidy, but for javascript...to fix code
    indentation, converts tab/spaces, removes white space, etc...maybe even fast
    check sintax and warn on compatibility issues, but I guess it's too much to
    ask (?!)

    if you have positive expirience with some application(or perl/php script)
    that knows how to properly do this (and is customizible and maybe also free
    or at least cheap?), please speak up, since all progs I tried so far were
    (very) far from perfect...


    thanx in advance,
    ivan


  • Ivo

    #2
    Re: automatic indent and clean up of js code?

    "ivanhoe" <no@mail.com> wrote in message
    news:c8jp1f$uta $1@news.etf.bg. ac.yu...[color=blue]
    > I need something like html tidy, but for javascript...to fix code
    > indentation, converts tab/spaces, removes white space, etc...maybe even[/color]
    fast[color=blue]
    > check sintax and warn on compatibility issues, but I guess it's too much[/color]
    to[color=blue]
    > ask (?!)[/color]

    jslint, a 'script validator':
    <URL: http://www.crockford.c om/javascript/lint.html>
    [color=blue]
    > if you have positive expirience with some application(or perl/php script)
    > that knows how to properly do this (and is customizible and maybe also[/color]
    free[color=blue]
    > or at least cheap?), please speak up, since all progs I tried so far were
    > (very) far from perfect...[/color]

    That is why you will write your own.
    <URL: http://4umi.com/web/bookmarklet/edit.htm > (not compatible)
    [color=blue]
    > thanx in advance,
    > ivan[/color]

    H
    Ivo


    Comment

    • Jim Ley

      #3
      Re: automatic indent and clean up of js code?

      On Fri, 21 May 2004 03:04:36 +0200, "ivanhoe" <no@mail.com> wrote:
      [color=blue]
      >I need something like html tidy, but for javascript...to fix code
      >indentation, converts tab/spaces, removes white space, etc...maybe even fast
      >check sintax and warn on compatibility issues, but I guess it's too much to
      >ask (?!)[/color]

      astyle (in addition to the lint you've already been told about.)

      both free of course.

      Jim.
      --
      comp.lang.javas cript FAQ - http://jibbering.com/faq/

      Comment

      • Ira Baxter

        #4
        Re: automatic indent and clean up of js code?


        "ivanhoe" <no@mail.com> wrote in message
        news:c8jp1f$uta $1@news.etf.bg. ac.yu...[color=blue]
        > I need something like html tidy, but for javascript...to fix code
        > indentation, converts tab/spaces, removes white space, etc...maybe even[/color]
        fast[color=blue]
        > check sintax and warn on compatibility issues, but I guess it's too much[/color]
        to[color=blue]
        > ask (?!)
        >
        > if you have positive expirience with some application(or perl/php script)
        > that knows how to properly do this (and is customizible and maybe also[/color]
        free[color=blue]
        > or at least cheap?), please speak up, since all progs I tried so far were
        > (very) far from perfect...[/color]

        You might consider www.semanticdesigns.com/Products/Formatters.
        We offer prettyprinters for many languages. It does everything
        you ask for above, except for warn about incompatibility issues.


        --
        Ira D. Baxter, Ph.D., CTO 512-250-1018
        Semantic Designs, Inc. www.semdesigns.com






        ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
        http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
        ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

        Comment

        Working...