Code Monkey home page Code Monkey logo

node-jshint's Introduction

node-jshint

A command line interface and npm package for jshint.

Install

To use jshint from any location (for npm v1.x) you need to install using the global (-g) flag.

npm install -g jshint

Usage

The command line interface looks like this.

jshint path path2 [options]

You can also require JSHint itself as a module.

var jshint = require('jshint');

Note: If you are using npm v1.x be sure to install jshint locally (without the -g flag) or link it globally.

Text Editor Plugins

  • gedit-node-jshint - Simply use CTRL+J in gedit to run JSHint using node-jshint.
  • vim syntastic - Run node-jshint at each file save.
  • sublime-jshint - F7 or command-B on any .js file. F4 next error line,column. shift-F4 previous error line,column.

Custom Reporters

Specify a custom reporter module (see example/reporter.js).

--reporter path/to/reporter.js

Use a jslint compatible xml reporter.

--jslint-reporter

Show additional non-error data generated by jshint (unused globals etc).

--show-non-errors

Configuration Options

Note: This behavior described below is very different from versions prior to 0.6.

The CLI uses the default options that come with JSHint. To have your own configuration apply, there are several methods you can use:

Specify Manually

Setting the --config=/path/to/your/config command line option to specify your own configuration file outside of the directory tree for your project.

Within your Project's Directory Tree

When the CLI is called, and a configuration file isn't specified already, node-jshint will attempt to locate one for you starting in pwd. (or "present working directory") If this does not yield a .jshintrc file, it will move one level up (..) the directory tree all the way up to the filesystem root. If a file is found, it stops immediately and uses that set of configuration.

This setup allows you to set up one configuration file for your entire project. (place it in the root folder) As long as you run jshint from anywhere within your project directory tree, the same configuration file will be used.

Home Directory

If all the methods above do not yield a .jshintrc to use, the last place that will be checked is your user's $HOME directory.

Ignoring Files and Directories

If there is a .jshintignore file in your project's directory tree, (also provided you run jshint from within your project's directory true) then any directories or files specified will be skipped over. (behaves just like a .gitignore file)

Note: Pattern matching uses minimatch, with the nocase option. When there is no match, it performs a left side match (when no forward slashes present and path is a directory).

Installing dependencies for development

./configure

Build Commands

jake -T

Project Guidelines

  • All tests are passing.
  • No (new) JSHint errors are introduced.

node-jshint's People

Contributors

arturdorochowicz avatar brentlintner avatar copenhas avatar fabiomcosta avatar isaacs avatar itay avatar julienp avatar millermedeiros avatar niftylettuce avatar oryband avatar polotek avatar smithamax avatar valueof avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.