Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Simply use CTRL+J in gedit to run JSHint using node-jshint.

branch: master
README.md

Note: Please see gedit-icing for more gedit plugins.

gedit-node-jshint

Simply use CTRL+J in gedit to to run JSHint using node-jshint.

Note: This only works if you're working inside of a git project (since we use git rev-parse --show-toplevel).

Getting started

  1. Install node-jshint (Note: this requires node and npm, here are quick instructions to install these requirements):

        npm install -g jshint
    
  2. Enable the External Tools plugin:

    Enable the External Tools plugin

  3. Add a new entry called gedit-node-jshint under Tools -> Manage External Tools:

    #!/bin/sh
    dirpath=`git rev-parse --show-toplevel`
    reporter="$dirpath/jshint/reporter.js"
    config="$dirpath/jshint/config.json"
    if [ -d "$HOME/bin" ] ; then
        PATH="$HOME/bin:$PATH"
    fi
    export PATH=$HOME/local/node/bin:$PATH
    cat $1 >> /tmp/jshint.js
    jshint /tmp/jshint.js --reporter $reporter --config $config > /dev/stdout
    rm /tmp/jshint.js
    
  4. Set External Tool Options as follows:

    Set External Tool Options as follows

  5. Create a jshint directory in your project and download config.json and reporter.js from the node-jshint repo.

    cd /path/to/mygitproject
    mkdir jshint && cd jshint
    wget https://raw.github.com/jshint/node-jshint/master/example/config.json
    wget https://raw.github.com/jshint/node-jshint/master/example/reporter.js
    
  6. Open your JavaScript file in gedit, then use the hotkey CTRL+J to run JSHint (see Shell Output tab for its output).

  7. You can also select specific parts of a JavaScript file and use the hotkey.

  8. Configure the config.json and reporter.js files based on your project's needs. See jshint or node-jshint to learn more.

Something went wrong with that request. Please try again.