indent-checker

0.4.0 • Public • Published

Build Status Coverage Status Dependency Status Code Quality

indent-checker

Simple library to test if file indentation rules are being met

Version

This documentation refers to indent-checker verions 0.2.2

Synopsis

var indent = require('indent-checker');
var text   = "\t\tSome text\n   Other line\n";
 
if (! indent.textOk(text)) {
    console.error('Text badly indented!');
}
 
if (indent.fileOk('some-file.json')) {
    console.log('some-file.json is well indented!');
}

Description

indent-checker is a library to check that text/files follow indentation rules. The default rule is that no line should mix indentation syles eg have both tabs and spaces on a line.

Configuration

  • type - the type of indentation to be supported
    • tabs - only allow indentation with tabs
    • spaces - only allow space indentation
    • undenfied or false - only allow one type of indentation in a file (no mixed indentation)
  • jsdoc - allow the common style of documentation where multi line documentation is a single space indented
    /**
     * With space indentation this style wont fail.
     */

Readme

Keywords

Package Sidebar

Install

npm i indent-checker

Weekly Downloads

2

Version

0.4.0

License

MIT

Last publish

Collaborators

  • ivan.wills