Is there an offline version of JSLint for Windows?

前端 未结 16 1763
刺人心
刺人心 2021-02-05 03:05

I would like to check my JavaScript files without going to JSLint web site.
Is there a desktop version of this tool for Windows?

16条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-05 03:18

    I know this is an old one, but nobody's mentioned that JSLint is open source and available on github. https://github.com/douglascrockford/JSLint

    You can use the HTML page that's included, or create your own interface using:

    var options = {
        browser : true,
        plusplus : true,
        unparam : true,
        maxlen : 120,
        indent : 4 // etc
    };
    if (JSLINT(myCode, options)) {
        document.write('Passed!');
    } else {
        document.write('Failed! :(');
    }
    document.write('
      '); for (i = 0; i < JSLINT.errors.length; i++) { document.write('
    • ' + JSLINT.errors[i].line + ': ' + JSLINT.errors[i].reason + '
    • '); } document.write('
    ');

提交回复
热议问题