Skip to content

Commit

Permalink
feat(plugin): update to stylelint 8 (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
olegskl committed Jul 18, 2017
1 parent 315504b commit 979d85a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
21 changes: 11 additions & 10 deletions package.json
Expand Up @@ -26,23 +26,24 @@
},
"homepage": "https://github.com/olegskl/gulp-stylelint",
"dependencies": {
"chalk": "^1.1.3",
"deep-extend": "^0.4.1",
"chalk": "^2.0.1",
"deep-extend": "^0.5.0",
"gulp-util": "^3.0.8",
"mkdirp": "^0.5.1",
"promise": "^7.1.1",
"stylelint": "^7.9.0",
"promise": "^8.0.1",
"strip-ansi": "^4.0.0",
"stylelint": "^8.0.0",
"through2": "^2.0.3"
},
"devDependencies": {
"babel-cli": "^6.23.0",
"babel-core": "^6.23.1",
"babel-preset-es2015": "^6.22.0",
"babel-register": "^6.23.0",
"babel-cli": "^6.24.1",
"babel-core": "^6.25.0",
"babel-preset-es2015": "^6.24.1",
"babel-register": "^6.24.1",
"eslint": "^3.16.0",
"eslint-config-meetic": "^4.0.0",
"gulp": "^3.9.1",
"sinon": "^1.17.7",
"tape": "^4.6.3"
"sinon": "^2.3.8",
"tape": "^4.7.0"
}
}
4 changes: 3 additions & 1 deletion src/index.js
Expand Up @@ -24,7 +24,7 @@ const pluginName = 'gulp-stylelint';
* @param {Boolean} [options.debug] - If true, error stack will be printed.
* @return {Stream} Object stream usable in Gulp pipes.
*/
module.exports = function gulpStylelint(options) {
module.exports = function gulpStylelint(options) { // eslint-disable-line max-statements

/**
* Plugin options with defaults applied.
Expand Down Expand Up @@ -57,6 +57,8 @@ module.exports = function gulpStylelint(options) {
// Remove the stylelint options that cannot be used:
delete lintOptions.files; // css code will be provided by gulp instead
delete lintOptions.formatter; // formatters are defined in the `reporters` option
delete lintOptions.cache; // gulp caching should be used instead
delete lintOptions.fix; // FIXME: wait for stylelint support

// Remove gulp-stylelint options so that they don't interfere with stylelint options:
delete lintOptions.reportOutputDir;
Expand Down
4 changes: 2 additions & 2 deletions src/writer.js
Expand Up @@ -6,7 +6,7 @@
import fs from 'fs';
import path from 'path';
import mkdirp from 'mkdirp';
import {stripColor} from 'chalk';
import stripAnsi from 'strip-ansi';
import {denodeify} from 'promise';

const mkdir = denodeify(mkdirp);
Expand All @@ -22,5 +22,5 @@ const writeFile = denodeify(fs.writeFile);
export default function writer(text, dest, destRoot = process.cwd()) {
const fullpath = path.resolve(destRoot, dest);
return mkdir(path.dirname(fullpath))
.then(() => writeFile(fullpath, stripColor(text)));
.then(() => writeFile(fullpath, stripAnsi(text)));
}

0 comments on commit 979d85a

Please sign in to comment.