Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ayan4m1/yeoman-stylelint


https://github.com/ayan4m1/yeoman-stylelint

library nodejs stylelint transform-stream yeoman

Last synced: 4 days ago
JSON representation

Awesome Lists containing this project

README

        

# yeoman-stylelint

This package seeks to solve a single problem. Using [gulp-stylelint](https://github.com/olegskl/gulp-stylelint) as a Yeoman transform stream causes a crash if there are any conflicts during the Yeoman run. I want to pre-lint my SCSS so that it doesn't come out of the tin broken.

## usage

First, require/import the module:

```js
const stylelint = require('yeoman-stylelint');

import stylelint from 'yeoman-stylelint';
```

Then, in your generator constructor, add something similar to:

```js
this.registerTransformStream(
gulpIf(
/\.scss$/,
stylelint({ configFile: path.join(__dirname, '..', '.stylelintrc' }))
)
);
```

Now, all `.scss` files that are written by Yeoman will be preprocessed with stylelint, automatically fixing what it can.