kof / node-linter

[deprecared] Code quality tools collection in one nodejs module
22 stars 2 forks source link

Linter - code quality tool for javascript.

Linter doesn't implement validators - it utilizes free available quality tools. Javascript lang is too flexible and it becomes very hard to work in larger teams, especially if some of members are newbie on javascript. Linter is highly configurable, so if you don't want to use some rules, you can create your own conf file. You can easily add more quality tools.

Features

TODO

Currently used tools

Error message descriptions

Installation

npm install linter

Usage

command line - print help and read about usage

$ linter -h 

api

var linter = require('linter');

linter.run({
    files: "/path/to/file" // can be an array or directory
    config: "conf/server.json" // can be an object, path to a conf.json or config name e.g. "server"
    confRoot: "/path/to/linter/predef/configs", per default is linter "conf" dir
    recursive: false, // read dir recursively, default to false
    format: false, // set to true if you want to get a string as errors argument, formatted for console output
    // callback functions, which is called on complete and errors array is passed
    // see ./bin/cli.js
    callback: function(errors) {
        console.log(errors);
    },
});

Config file

Unified error format

Errors array passed to callback contains objects in this format:

{
    linter: "validator name",
    file: "file name",
    message: "error message",
    line: "line number"
}

How to add more linters

License