As Mr. Crockford is removing JSLint‘s support for WSH siting other community improvements, I thought I would post one such improvement. To create s WSH version of JSLint follow these easy steps:

1. Paste the following code into Notepad or your favorite editor and save as wsh.js.

(function () {
  var i, j, e, filename, file, source, fso = new ActiveXObject("Scripting.FileSystemObject");
  if (WScript.Arguments.length > 0) {
    for (i = 0; i < WScript.Arguments.length; i += 1) {
      filename = WScript.Arguments(i);
      if (fso.FileExists(filename)) {
        file = fso.OpenTextFile(filename, 1, false, -2);
        source = file.ReadAll()
          .replace(/\r\n/g, '\n')
          .replace(/\r/g, '\n')
          .split('\n');
        if (!JSLINT(source, {})) {
          for(j = 0; j < JSLINT.errors.length; j += 1) {
            e = JSLINT.errors[j];
            if (e && e.line) {
              WScript.StdErr.WriteLine(filename + '(' + e.line + ') : ' + e.reason);
            }
          }
          WScript.Quit(1);
        } else {
          WScript.StdOut.WriteLine(filename);
          WScript.Quit(0);
        }
      } else {
        WScript.StdErr.WriteLine(filename + ' : File Not Found');
      }
    }
  } else {
    WScript.StdOut.WriteLine('jslint - Windows Scripting front end for JSLint');
    WScript.StdOut.WriteLine('Usage: jslint filename [filename] ...');
  }
}());

Update: The code above includes a fix suggested by Marina Schiff on the jslint Yahoo group after Mr. Crockford removed a similar workaround from jslint.

2. Download the latest version of fulljslint.js from Mr. Crockford's GITHUB.

3. Concatenate the two files into one file named jslint.js (You can do this any way you want but the following DOS command will work if you run it from the directory that contains both files)

copy fulljslint.js+wsh.js jslint.js

4. To ease typing, paste the following command into jslint.cmd

@cscript "C:\PATH TO YOUR TOOLS DIRECTORY\jslint.js" //Nologo %*

Now to check foobar.js just run the following command

jslint foobar.js

Since I am an avid Source Insight user, I hooked the above up to a "compile" (F5) key and use si's output parser to quickly take me to the lines containing lint.

  • images
  • October 6, 2010

As Fall gracefully leaves, the beautiful Winter stalks out quietly. She gently covers buildings and cars with a thin, pure layer of frost. The winds blow colder and the animals scurry to their shelters to sleep through it. Winter leans over and touches the waters, freezing the top of every river and stream and brook. However, she frowns at the oceans, for their wildness she cannot tame. She sends the clouds to cover the sky and scatters snowflakes o’er the lands below. She stacks the snow either inches or feet high and covers the ground. She watches as the young children play in her creation and she witnesses the older ones gazing in awe at the magnificence of her work. She sends gails and winds to shake the trees and send the children inside before she makes her most favorite thing of all. Blizzards. The winds pickup speed. The ice on the roads and the hail in the air make it difficult to see anything. But Winter sees. She smiles and laughs at her creation. Some days she let the wind loose and it whipps around trees and buildings. But most days everything is peaceful and lovely. She’ll continue her work till Spring arrives and begs her to leave. Occasionally Winter can bride Spring into letting her stay longer but not in this scenario. Winter’s tears freeze in the snow as she melts away slowly, not to see her beautiful work for a long while.

He he!

  • images
  • August 30, 2010

Falls coming up and I’m going to describe it. Don’t know why….

 Summer’s brilliance slowly fades into the distance and Autumn shyly peeks her head out. She is seemingly inferior to Summer’s glory and radiance at first. She starts small. Wispy breezes  float down from the mountains.The leaves change color slowly at first, only gradually becoming a soft yellow green. She gently urges the animals to collect food before Winter comes. The days turn chilly and Autumn watches in silent joy as young people cuddle together in front of the blazing fire. The leave continue slowly changing, the winds pick up speed. Then  Autumn glides gracefully out of hiding. The leaves fall from the trees in magnificent shades of ambers, and yellows, and oranges. She tenderly drapes the land in a thick fog, engulfing the horizon with the clouds. A gust scatters to the wind the pile of leaves a child had gathered together. Some days the sun shines, but some days the rain comes pouring down. It drips through the gaps in the trees and soaks the ground in it’s wake. Autumn peers down at the children skipping in the mud. She giggles in glee and continues her work. The rain soon stops and she brings out the sun as she strolls through the grain field. She adds a breeze for good measure and watches in bliss as the stalks wave in the wind. She observes the harvesters and their machines picking the grain. After four months of delightful labor the branches hang bare, the animals begin hibernation, and all is prepared for Winter’s arrival. In sadness, Autumn bids farewell to Earth and greets Winter as he approaches to begin his work. With one last longing glance, Autumn departs, yearning for the day when she may come again….

K’ay, so, that’s about it…. hope y’all like it.

~N

I have no idea what I’m doing… I guess I’m posting on my dad’s website. Um… Oh ya, Photography, that’s right. Ok, so, I’m currently interested in photography. I’m not that good but I’m working on it and I hope to become better than papa-san someday. I’m going to atempt to post some pictures now, but I don’t know if it’ll work.

So there’s that one.

 It's taller than me...

And that one.

  • images
  • August 18, 2010

Unfortunately, I was too young to vote when he was running.