Is there an offline version of JSLint for Windows?

前端 未结 16 1766
刺人心
刺人心 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:14

    JSLint Reporter running with Node.js

    Easy to keep up to date.

    1. Install Node.js.

    2. Install jslint-reporter into: C:\jslint-reporter

    3. Download JSLint:

      C:\jslint-reporter>node wrapper.js --upgrade
      
    4. Test:

      C:\Temp>node C:\jslint-reporter\wrapper.js missing_semicolon.js
      missing_semicolon.js:1:10:Expected ';' and instead saw 'console'.
      missing_semicolon.js:2:1:'console' was used before it was defined.
      

    JSLint Node.js package

    Easy to set up, but you rely on the package author for keeping the included JSLint up to date:

    1. Install Node.js.

    2. Using npm, the package manager of Node.js, install JSLint:

      C:\>npm -g install jslint
      
    3. Test:

      C:\Temp>jslint missing_semicolon.js
      
      missing_semicolon.js
       #1 Expected ';' and instead saw 'console'.
          var x = 5 // Line 1, Pos 10
      

    Other solutions

    To run JSLint, you may also use Rhino or any other JavaScript implementation that works on Windows, of course.

提交回复
热议问题