Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have managed to get two lint programs to run using the <a href="http://notepad-plus.sourceforge.net/" rel="noreferrer">notepad++</a>'s <a href="http://sourceforge.net/project/showfiles.php?group_id=189927&amp;package_id=224034" rel="noreferrer">NppExec</a> Plugin.</p> <p>The NppExec plugin is usually installed by default and can be found under plugins -> NppExec. (Using NppExec 0.3 RC1 and Notepad++ 5.1+). <br/><br/></p> <h2>1) JSLint</h2> <p>first download the <a href="http://www.jslint.com/wsh/index.html" rel="noreferrer">WSH version of jslint</a> from <a href="http://www.jslint.com" rel="noreferrer">http://www.jslint.com</a>.<br> Modify the last part of the file as follows:</p> <pre><code>(function() { if(!JSLINT(WScript.StdIn.ReadAll(),{passfail:false})) { var e; for(var i in JSLINT.errors) { e=JSLINT.errors[i]; WScript.StdOut.WriteLine('Lint at line '+(e.line+1)+' character '+(e.character+1)+': '+e.reason); WScript.StdOut.WriteLine(' '+(e.evidence||'').replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1")); } WScript.Quit(1); } }()); </code></pre> <p><a href="http://lynet.ca/~alumb/jslint/jslint.js" rel="noreferrer">(Pre-modified version here)</a><br> This causes JSLint to output all of the errors, not just the first one.</p> <p>Next, Notepad++'s NppExec doesn't allow the use of StdIn so I wrote a <a href="http://lynet.ca/~alumb/jslint/jslint.bat" rel="noreferrer">batch file</a> to actually execute the command.<br> This also allowed me to add a config file that is inserted before all javascript files. The options can be seen <a href="http://www.jslint.com/lint.html#options" rel="noreferrer">here</a>. The batch file looks like this: </p> <pre><code>@copy /b "C:\Program Files\jslint\conf.txt"+%1 "C:\Program Files\jslint\lastoutput.txt" &gt; temp.txt @cscript /Nologo "C:\Program Files\jslint\jslint.js" &lt; "C:\Program Files\jslint\lastoutput.txt" </code></pre> <p>You may need to modify the paths depending on where you put the jslint.js file. The <a href="http://lynet.ca/~alumb/jslint/conf.txt" rel="noreferrer">conf.txt</a> file looks like this: </p> <pre><code>/*jslint forin:true*/ </code></pre> <p>Make sure there is no return carriage at the end of this line. If there is a return carriage all the lines counts will be off by one. </p> <p>Finally, the command I entered into NppExec is:</p> <pre><code>"C:\Program Files\jslint\jslint.bat" "$(FULL_CURRENT_PATH)" </code></pre> <p><br/></p> <h2>2) Javascript Lint</h2> <p><a href="http://www.javascriptlint.com/" rel="noreferrer">Javascript lint</a> is a slightly less strict parser and was much easier to implement. </p> <p>First grab a copy of the windows version from <a href="http://www.javascriptlint.com/download.htm" rel="noreferrer">http://www.javascriptlint.com/download.htm</a> and unzip it. Then the NppExec command is:</p> <pre><code>"C:\Program Files\JavascriptLint\jsl.exe" -conf "C:\Program Files\JavascriptLint\jsl.default.conf" -process "$(FULL_CURRENT_PATH)" </code></pre> <p>(note: Most instructions for Javascript Lint will say to add "pauseatend" to the end of the command, I found this caused problems in Notepad++ so I left it off)</p> <p>Hope this helps someone,<br> Cheers,<br> Andy.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload