I'm working with Adobe Extendscript, which == javascript*, and I'm using the Atom JSHint package in Atom. Extendscript is the scripting framework for Adobe apps like Photoshop and After Effects. Adobe do make an IDE but it's really feeble, so I write with Atom and then switch over to "Extendscript Toolkit" to run my scripts. Anyway…
Adobe lets you use C-style preprocessor directives like #include "myUsefulFunctions.jsx"
so that you can keep reusable stuff in libraries like a real programming language.
The problem is that the JSHint linter sees my C-style preprocessor directives at the top of the page, freaks out and gives up. To actually get it to lint my code I have to comment the preprocessor directives out and then remember to uncomment them before I run the code. This means at least 3 or 4 extra keystrokes each time I test, which as you all know is The. Worst. Thing. Ever.
So to save half a dozen keystrokes I've been looking into the settings for JSHint. Nothing I've found so far seems related. Is there any way of globally getting JSHint to ignore lines like #this
, or locally in the file to get it to skip a line or two?
*or is it ===
? I'm really confused by JS's approach to the truth.
I changed the JSHint package that I use, and now there's no need for workarounds.
For anyone else developing Extendscript in Atom the linter I recommend is this one: Linter-JSHint. It's a plug-in for the Atom Linter package, so you'll need to install that too.
Then once you've done that use this to ignore a block:
// Code here will be linted with JSHint.
/* jshint ignore:start */
// Code here will be ignored by JSHint.
#includepath "lib"
#include myBrilantLib.jsx
/* jshint ignore:end */
or for a single line:
ignoreThis(); // jshint ignore:line