lintnode

A JSLint server for more expedient linting.

Usage no npm install needed!

<script type="module">
  import lintnode from 'https://cdn.skypack.dev/lintnode';
</script>

README

lintnode - a JSLint server for more expedient linting

I was setting up flymake-mode_ with JSLint_, and thinking it was pretty great, but that rhino start-up cost is pretty big for a flymake application. If we just kept JSLint running, wouldn't that be a lot faster?

Then I caught a talk on the node.js_ server, and saw a way.

In my environment, this cuts jslint invocation time in half.

This project also depends on the Express_ framework, with the underscore and haml packages. I recommend installation with npm_ to manage these dependencies.

The jslint.curl script depends on curl, but you can easily reproduce it with any other http client.

.. _flymake-mode: http://www.emacswiki.org/emacs/FlymakeJavaScript .. _JSLint: http://www.jslint.com/ .. _node.js: http://nodejs.org/ .. _Express: http://expressjs.com/ .. _npm: http://npmjs.org/

Usage

::

$ node lintnode/app.js --port 3003 & Express started at http://localhost:3003/ in development mode

$ lintnode/jslint.curl myfilthycode.js

The exit code of jslint.curl is currently not nearly as relevant as the output on standard out. The output should be fully compatible with JSLint's Rhino version__.

.. __: http://www.jslint.com/rhino/

Emacs Usage

See the included flymake-jslint.el__.

.. __: flymake-jslint.el

Configuration

jslint_port may be passed on the node command line with the --port parameter. It defaults to 3003.

jstlint_options can be configured by passing the --exclude option to app.js. e.g.

$ node app.js --exclude nomen,undef

or

$ node app.js --set maxlen:80,node

Alternatively they can be configured within emacs by setting the variable lintnode-jslint-excludes

For documentation on JSLint's options, see JSLint options_.

.. _JSLint options: http://www.jslint.com/lint.html#options

Support

This project is hosted at github, which has a wiki and an issue tracker:

http://github.com/davidmiller/lintnode

License

This software is distributed under the same license__ as JSLint, which looks like the MIT License with one additional clause:

The Software shall be used for Good, not Evil.

.. __: LICENSE