4.0.0 • Published 4 years ago

broccoli-stylelint v4.0.0

Weekly downloads
7,002
License
ISC
Repository
github
Last release
4 years ago

Build Status npm.io downloads

Broccoli Style Lint

Add stylelint to your broccoli build pipeline with ease.

Installation

npm install --save-dev broccoli-stylelint

Usage

Basic

var StyleLint = require('broccoli-stylelint');

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

Tests

Tests are automatically generated

If tests are generated 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-stylelint');
var Funnel =      require('broccoli-funnel');
// path to files that need linting
var node = StyleLint.create('app/styles');

// to extract tests from linter output
new Funnel(node, {
  srcDir:'tests',
});

Disable test generation set the option disableTestGeneration:true

var node = new StyleLint('app/styles', {disableTestGeneration:true});

Configuration

linterConfig {Object}

Hash as specified by stylelint

doesn't accept files option

All stylelint supported languages except jsx are valid targets by default. Alternatively, a syntax option can be passed in to scope targets to one language.

onError(errors) {function}

A hook that allows you to do whatever you want, when an error occurs

  • errors array of errors

group {boolean}

Groups tests under the same suite

testGenerator(relativePath, results, testingFramework) {function}

A hook that allows you generate tests.

  • relativePath path of currently linted file
  • errors array of errors if null then no errors occured

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.

disableTestGeneration {boolean}

Will disable generation of tests

testingFramework {string} supports 'qunit' or 'mocha'

log {boolean} If true it will log results to console

console {object} A custom console object

4.0.0

4 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.3.0

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago

0.12.0

7 years ago

0.11.0

7 years ago

0.10.3

7 years ago

0.10.2

7 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.0

7 years ago

0.8.4

7 years ago

0.8.3

8 years ago

0.8.2

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.0

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.1

8 years ago