views:

886

answers:

6

Are there any lint tools available for actionscript? One source would be ideal, but anything is welcome.

My team is starting to adopt more a more rigorous style guide (where "more rigorous" means "existant"), and I think a linter would help us all adhere more easily to the style rules we've agreed on. I'm not above writing my own, but I'd like to see what else is out there first.

A quick search on Google reveals nothing (at least so far).

A: 

Actionscript 2.0 and 3.0 are ECMA compliant scripting languages. Since ECMA script is essentially Javascript, you can typically use something like JSure (appears to be Linux only) or Javascript Lint.

Soviut
The ECMAScript used in what we know as Javascript today doesn't have a lot to do with either ActionScript 2 or ActionScript 3.
Luke
Yea, sorry, ActionScript is sufficiently different from JavaScript that JavaScript tools rarely work.
David Wolever
+1  A: 

It's not Lint, but I've found the free FlashDevelop to make me write better code, as it complains about many possible problems, such as undeclared variables.

http://www.flashdevelop.org

You could check it out.

Then there's also flex builder that you can use to write AS.

Mikko Tapionlinna
Strictly, it's not FlashDevelop that does this but rather the mxmlc compiler that comes with the flex sdk. So any IDE coupled with that compiler will give you the same benefits. But FlashDevelop is still a great software!
grapefrukt
+1  A: 

Not quite Lint, though Adobe's Flex mxmlc compiler gives plenty of helpful strict warnings about messy ActionScript, such as undeclared variables, missing function return types, and extra commas in an object/hash.

mxmlc resources:

Some related code analysis tools are Yasca (analysis tool for JavaScript, Java, PHP, etc.) and asDox (AS3 parser written in Python), which might be decent starts for writing your own.

Ron DeVera
A: 

I have used jslint in the past for jscript. As is written in JavaScript and the full source code is available, so you should be able to get it working with actionscript. I have not used any of the other tools mentions in the answers, so I don't know how they compare.

(jslint takes a very strong view about what is good jscript, you may or may not agree with it.)

Ian Ringrose
This seems like a really tricky way of doing it… ActionScript is really quite different from JavaScript.
David Wolever
+5  A: 

If you're dealing with Flex, take a look at FlexPMD.

David Wolever
I haven't evaluated FlexPMD personally, but if it works even close to as well as its Java counterpart, this is the way to go!
Chris R
+1  A: 

FlexPMD should actually be named As3PMD. I mean you can run FlexPMD against a pure AS3 project, not necessarly a Flex project.

That said there are around 10 rules which are Flex-specific.

Xavier

Xavier Agnetti