A JSLint plugin for Komodo.
Adds a JSLint option to the Tools menu.
Version 1.6.3 fixes a bug that was causing an indentation error to always be thrown on Line 1 in Default mode.
Version 1.6.2 tweaks the interface a little - allowing easy reset to Crockford's default The Good Parts; allowing the extension to be run from a button on the options panel; and allowing the output panel to be properly resized.
Version 1.6.1 allows key-binding for the Run kJSLint action.
It also fixes a bug that was occurring within Komodo IDE - where kJSLint was preventing the Javascript debugger's panel from appearing.
Version 1.6 improves on version 1.5 by outputting results in a format where they can be double-clicked to jump the editor to the line where the error has been found.
I've also properly built my install.rdf file to properly identify the extensions, and this should allow for automatic-updates to the extension should I modify it in the future.
Version 1.5 improves on version 1.0 by adding the options that are found on jslint.com, allowing the user to control the operation and sensitivity of JSLint.
See http://www.jslint.com/lint.html#options for details.
On first use, kJSLint defaults to the 'Good Parts' set of selected options.
The version of JSLint bundled within the extension is Crockford's latest from 25-07-09.
Again, any bugs or enhancement requests, please report here and I will action ASAP.
I would like to see options for the jslint like the webite http://www.jslint.com/
Thanks
Becker
Thanks for the nudge Becker. This is now in development, and seems to be going pretty well, so hopefully there'll be an extension update available shortly.
The newest version(1.6) of the kjslint plugin kills the debug console. It makes the debug window at the bottom display nothing. I used version an old version, current version and the alpha. I disable the jslint and i can see the debug console again.
I am running a mac.
Thanks!
Hey Becker,
Sorry you've come across a bug, I'll try to get the bottom of it this weekend.
Are you using the Komodo IDE rather than Komodo Edit? I've not been familiar with the debug console - as I've been an Edit user so far.
Can you give me instructions on how to get to the debug console and fill it with content as you would when it's working?
Also, if you've got time, screenshots of the debug console when it is working, and when it is broken would be fantastic.
Thanks!
I have some strange behavior with the Source Tree plugin related to tabs. This may be a similar thing to the Debug window. I just noticed today that my 'Source' dropdown (configured on the right as a tab) shows JS lint options content while the JS Lint tab shows the Source content. I disabled kjslint and the Source window was empty. I uninstalled kjslint and Source started showing the source tree. I reinstalled kjslint and again, Source tab show JS Lint options. Even if I move the tab to another area (bottom), it still shows the wrong content. I did try it both with TweakUI tabs and as dropdowns with no change in the strange behavior.
I don't know which plugin might be the cause of this behavior but when I came looking to see if anybody had anything similar, I saw Becker's trouble and thought it might be related to this tab issue. I'm currently using the Komodo Edit 5.1.4, build 3797 on WinXP.
@Becker,
I've managed to replicate the bug that you've mentioned. Hopefully I'll be able to get it fixed now! Sorry, I'm moving a little slowly as I'm not online at home at the moment.
@chauncey
Not had to chance to dig into this one with too much depth yet. I've got the Source Tree extension installed now though so I should get to it soon.
@Becker
The bug with the debugger should now be resolved. Looks like I couldn't use hidden="true" on the kJSlint output panel, which wasn't really necessary anyway. Can you let me know if version 1.6.1 now works for you or not?
@chauncey
Sorry, it looks like the bug with the Source Tree extension is within that extensions code. I'd outlined what I believe is a fix on that extensions page:
http://community.activestate.com/xpi/source-tree#comment-10330
I've updated the Source Tree extension locally so that it works with kJSlint. If you need it urgently, let me know and I will send you it across.
JSLint usually generates some kind of report if it's able to complete its scan. This report tells you if there are any global variables and if so where they came from. Since global stuff can result in very annoying issues it's really nice to know about this stuff as soon as possible.
Would be really nice if you could add it somehow. Thanks.
Excellent extension by the way.
Hi jh,
Forgive me if I'm not understanding your comment correctly.
kJSLint should display it's report in the bottom pane once it has completed its scan. If it detects global variables, it should display the following message: "'yourGlobalVar' is not defined". This message is displayed next to the line number and char of the error. You can double click the result to get directly to the line.
If this isn't happening for you, you may need to make sure the 'Disallow undefined variables' is checked within the options panel.
If you paste some stuff over at jslint.com and then press the "JSLint" button... the "JSLint will hurt your feelings" div will disappear and 1 or 2 new divs appear.
#errors is the first one and is only shown if something went wrong. Its content is basically similar to kJSLint's output. #functions is always shown and it contains a summary of all used global variables, followed by a list of all functions (each entry also lists the global and local variables this function used/declared).
The extension covers #errors, but doesn't cover #functions. Personally I think the report in #functions is very helpful if you try to clean up some old code, which polluted the global namespace like crazy.
Hi jh,
I understand what you mean now. I'll have a think about the best way to do this and will try and get something built soon.
Perhaps a new panel adjacent to the Output that contains the report?
Ace. :)
Right now there is one tab labeled "JS Lint Output". Maybe we could have two. One labeled "JS Lint Errors (<number of errors>)" and another one labeled "JS Lint Overview" or "JS Lint Report" or something like that.
If there are 0 errors the second tab (report) should get focus, otherwise the first one (errors) should get it. This matches the usual work-flow. If there are errors you want to know about them, if there are none you might be interested in the report (cleanup).
Nice one, I shall sort it as soon as I can.
Mr Ben!
Some ideas for your extension, whenever you might find the time to fit them in:
1. Provide the ability to save, and then switch between, My JS Lint settings and The Crock's JS Lint settings. I'm often unsure which checkboxes I checked and which The Crock checked.
2. Provide the ability to run JS Lint from a giant 'Run JS Lint' button on the JS Lint Options pane. It would save some clicks. =)
3. Allow for resizing of the JS Lint output panel at bottom of page. It seems to be fixed at 11 lines. When I resize that panel, it retains its fixed size, would be nice it it could grow with the height of the panel.
Hope these all make sense!
Keep up the good work,
Mr Jon =)
Hey Jon!
Thanks for the suggestions - you know you are my main target for the extension so I'll be fixing these up asap.
1) This one is definitely a priority as I can't remember the defaults myself once I've altered the options. It shouldn't be too tricky to do, I'm just mulling over ideas of how the interface/options should look. Hopefully I'll get inspired on this one soon.
2) Can definitely do this one, just need to find 5 minutes to sort it. For now the key-binding is probably the quickest way to run kJSLint - I've got mine set up on ctrl-alt-j
3) This one is trickier - I'm putting kJSLint's output into a pre-existing panel, so I'd need to attach behaviour to that panel to allow resizing. I'm sure it can probably be done and has probably been done before so I'll try and sort that as well
Will try and get the updates done as soon as possible!
Hi Mr. Jon,
Hopefully version 1.6.2 sorts these issues for you.
Cheers!
thesmaw thank you for telling about this subject.. And i did everythink
Thanks
Thanks so much for creating the extension, it makes life so much easier.
I see your post about 1.6.2 saving settings, but it doesn't appear to be the case in version 1.6.3. I got my options setup, closed Komodo, then came back today, and the options are not what I had changed them to yesterday.
Would it be possible to have kJSLint read the jslint comment line at the top of a javascript file, so that you could change settings in different projects?
Hi tone,
I'm glad you're finding the extension useful.
Agreed, persistance is a little bit ropey - I find that my options are saved most of the time, but every now and again they do go missing.
Permanently adding comments to the user's file would solve this and allow different settings for different files, but I'm loathe to have to permanently impact on someone's document.
Rather, I'm hoping to be able to write settings to an external file somewhere.
I just need to find the time now, hopefully not too far in the future!
Time you get a decent logo for your addon. Preferably one of these: http://images.google.co.uk/images?gbv=2&hl=en&q=douglas+crockford&sa=N&s...
;p
Agreed. I need to find the one where he's in the Police tshirt.