Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'no-var' rule for linting. Fixes #16 #17

Merged
merged 1 commit into from
Aug 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"single"
],
"max-len": 0,
"no-var": "error",
"semi": [
"error",
"always"
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/events.twitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
*/
'use strict';

var path = require('path');
var TAG = path.basename(__filename);
const path = require('path');
const TAG = path.basename(__filename);

// requires
const Conversation = require('hubot-conversation');
const utils = require('hubot-ibmcloud-utils').utils;
const palette = require('hubot-ibmcloud-utils').palette;
const activity = require('hubot-ibmcloud-activity-emitter');
var i18n = new (require('i18n-2'))({
const i18n = new (require('i18n-2'))({
locales: ['en'],
extension: '.json',
defaultLocale: 'en',
Expand Down
18 changes: 9 additions & 9 deletions test/bluemix.events.cognitive.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const helper = new Helper('../src/scripts');
const expect = require('chai').expect;

// configure i18n with location of strings
var i18n = new (require('i18n-2'))({
const i18n = new (require('i18n-2'))({
locales: ['en'],
extension: '.json',
defaultLocale: 'en',
Expand Down Expand Up @@ -57,7 +57,7 @@ describe('Interacting with Twitter Monitoring via Natural Language', function()
done();
});

var res = { message: {text: 'I want help with twitter monitoring', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
const res = { message: {text: 'I want help with twitter monitoring', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
room.robot.emit('twitter.monitoring.help', res, {});
});
});
Expand All @@ -74,7 +74,7 @@ describe('Interacting with Twitter Monitoring via Natural Language', function()
done();
});

var res = { message: {text: 'start tweeting about my applications', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
const res = { message: {text: 'start tweeting about my applications', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
room.robot.emit('twitter.monitoring.enable', res, {});
});
});
Expand All @@ -92,7 +92,7 @@ describe('Interacting with Twitter Monitoring via Natural Language', function()
done();
});

var res = { message: {text: 'start tweeting about my applications', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
const res = { message: {text: 'start tweeting about my applications', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
room.robot.emit('twitter.monitoring.enable', res, {});
});
});
Expand All @@ -109,7 +109,7 @@ describe('Interacting with Twitter Monitoring via Natural Language', function()
done();
});

var res = { message: {text: 'stop tweeting about my applications', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
const res = { message: {text: 'stop tweeting about my applications', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
room.robot.emit('twitter.monitoring.disable', res, {});
});
});
Expand All @@ -126,7 +126,7 @@ describe('Interacting with Twitter Monitoring via Natural Language', function()
done();
});

var res = { message: {text: 'stop tweeting about my applications', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
const res = { message: {text: 'stop tweeting about my applications', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
room.robot.emit('twitter.monitoring.disable', res, {});
});
});
Expand All @@ -142,7 +142,7 @@ describe('Interacting with Twitter Monitoring via Natural Language', function()
done();
});

var res = { message: {text: 'Change my event tweets', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
const res = { message: {text: 'Change my event tweets', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
room.robot.emit('twitter.tweet.edit', res, {});
});
});
Expand All @@ -156,7 +156,7 @@ describe('Interacting with Twitter Monitoring via Natural Language', function()
expect(room.messages[room.messages.length - 2][1]).to.contain(i18n.__('events.twitter.edit.events.prompt', '\'enable 1,2,3\' or \'disable 1 2\''));
done();
}, 200);
var res = { message: {text: 'Setup twitter events', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
const res = { message: {text: 'Setup twitter events', id: 'anId', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){} };
room.robot.emit('twitter.event.list', res, {});
});
});
Expand All @@ -173,7 +173,7 @@ describe('Interacting with Twitter Monitoring via Natural Language', function()
}
});

var res = { message: {text: 'Show twitter monitoring posts', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){}};
const res = { message: {text: 'Show twitter monitoring posts', user: {id: 'anId'}}, user: {id: 'anId'}, response: room, reply: function(){}};
room.robot.emit('twitter.tweet.list', res, {});
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/bluemix.events.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const helper = new Helper('../src/scripts');
const expect = require('chai').expect;

// configure i18n with location of strings
var i18n = new (require('i18n-2'))({
const i18n = new (require('i18n-2'))({
locales: ['en'],
extension: '.json',
defaultLocale: 'en',
Expand Down