Integrate JS Lint into Komodo Edit
There’s no contest. My favourite editor is Komodo Edit. I’ve written in the past before about how much it rocks (although that was before the great blog crash of ’08, and is likely lost to the mists of time), and I’d like to share with you all today another way to make Komodo Edit just a little bit cooler – integrate JS Lint directly into it.
WTF is JS Lint?
Well, a long time ago, someone noticed that while there are all kinds of ways to write certain code, certain specific ways are sloppier than others and can lead to errors. They wrote a tool called lint to parse through code and find those little linty bits and draw them to your attention.
Okay, so how do I do this?
Make a copy of the “js.default.conf” file in that directory, and call it lint.conf. Find the following section:
### Output format
# Customize the format of the error message.
# __FILE__ indicates current file path
# __FILENAME__ indicates current file name
# __LINE__ indicates current line
# __ERROR__ indicates error message
# Visual Studio syntax (default):
+output-format __FILE__(__LINE__): __ERROR__
# Alternative syntax:
#+output-format __FILE__:__LINE__: __ERROR__
Comment out the un-commented line there, and un-comment the last one. Finally, at the bottom of that file, remove the entry in the “Files” section.
Now boot Komodo Edit.
Open the Toolbox by clicking the little “Show/Hide Right Pane” button in the toolbar. Click on the “Add Item to Toolbox” button and add a new command. Now go to town making your new command look like mine:
Now, that Command string isn’t quite correct – the right bit is chopped off in the screenshot. It should read:
wine /opt/jslint/jsl.exe -conf lint.conf -process %F
You can make the string smaller by including jsl.exe’s directory in your path, or by running Windows and removing wine from the equation. =)
I understand that the Parse Output string is a little confusing (and chopped-off too), but don’t worry about it. It should be filled in automatically and work by default. If it DOESN’T though, here’s the string for you to copy-paste:
Simple as that!