README
Broccoli Style Lint
Add stylelint to your broccoli build pipeline with ease.
Currently doesn't support ignored files configuration
Installation
npm install --save-dev broccoli-style-lint
Usage
Basic
var StyleLint = require('broccoli-style-lint');
// path to files that need linting
var node = new StyleLint('app/styles');
the default output will be the same SCSS files, in the same tree structure.
Generating Tests
var node = new StyleLint('app/styles', {generateTests:true});
Instead of receiving a tree of scss files, the plugin will output a tree of test files
original tree
.
├── scssfile1.sscss
└── nested-dir/
├── scssfile2.scss
output tree
.
├── scssfile1.stylelint-test.js
└── nested-dir/
├── scssfile2.stylelint-test.js
var StyleLint = require('broccoli-style-lint');
var Funnel = require('broccoli-funnel');
// path to files that need linting
var node = new StyleLint('app/styles');
// to extract tests from linter output
new Funnel(node, {
srcDir:'tests',
});
See below for more advaned test configurations
Configuration
linterConfig
{Object}
Hash as specified by stylelint
doesn't accept files
option
onError
{function}
A hook that allows you to do whatever you want
testFailingFiles
{boolean}
If true it will generate a unit test if the file fails lint.
testPassingFiles
{boolean}
If true it will generate a unit test if the passes fails lint.
generateTests
{boolean}
If true it will generate tests for both passing and failing tests, overrides the testPassingFiles and testFailingFiles
disableConsoleLogging
{boolean}
If true it will disable logging of errors to console