16

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).

Scotty Allen
  • 12,897
  • 9
  • 38
  • 51

6 Answers6

10

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

David Wolever
  • 148,955
  • 89
  • 346
  • 502
4

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

2

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
  • 1,450
  • 1
  • 12
  • 21
  • 3
    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 Apr 03 '09 at 09:35
2

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
  • 14,394
  • 6
  • 41
  • 36
0

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
  • 51,220
  • 55
  • 213
  • 317
  • This seems like a really tricky way of doing it… ActionScript is really quite different from JavaScript. – David Wolever Nov 10 '09 at 21:34
  • Actionscript is based on the same ECMAScript. The differences are that javascript should/is a prototypical language while actionscript wanted to be a more object oriented language. – eLouai Sep 24 '11 at 01:26
-2

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
  • 88,194
  • 49
  • 192
  • 260
  • 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 Jan 05 '09 at 06:26
  • Yea, sorry, ActionScript is sufficiently different from JavaScript that JavaScript tools rarely work. – David Wolever Nov 10 '09 at 21:34