blint

1.1.2 • Public • Published

Blint

Simple JavaScript linter.

var blint = require("blint");
blint.checkFile("foo.js");
blint.checkDir("src");

When the linter encounters problems, it will write something to stdout, and set a flag, which you can retrieve with blint.success().

process.exit(blint.success() ? 0 : 1);

Both checkFile and checkDir take a second optional options argument. These are the defaults:

var defaultOptions = {
  // Version of the language to parse
  ecmaVersion: 6,
  // Whitelist globals exported by the browser
  browser: false,
  // Allow tabs
  tabs: false,
  // Allow trailing whitespace
  trailingSpace: false,
  // True to require semicolons, false to disallow them
  semicolons: null,
  // Allow trailing commas
  trailingCommas: true,
  // Allow unquoted properties that are reserved words
  reservedProps: true,
  // Whether to allow console.* expressions
  console: false,
  // An array of global variables to allow
  allowedGlobals: [],
  // Allow the code to declare top-level variables
  declareGlobals: true
};

Released under an MIT license.

/blint/

    Package Sidebar

    Install

    npm i blint

    Weekly Downloads

    619

    Version

    1.1.2

    License

    none

    Unpacked Size

    29.2 kB

    Total Files

    35

    Last publish

    Collaborators

    • marijn