stacklint
v0.5.1
Published
Code-style and linting presets cli-tool to quickly scaffold project development
Downloads
18
Readme
Stacklint
Code-style and linting presets cli-tool to quickly scaffold project development.
All stacks use lintstaged
to run all linted stacks when code is commited to the git repository. We feel that this is a really nice approach to avoid un-linted code creeping into the codebase.
Because standard lint configuration files are used any related Code-editor plugins should pickup and follow the same ruleset, or when running individual linters directly.
When running stacklint
all node and composer packages required to lint the selected stacks are added to your configuration files and individual config files for each stack are also included.
Installation
Stacklint is intended to be installed globally so that it can easily be run and there is no need to include the dependency in your project specific package.json.
npm install -g stacklint
Usage
stacklint [options] <stacks>
After installing your lint stacks you will need to run required installs.
npm install
composer install
Note: Because lintstaged installs some git hooks, you should initialise your git repository before running npm install
after setting up your stacks.
Examples
The following example will setup all required files and packages to lint php
and md
Markdown files when they are committed to git.
stacklint php md json
Installs packages and configs for:
- Lintstaged
- PHP Codesniffer
- Markdownlint
- Jsonlint
stacklint js airbnb vue
Installs packages and config for:
- Lintstaged
- ESLint
- Airbnb extend
- Vue.js plugin
- Babel plugin
Available stacks
You can quickly check which stacks are available by running stacklint -l
or stacklint --list
.
- js (Javascript. Also required additional stack for style guide. E.g.
airbnb
)- airbnb (Airbnb style guide)
- json
- laravel (Use instead of
php
if using laravel) - md (Markdown)
- php (PSR-2)
- scss
- vue (Requires
js
stack)
Contributing
We welcome any contributions, especially new lint stacks.
Support
If you have any question or problems please open an issue (or submit a PR). Alternatively you can contact me, m2de on Twitter.