A style checker. based on eslint, similar to standard, allows more spaces.
Install
npm install --save souffle-cli
The above installs souffle
command.
Rules
- 4 spaces for indent (configurable)
- no semicolons (configurable)
- allow padded block
- Check feross/standard for the rest of the rules.
Any rule can be modified by the option settings in package.json
You can create a similar command with your .eslintrc using white-lint module.
Usage
Package options
The behaviour of the command can be modified by the object at souffle
key of the package.json.
See the examples below for details.
globals
: Array
Set globals variables.
The above sets $
and util
as global variables.
parser
: String
Set the custom parser.
The above use babel-eslint as the parser.
rules
: Object
Set or overwrite any rules of eslint.
The above turns operator-linebreak
rule off.
indent
: Number|'tab'
Set space indent size or tab indent. (default: 4)
The above sets tab indent.
The above sets 2 space indent.
semi
: Boolean
Set true
if you use semicolon at the end of each line.
The above sets to use semicolons.
Command line options
Optionally the command behaviour can be modified by the command line options.
Usage:
souffle <flags> [FILES...]
If FILES is omitted, then all JavaScript source files (*.js, *.jsx) in the current
working directory are checked, recursively.
Certain paths (node_modules/, .git/, coverage/, *.min.js, bundle.js) are
automatically ignored.
Flags:
--global Declare global variable (can be set multiple times)
--parser Use custom js parser (e.g. babel-eslint)
-2, --2 Use 2 space indent
-4, --4 Use 4 space indent
--tab Use tab indent
--semi Use semicolon
--no-semi Don't use semicolon
-h, --help Show usage information
-v, --version Show current version
Badge
[](https://github.com/kt3k/souffle)
License
MIT