Skip to content

Commit

Permalink
Support a notification system
Browse files Browse the repository at this point in the history
  • Loading branch information
julienw committed Feb 28, 2016
1 parent e38318b commit c230525
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ module.exports = gobble( 'src/js' )
.observeIf( gobble.env() !== 'production', 'eslint', {...});
```

Use the `growl` option to send a notification when the linting is done:

```js
```

See [the node-growl documentation](https://github.com/tj/node-growl) to know the
requirements for this node module.

## License

MIT. Copyright 2014 Rich Harris
MIT. Copyright 2014 Rich Harris
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ module.exports = function eslint ( inputdir, options ) {

var reportOnly = options.reportOnly;
var reporter = options.reporter;
var useGrowl = options.growl;

delete options.reporter;
delete options.reportOnly;
delete options.growl;

// This is necessary for eslint to lint files in .gobble directories
options.dotfiles = true;

// This is necessary for eslint to lint files in .gobble directories
options.dotfiles = true;
Expand All @@ -24,5 +29,12 @@ module.exports = function eslint ( inputdir, options ) {
}
}

if (useGrowl) {
var notification = 'Result: ' + reports.errorCount + ' errors, ' +
reports.warningCount + ' warnings';

require('growl')(notification, { title: 'ESLint' });
}

return Promise.resolve();
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"license": "MIT",
"repository": "https://github.com/gobblejs/gobble-eslint",
"dependencies": {
"eslint": "^2.0"
"eslint": "^2.0",
"growl": "^1.9.2"
},
"keywords": [
"gobble",
Expand Down

0 comments on commit c230525

Please sign in to comment.