473,833 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 23 '05 #1
3 2885
Ivo
"ivanhoe" <no@mail.com> wrote in message
news:c8******** **@news.etf.bg. ac.yu...
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 (?!)
jslint, a 'script validator':
<URL: http://www.crockford.c om/javascript/lint.html>
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...
That is why you will write your own.
<URL: http://4umi.com/web/bookmarklet/edit.htm > (not compatible)
thanx in advance,
ivan


H
Ivo
Jul 23 '05 #2
On Fri, 21 May 2004 03:04:36 +0200, "ivanhoe" <no@mail.com> wrote:
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 (?!)


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/

Jul 23 '05 #3

"ivanhoe" <no@mail.com> wrote in message
news:c8******** **@news.etf.bg. ac.yu...
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...


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 =---
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2334
by: Squirrel | last post by:
Given the following piece of code, I was looking for suggestions on how to beautify the portion of the HTML where I jump out of php mode and back in again. The HTML does not have any indenting in order to make the output more readable. However, by not indenting the php code, the php code becomes slightly more difficult to read. Is there a way to have both the php and HTML codes indent correctly? Thanks. <?php } else {
11
4153
by: John Wellesz | last post by:
If you are coding php using GVIM, you will appreciate this new indent script: Download there: http://www.vim.org/scripts/download_script.php?src_id=3710 or here: http://www.2072productions.com/vim/indent/php.vim
3
2772
by: porterboy | last post by:
CONTEXT: I am using Emacs to edit Python code and sometimes also Matlab code. When I hit <return> in a loop of some sort, Emacs usually gets the nesting indentation right, which is particularly important in Python. To ensure this I have used python-mode.el and matlab.el modes in emacs. QUESTION: If I suddenly decide I want an outer loop, do I have to manually readjust the indentation of all the inner loops? Or can emacs do it
2
3079
by: Klaus Nowikow | last post by:
I would like to be able to do the following: std::cout // Or any other ostream << "Line 1\n" << push_tab << "Line 2\n" << "Line 3\n" << push_tab << "Line 4\n" << pop_tab
0
1290
by: saabi | last post by:
How to indent length 4 a tab in IE? The text in this CDATA was some html code, it would indent length 8 a tab in IE, but I like to indent length 4 like in the original html editor, How to change the xsl code? ----------------------------------------------------------- Indent4ATab.xml <?xml version="1.0" encoding="GB2312"?> <?xml-stylesheet type="text/xsl" href="Indent4ATab.xsl"?> <htmlCode><!]></htmlCode>
3
2411
by: Tim | last post by:
I just bought VS .Net, and am getting up to speed. One thing I can't find, though, is how to get the editor to automatically capitalize keywords (Public, As, Imports, etc.), the way the VB 6.0 editor did. Does anyone know how to do this, or was this capability dropped in .NET? Thanks. -- Tim
4
2113
by: daftspaniel | last post by:
Sorry if this is a FAQ but Google returns a *lot* of results for Python Logging :-) I am looking for a tool that will automatically add logging to existing code e.g. Function Entries and Exits, Return values etc. Thanks, Davy Mitchell Mood News
58
4699
by: Jorge Peixoto de Morais Neto | last post by:
I was reading the code of FFmpeg and it seems that they use malloc just too much. The problems and dangers of malloc are widely known. Malloc also has some overhead (although I don't know what is the overhead of automatic variable sized arrays, I suspect it is smaller than that of malloc), although I'm not too worried about it. I was thinking that, with C99's variable length arrays, malloc shouldn't be needed most of the time. But I'm...
0
976
by: EgoSum | last post by:
Hi, What I can add to this snippet of source, so that periodical automatic run, after a certain period of time? private void check() { LocalReport rep = new LocalReport(); rep.ReportPath = @"..\..\Report.rdlc"; DirectoryInfo di = new DirectoryInfo(@"C:\Print"); FileInfo fi = di.GetFiles();
0
9796
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10500
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10213
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9323
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3972
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3078
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.