diff --git a/docs/SASS.html b/docs/SASS.html index b376d58..1a80677 100644 --- a/docs/SASS.html +++ b/docs/SASS.html @@ -733,7 +733,7 @@
Performs linting
-Name | - - -Type | - - - - - -Description | -
---|---|---|
paths |
-
-
- - - -Array.<string> - - - - - | - - - - - -an array of paths to lint |
-
callback |
-
-
- - - -function - - - - - | - - - - - -a callback function |
-
sass.lint(['/path/to/the/input/file.scss', '/lint/this/directory/too'], () => { - // successfully linted -});- - -
a callback function, accepts 1 argument: an error message or null
a callback function, executed only on success
/* @flow */ -import type {NativeProcessCallback} from './typedef'; import {NativeProcess} from './NativeProcess'; import {join} from 'path'; @@ -145,7 +144,7 @@Source: SASSLint.js
* @instance * @method run * @param {Array<string>} paths - an array of paths to files/directories to lint - * @param {Function} callback - a callback function, accepts 1 argument: an error message or null + * @param {Function} callback - a callback function, executed only on success * @example * // lint "style.scss" as well as the entire contents of the "sass" directory * linter.run([join(__dirname, 'style.scss'), join(__dirname, 'sass')], error => { @@ -155,13 +154,17 @@Source: SASSLint.js
* // there were no linting errors * }); */ - run(paths: Array<string>, callback: NativeProcessCallback) { + run(paths: Array<string>, callback: () => void) { const args = paths.concat(['-c', config]); if (this.excludeLinter) { args.push('-x', this.excludeLinter); } - this.proc.run(callback, args); + this.proc.run(stderr => { + if (null === stderr) { + callback(); + } + }, args, {stdio: 'inherit'}); } } diff --git a/docs/quicksearch.html b/docs/quicksearch.html index 9822313..da1581f 100644 --- a/docs/quicksearch.html +++ b/docs/quicksearch.html @@ -7,7 +7,7 @@