![]() This entry was posted in javascript, plone and tagged anyedit, aptana, firefox, html5, internet exporer, javascript, jslint, regex, validation by Mikko Ohtamaa. Recently there have been lots of issues with odd Java stuff in 12.04. Subscribe to RSS feed Follow me on Twitter Follow me on Facebook Follow me Google+ Install eclipse from repository and add the plug-in. Ignore regular expressions patterns don’t seem to match path or file part of the error. This is very irritating if you have something like jQuery UI in your source tree and you cannot supress warnings for the problematic files. Then select all text in the editor, right click -> Convert tabs to spaces. You need to fix this in Settings -> General -> Editor -> AnyEdit tools -> Convert. Use AnyEdit plug-in for Eclipse to convert tabs to spaces in the selected file (see Installation section).įirst you need to set sane tab site for AnyEdit, which defaults to 2 spaces (looks like you can nbe even more f*ed up as stated above). You probably want also to fix those “Mixed tabs and spaces” errors. (Who Eclipse has managed to f*k up this?) Turn on: Settings -> Aptana Studio -> Javascript -> Tab policy -> Use spaces to make your source code to be friendly with all the other text editors in the world who use tab size 8. Using sane tab setting and fixing mixed spaces and tabs ![]() You probably don’t want to see red marker all over you code, so you might want to tune down warnings a bit.Īdd these to Settings -> Aptana Studio -> Validation -> Javascript -> Ignore.ĭon’t complain about missing jQuery or Console. JSLint is very accurate with every detail – like a Finnish-Swedish lady when it comes to cleaning your apartment. Note that not having wrapping spaces is important here. You can also use JSLint global hints per source file to hint what globals the file has available, so JSLint won’t complain.įor example, to hint that global krusovice namespace is available, add the following line to the beginning of the file: /*global krusovice*/ The Problems view can be found Show -> View -> Problems. The only thing the standalone will leave out is Java and CVS support, though you can add both those back in later, if you want. The plugin allows people to use Aptana who already have an Eclipse installation. There is also Problems view which shows all the errors and warnings in your workspace. For your purposes, I would choose the standalone. Now you can see how bad your Javascript code is (bottom window):Įrrors and warnings are highlighted in the Javascript editor left marginal when you type. Your Javascript code will run on Firefox, but that alone doesn’t make many web developers happy □įirst you need to enable JSList validator in Settings -> Aptana Studio -> Validation -> Javascript. ![]() If you want to explicitly control which editor gets used, right-click on the file and choose 'Open With' (and then select which editor you want to use). For example, JSLint will caught extra commas in your JS files which would choke on Internet Explorer, but run on other browsers.Īptana Studio Javascript has ability to scan your Javascript while typing and highlight the errors.īy default Aptana Studio uses a validator called Mozilla validator which is very lax. Aptana just adds new editors to Eclipse, which should get used by default based on the file-extension of the file you are opening. This post tells you how to use JSLint with Eclipse, or more precisisely Aptana Studio. It saves your ass from common Javascript pitfalls.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |