Fix linting errors

This commit is contained in:
JC Brand 2019-08-05 11:14:49 +02:00
parent db550b3ec7
commit bda567ca01
10 changed files with 57 additions and 57 deletions

View File

@ -41,8 +41,8 @@
const textarea = view.el.querySelector('textarea.chat-textarea'); const textarea = view.el.querySelector('textarea.chat-textarea');
const at_event = { const at_event = {
'target': textarea, 'target': textarea,
'preventDefault': function noop () {}, 'preventDefault': function preventDefault () {},
'stopPropagation': function noop () {}, 'stopPropagation': function stopPropagation () {},
'keyCode': 50, 'keyCode': 50,
'key': '@' 'key': '@'
}; };
@ -84,8 +84,8 @@
// Press tab // Press tab
const tab_event = { const tab_event = {
'target': textarea, 'target': textarea,
'preventDefault': function noop () {}, 'preventDefault': function preventDefault () {},
'stopPropagation': function noop () {}, 'stopPropagation': function stopPropagation () {},
'keyCode': 9, 'keyCode': 9,
'key': 'Tab' 'key': 'Tab'
} }
@ -97,7 +97,7 @@
const backspace_event = { const backspace_event = {
'target': textarea, 'target': textarea,
'preventDefault': function noop () {}, 'preventDefault': function preventDefault () {},
'keyCode': 8 'keyCode': 8
} }
for (var i=0; i<3; i++) { for (var i=0; i<3; i++) {
@ -129,7 +129,7 @@
const up_arrow_event = { const up_arrow_event = {
'target': textarea, 'target': textarea,
'preventDefault': () => (up_arrow_event.defaultPrevented = true), 'preventDefault': () => (up_arrow_event.defaultPrevented = true),
'stopPropagation': function noop () {}, 'stopPropagation': function stopPropagation () {},
'keyCode': 38 'keyCode': 38
} }
view.onKeyDown(up_arrow_event); view.onKeyDown(up_arrow_event);
@ -140,8 +140,8 @@
view.onKeyDown({ view.onKeyDown({
'target': textarea, 'target': textarea,
'preventDefault': function noop () {}, 'preventDefault': function preventDefault () {},
'stopPropagation': function noop () {}, 'stopPropagation': function stopPropagation () {},
'keyCode': 13 // Enter 'keyCode': 13 // Enter
}); });
expect(textarea.value).toBe('hello s @some2 '); expect(textarea.value).toBe('hello s @some2 ');
@ -195,8 +195,8 @@
// Press backspace // Press backspace
const backspace_event = { const backspace_event = {
'target': textarea, 'target': textarea,
'preventDefault': function noop () {}, 'preventDefault': function preventDefault () {},
'stopPropagation': function noop () {}, 'stopPropagation': function stopPropagation () {},
'keyCode': 8, 'keyCode': 8,
'key': 'Backspace' 'key': 'Backspace'
} }

View File

@ -497,7 +497,7 @@
const textarea = view.el.querySelector('.chat-textarea'); const textarea = view.el.querySelector('.chat-textarea');
const ev = { const ev = {
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}; };
view.onKeyDown(ev); view.onKeyDown(ev);
@ -1167,7 +1167,7 @@
view.el.querySelector('.chat-textarea').value = message; view.el.querySelector('.chat-textarea').value = message;
view.onKeyDown({ view.onKeyDown({
target: view.el.querySelector('textarea.chat-textarea'), target: view.el.querySelector('textarea.chat-textarea'),
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
expect(view.clearMessages).toHaveBeenCalled(); expect(view.clearMessages).toHaveBeenCalled();

View File

@ -267,7 +267,7 @@
async function (done, _converse) { async function (done, _converse) {
const xhr = { const xhr = {
'open': function noop () {}, 'open': function open () {},
'send': function () { 'send': function () {
xhr.responseText = JSON.stringify([ xhr.responseText = JSON.stringify([
{"jid": "marty@mcfly.net", "fullname": "Marty McFly"}, {"jid": "marty@mcfly.net", "fullname": "Marty McFly"},
@ -328,7 +328,7 @@
test_utils.createContacts(_converse, 'all').openControlBox(); test_utils.createContacts(_converse, 'all').openControlBox();
var modal; var modal;
const xhr = { const xhr = {
'open': function noop () {}, 'open': function open () {},
'send': function () { 'send': function () {
const value = modal.el.querySelector('input[name="name"]').value; const value = modal.el.querySelector('input[name="name"]').value;
if (value === 'existing') { if (value === 'existing') {

View File

@ -27,7 +27,7 @@
textarea.value = 'But soft, what light through yonder airlock breaks?'; textarea.value = 'But soft, what light through yonder airlock breaks?';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
@ -55,7 +55,7 @@
textarea.value = 'But soft, what light through yonder window breaks?'; textarea.value = 'But soft, what light through yonder window breaks?';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
expect(_converse.connection.send).toHaveBeenCalled(); expect(_converse.connection.send).toHaveBeenCalled();
@ -161,7 +161,7 @@
textarea.value = 'But soft, what light through yonder airlock breaks?'; textarea.value = 'But soft, what light through yonder airlock breaks?';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
@ -184,7 +184,7 @@
textarea.value = 'But soft, what light through yonder window breaks?'; textarea.value = 'But soft, what light through yonder window breaks?';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
expect(_converse.connection.send).toHaveBeenCalled(); expect(_converse.connection.send).toHaveBeenCalled();
@ -237,7 +237,7 @@
textarea.value = 'It is the east, and Juliet is the one.'; textarea.value = 'It is the east, and Juliet is the one.';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
@ -246,7 +246,7 @@
textarea.value = 'Arise, fair sun, and kill the envious moon'; textarea.value = 'Arise, fair sun, and kill the envious moon';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
@ -277,7 +277,7 @@
textarea.value = 'It is the east, and Juliet is the sun.'; textarea.value = 'It is the east, and Juliet is the sun.';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
await new Promise((resolve, reject) => view.model.messages.once('rendered', resolve)); await new Promise((resolve, reject) => view.model.messages.once('rendered', resolve));
@ -1331,7 +1331,7 @@
textarea.value = 'But soft, what light through yonder airlock breaks?'; textarea.value = 'But soft, what light through yonder airlock breaks?';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
await u.waitUntil(() => _converse.api.chats.get().length); await u.waitUntil(() => _converse.api.chats.get().length);
@ -1354,7 +1354,7 @@
textarea.value = 'Another message'; textarea.value = 'Another message';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
@ -2537,7 +2537,7 @@
textarea.value = 'But soft, what light through yonder airlock breaks?'; textarea.value = 'But soft, what light through yonder airlock breaks?';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
@ -2561,7 +2561,7 @@
textarea.value = 'But soft, what light through yonder window breaks?'; textarea.value = 'But soft, what light through yonder window breaks?';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
expect(_converse.connection.send).toHaveBeenCalled(); expect(_converse.connection.send).toHaveBeenCalled();
@ -2636,7 +2636,7 @@
textarea.value = 'But soft, what light through yonder airlock breaks?'; textarea.value = 'But soft, what light through yonder airlock breaks?';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
@ -2715,7 +2715,7 @@
textarea.value = 'But soft, what light through yonder airlock breaks?'; textarea.value = 'But soft, what light through yonder airlock breaks?';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
@ -2751,7 +2751,7 @@
textarea.value = 'But soft, what light through yonder airlock breaks?'; textarea.value = 'But soft, what light through yonder airlock breaks?';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
@ -2996,8 +2996,8 @@
textarea.value = 'hello @z3r0 @gibson @mr.robot, how are you?' textarea.value = 'hello @z3r0 @gibson @mr.robot, how are you?'
const enter_event = { const enter_event = {
'target': textarea, 'target': textarea,
'preventDefault': function noop () {}, 'preventDefault': function preventDefault () {},
'stopPropagation': function noop () {}, 'stopPropagation': function stopPropagation () {},
'keyCode': 13 // Enter 'keyCode': 13 // Enter
} }
spyOn(_converse.connection, 'send'); spyOn(_converse.connection, 'send');
@ -3074,8 +3074,8 @@
textarea.value = 'hello @z3r0 @gibson @mr.robot, how are you?' textarea.value = 'hello @z3r0 @gibson @mr.robot, how are you?'
const enter_event = { const enter_event = {
'target': textarea, 'target': textarea,
'preventDefault': function noop () {}, 'preventDefault': function preventDefault () {},
'stopPropagation': function noop () {}, 'stopPropagation': function stopPropagation () {},
'keyCode': 13 // Enter 'keyCode': 13 // Enter
} }
view.onKeyDown(enter_event); view.onKeyDown(enter_event);

View File

@ -2011,7 +2011,7 @@
textarea.value = text; textarea.value = text;
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
@ -2864,7 +2864,7 @@
const textarea = view.el.querySelector('.chat-textarea'); const textarea = view.el.querySelector('.chat-textarea');
textarea.value = '/clear'; textarea.value = '/clear';
const enter = { 'target': textarea, 'preventDefault': function noop () {}, 'keyCode': 13 }; const enter = { 'target': textarea, 'preventDefault': function preventDefault () {}, 'keyCode': 13 };
view.onKeyDown(enter); view.onKeyDown(enter);
textarea.value = '/help'; textarea.value = '/help';
view.onKeyDown(enter); view.onKeyDown(enter);
@ -2935,7 +2935,7 @@
await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo'); await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo');
const view = _converse.chatboxviews.get('lounge@montague.lit'); const view = _converse.chatboxviews.get('lounge@montague.lit');
var textarea = view.el.querySelector('.chat-textarea'); var textarea = view.el.querySelector('.chat-textarea');
const enter = { 'target': textarea, 'preventDefault': function noop () {}, 'keyCode': 13 }; const enter = { 'target': textarea, 'preventDefault': function preventDefault () {}, 'keyCode': 13 };
spyOn(window, 'confirm').and.callFake(() => true); spyOn(window, 'confirm').and.callFake(() => true);
textarea.value = '/clear'; textarea.value = '/clear';
view.onKeyDown(enter); view.onKeyDown(enter);
@ -2999,7 +2999,7 @@
textarea.value = '/member chris Welcome to the club!'; textarea.value = '/member chris Welcome to the club!';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
expect(_converse.connection.send).not.toHaveBeenCalled(); expect(_converse.connection.send).not.toHaveBeenCalled();
@ -3011,7 +3011,7 @@
textarea.value = '/member marc Welcome to the club!'; textarea.value = '/member marc Welcome to the club!';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
expect(_converse.connection.send).toHaveBeenCalled(); expect(_converse.connection.send).toHaveBeenCalled();
@ -3126,7 +3126,7 @@
textarea.value = '/topic This is the groupchat subject'; textarea.value = '/topic This is the groupchat subject';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
expect(_converse.connection.send).toHaveBeenCalled(); expect(_converse.connection.send).toHaveBeenCalled();
@ -3136,7 +3136,7 @@
textarea.value = '/subject This is a new subject'; textarea.value = '/subject This is a new subject';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
@ -3150,7 +3150,7 @@
textarea.value = '/Subject This is yet another subject'; textarea.value = '/Subject This is yet another subject';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
expect(sent_stanza.textContent).toBe('This is yet another subject'); expect(sent_stanza.textContent).toBe('This is yet another subject');
@ -3173,7 +3173,7 @@
textarea.value = '/clear'; textarea.value = '/clear';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
expect(view.clearMessages).toHaveBeenCalled(); expect(view.clearMessages).toHaveBeenCalled();
@ -3215,7 +3215,7 @@
textarea.value = '/owner'; textarea.value = '/owner';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
expect(view.validateRoleOrAffiliationChangeArgs).toHaveBeenCalled(); expect(view.validateRoleOrAffiliationChangeArgs).toHaveBeenCalled();
@ -3303,7 +3303,7 @@
textarea.value = '/ban'; textarea.value = '/ban';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
expect(view.validateRoleOrAffiliationChangeArgs).toHaveBeenCalled(); expect(view.validateRoleOrAffiliationChangeArgs).toHaveBeenCalled();
@ -3404,7 +3404,7 @@
textarea.value = '/kick'; textarea.value = '/kick';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
expect(view.validateRoleOrAffiliationChangeArgs).toHaveBeenCalled(); expect(view.validateRoleOrAffiliationChangeArgs).toHaveBeenCalled();
@ -3508,7 +3508,7 @@
textarea.value = '/op'; textarea.value = '/op';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
@ -3651,7 +3651,7 @@
textarea.value = '/mute'; textarea.value = '/mute';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });

View File

@ -126,7 +126,7 @@
textarea.value = 'This message will be encrypted'; textarea.value = 'This message will be encrypted';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
iq_stanza = await u.waitUntil(() => bundleFetched(_converse, contact_jid, '555')); iq_stanza = await u.waitUntil(() => bundleFetched(_converse, contact_jid, '555'));
@ -310,7 +310,7 @@
textarea.value = 'This message will be encrypted'; textarea.value = 'This message will be encrypted';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
iq_stanza = await u.waitUntil(() => bundleFetched(_converse, contact_jid, '4e30f35051b7b8b42abe083742187228'), 1000); iq_stanza = await u.waitUntil(() => bundleFetched(_converse, contact_jid, '4e30f35051b7b8b42abe083742187228'), 1000);
@ -458,7 +458,7 @@
textarea.value = 'This is an encrypted message from this device'; textarea.value = 'This is an encrypted message from this device';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
iq_stanza = await u.waitUntil(() => bundleFetched(_converse, _converse.bare_jid, '988349631')); iq_stanza = await u.waitUntil(() => bundleFetched(_converse, _converse.bare_jid, '988349631'));
@ -515,7 +515,7 @@
textarea.value = 'This message will be encrypted'; textarea.value = 'This message will be encrypted';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 // Enter keyCode: 13 // Enter
}); });
let iq_stanza = await u.waitUntil(() => deviceListFetched(_converse, contact_jid)); let iq_stanza = await u.waitUntil(() => deviceListFetched(_converse, contact_jid));
@ -1251,7 +1251,7 @@
textarea.value = 'This message will be sent encrypted'; textarea.value = 'This message will be sent encrypted';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });

View File

@ -24,7 +24,7 @@
textarea.value = '/register'; textarea.value = '/register';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
let stanza = await u.waitUntil(() => _.filter( let stanza = await u.waitUntil(() => _.filter(

View File

@ -111,7 +111,7 @@
textarea.value = 'This is the spoiler'; textarea.value = 'This is the spoiler';
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));
@ -188,7 +188,7 @@
view.onKeyDown({ view.onKeyDown({
target: textarea, target: textarea,
preventDefault: function noop () {}, preventDefault: function preventDefault () {},
keyCode: 13 keyCode: 13
}); });
await new Promise((resolve, reject) => view.once('messageInserted', resolve)); await new Promise((resolve, reject) => view.once('messageInserted', resolve));

View File

@ -112,8 +112,8 @@ converse.plugins.add('converse-headline', {
}, },
// Override to avoid the methods in converse-chatview.js // Override to avoid the methods in converse-chatview.js
'renderMessageForm': function noop () {}, 'renderMessageForm': function renderMessageForm () {},
'afterShown': function noop () {} 'afterShown': function afterShown () {}
}); });
async function onHeadlineMessage (message) { async function onHeadlineMessage (message) {

View File

@ -78,7 +78,7 @@ converse.plugins.add("converse-oauth", {
}); });
_converse.OAuthProviders = _converse.Collection.extend({ _converse.OAuthProviders = _converse.Collection.extend({
'sync': _function noop () {}, 'sync': function sync () {},
initialize () { initialize () {
_.each(_converse.user_settings.oauth_providers, (provider) => { _.each(_converse.user_settings.oauth_providers, (provider) => {