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 27, 2016
1 parent 8ff22b9 commit ceb52bd
Show file tree
Hide file tree
Showing 3 changed files with 19 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
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = function eslint ( inputdir, options ) {

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

delete options.reporter;
delete options.reportOnly;
Expand All @@ -21,5 +22,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 ceb52bd

Please sign in to comment.