Giter VIP home page Giter VIP logo

xlint1's Introduction

xlint

Powerful CLI for any lint solution

Usage

$ xlint [options] [<paths>]

for example:

$ xlint --linter=path/to/jslint-module.js project/path

Interested in live console?

$ xlint --watch --linter=path/to/jslint-module.js project/path

Installation

$ npm install -g xlint

Options

  • linter path - Path to linter module. It must be CJS module, see e.g. xlint-jslint for JSLint provided as one
  • cache bool - Whether to cache generated reports. Very useful if we rerun the script on large projects. Cached reports are saved into .lintcache file in your project main directory [default: true]
  • color bool - Colorize console output [default: true]
  • depth number - How deeply to recurse into subdirectories [default: Infinity]
  • ignoreRules string - Whether to obey rules found in ignore files (Currently just git for .giitignore rules is supported). It's backed by fs2.isIgnored [default: git]
  • stream bool - Whether to generate reports on the go (as soon as first filenames are obtained) [default: true]
  • watch bool - Output reports in live console which updates after code or configuration files are updated [default: false]

Ignoring specific files and directories

Apart of support for .gitignore rules, XLint also looks for rules in .lintignore files. Syntax rules for those files is same as for .gitignore files.

Configuration files

XLint supports external .lint configuration files, through which we may setup options that are passed to linter. There can be many_.lint_ files placed in any directory within project

File format is similar to conf files as we know them from *nix systems:

# This is a comment, any of this are ignored by the parser

@root                     # Root of a project, means that any rules found in upper directories won't have effect

plusplus                  # Regular boolean option
indent 2                  # Numeric option
predef console, window    # Array of strings

./foo.js                  # Options that would only address foo.js file
!plusplus                 # Overridden boolean option (set to false)
predef+ XMLHttpRequest    # Add token to array option
predef- console           # Remove token from array option

./some-dir                # Options that address only files within given directory
predef foo, bar           # Override array option
otherarr one,             # Other array option, if we set just one token, we need to post-fix it with comma

JSHint case

XLint doesn't support options defined in jshintrc files.
JSHint separates global variable settings from other options, but in XLint configuration files, global should be defined same as other options (as e.g. predef for JSLint), it will be passed to JSHint as expected.

Tests Build Status

$ npm test

xlint1's People

Contributors

medikoo 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.