Issues (2242)

node_modules/growl/test.js (8 issues)

1
2
var growl = require('./lib/growl')
3
4
growl('Support sound notifications', {title: 'Make a sound', sound: 'purr'});
5
growl('You have mail!')
6
growl('5 new messages', { sticky: true })
7
growl('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true })
8
growl('Message with title', { title: 'Title'})
9
growl('Set priority', { priority: 2 })
10
growl('Show Safari icon', { image: 'Safari' })
11
growl('Show icon', { image: 'path/to/icon.icns' })
12
growl('Show image', { image: 'path/to/my.image.png' })
13
growl('Show png filesystem icon', { image: 'png' })
14
growl('Show pdf filesystem icon', { image: 'article.pdf' })
15
growl('Show pdf filesystem icon', { image: 'article.pdf' }, function(){
16
  console.log('callback');
0 ignored issues
show
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
17
})
18
growl('Show pdf filesystem icon', { title: 'Use show()', image: 'article.pdf' })
19
growl('here \' are \n some \\ characters that " need escaping', {}, function(error, stdout, stderr) {
20
  if (error !== null) throw new Error('escaping failed:\n' + stdout + stderr);
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
21
})
22
growl('Allow custom notifiers', { exec: 'echo XXX %s' }, function(error, stdout, stderr) {
0 ignored issues
show
The parameter stderr is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
23
  console.log(stdout);
0 ignored issues
show
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
24
})
25
growl('Allow custom notifiers', { title: 'test', exec: 'echo YYY' }, function(error, stdout, stderr) {
0 ignored issues
show
The parameter stderr is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
26
  console.log(stdout);
0 ignored issues
show
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
27
})
28
growl('Allow custom notifiers', { title: 'test', exec: 'echo ZZZ %s' }, function(error, stdout, stderr) {
0 ignored issues
show
The parameter stderr is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
29
  console.log(stdout);
0 ignored issues
show
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
30
})
31
growl('Open a URL', { url: 'https://npmjs.org/package/growl' });
32