From b5137c8cda81e5223e70f8311643861a29caf9f2 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Tue, 18 Dec 2018 15:49:33 -0200 Subject: [PATCH 1/6] Remove /* globals */ from files wave 1 --- .eslintrc | 9 +++++++++ client/notifications/notification.js | 2 +- client/notifications/updateAvatar.js | 2 +- client/notifications/updateUserState.js | 2 +- client/routes/router.js | 2 +- client/startup/i18n.js | 2 +- client/startup/startup.js | 3 ++- client/startup/unread.js | 6 +++--- packages/meteor-accounts-saml/client/saml_client.js | 1 - .../server/functions/canAccessRoom.js | 3 ++- .../client/views/channelSettings.js | 2 +- packages/rocketchat-channel-settings/package.js | 1 + .../client/custom_oauth_client.js | 2 +- .../server/custom_oauth_server.js | 2 +- packages/rocketchat-e2e/client/accountEncryption.js | 4 +++- packages/rocketchat-e2e/client/rocketchat.e2e.js | 1 - packages/rocketchat-e2e/package.js | 2 -- packages/rocketchat-emoji/client/keyboardFix.js | 1 - .../client/lib/fileUploadHandler.js | 4 ++-- .../rocketchat-file-upload/globalFileRestrictions.js | 2 +- packages/rocketchat-file-upload/lib/FileUpload.js | 2 -- packages/rocketchat-file-upload/lib/FileUploadBase.js | 5 ++--- packages/rocketchat-file-upload/package.js | 1 - .../rocketchat-file-upload/server/config/AmazonS3.js | 2 -- .../rocketchat-file-upload/server/config/FileSystem.js | 3 +-- .../server/config/GoogleStorage.js | 2 -- packages/rocketchat-file-upload/server/config/GridFS.js | 2 +- .../server/config/Slingshot_DEPRECATED.js | 2 +- packages/rocketchat-file-upload/server/config/Webdav.js | 2 -- .../server/config/_configUploadStorage.js | 3 +-- packages/rocketchat-file-upload/server/lib/FileUpload.js | 3 +-- packages/rocketchat-file-upload/server/lib/proxy.js | 4 ++-- packages/rocketchat-file-upload/server/lib/requests.js | 3 +-- .../server/methods/getS3FileUrl.js | 2 +- packages/rocketchat-iframe-login/client/iframe_client.js | 1 - packages/rocketchat-internal-hubot/server/hubot.js | 1 - packages/rocketchat-lib/client/lib/openRoom.js | 2 +- packages/rocketchat-ui/client/lib/avatar.js | 2 +- packages/rocketchat-ui/client/lib/collections.js | 6 +++--- packages/rocketchat-ui/client/lib/fileUpload.js | 3 ++- packages/rocketchat-ui/client/lib/readMessages.js | 4 +--- packages/rocketchat-ui/package.js | 4 ++++ 42 files changed, 54 insertions(+), 58 deletions(-) diff --git a/.eslintrc b/.eslintrc index 2502be847468..a8b22e5e86dc 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,8 +2,10 @@ "extends": ["@rocket.chat/eslint-config"], "parser": "babel-eslint", "globals": { + "__meteor_bootstrap__" : false, "__meteor_runtime_config__" : false, "AccountBox" : false, + "alerts" : false, "Apps" : false, "Assets" : false, "browser" : false, @@ -11,13 +13,19 @@ "ChatMessages" : false, "ChatRoom" : false, "ChatSubscription" : false, + "cordova" : false, + "device" : false, + "facebookConnectPlugin" : false, "FileUpload" : false, + "fileUploadHandler" : false, "handleError" : false, "getAvatarUrlFromUsername" : false, "Logger" : false, "modal" : false, + "menu" : false, "Npm" : false, "Package" : false, + "readMessage" : false, "RocketChat" : true, "RoomHistoryManager" : false, "RoomManager" : false, @@ -27,6 +35,7 @@ "t" : false, "TimeSync" : false, "toastr" : false, + "TwitterConnect" : false, "VideoRecorder" : false, "VRecDialog" : false } diff --git a/client/notifications/notification.js b/client/notifications/notification.js index 52d7083b2350..bb406e8ab86a 100644 --- a/client/notifications/notification.js +++ b/client/notifications/notification.js @@ -1,8 +1,8 @@ -/* globals KonchatNotification, fireGlobalEvent, readMessage, CachedChatSubscription */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; +import { KonchatNotification, fireGlobalEvent, readMessage, CachedChatSubscription } from 'meteor/rocketchat:ui'; // Show notifications and play a sound for new messages. // We trust the server to only send notifications for interesting messages, e.g. direct messages or diff --git a/client/notifications/updateAvatar.js b/client/notifications/updateAvatar.js index 28d7cb3dba74..b03d115ffddb 100644 --- a/client/notifications/updateAvatar.js +++ b/client/notifications/updateAvatar.js @@ -1,5 +1,5 @@ -/* globals updateAvatarOfUsername */ import { Meteor } from 'meteor/meteor'; +import { updateAvatarOfUsername } from 'meteor/rocketchat:ui'; Meteor.startup(function() { RocketChat.Notifications.onLogged('updateAvatar', function(data) { diff --git a/client/notifications/updateUserState.js b/client/notifications/updateUserState.js index 9144bce0fdc7..84cbaf9af6a6 100644 --- a/client/notifications/updateUserState.js +++ b/client/notifications/updateUserState.js @@ -1,5 +1,5 @@ -/* globals fireGlobalEvent */ import { Meteor } from 'meteor/meteor'; +import { fireGlobalEvent } from 'meteor/rocketchat:ui'; /* fire user state change globally, to listen on desktop electron client */ Meteor.startup(function() { diff --git a/client/routes/router.js b/client/routes/router.js index 9d80c73ee9fd..8f1dfd711038 100644 --- a/client/routes/router.js +++ b/client/routes/router.js @@ -1,4 +1,3 @@ -/* globals KonchatNotification */ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; import { Tracker } from 'meteor/tracker'; @@ -6,6 +5,7 @@ import { Blaze } from 'meteor/blaze'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { BlazeLayout } from 'meteor/kadira:blaze-layout'; import { Session } from 'meteor/session'; +import { KonchatNotification } from 'meteor/rocketchat:ui'; import s from 'underscore.string'; Blaze.registerHelper('pathFor', function(path, kw) { diff --git a/client/startup/i18n.js b/client/startup/i18n.js index 61ca1031914e..242e06f6b0c1 100644 --- a/client/startup/i18n.js +++ b/client/startup/i18n.js @@ -1,8 +1,8 @@ -/* globals isRtl */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; import { TAPi18n } from 'meteor/tap:i18n'; +import { isRtl } from 'meteor/rocketchat:ui'; import moment from 'moment'; const currentLanguage = new ReactiveVar(); diff --git a/client/startup/startup.js b/client/startup/startup.js index cf2c1eea246b..e5602cd19313 100644 --- a/client/startup/startup.js +++ b/client/startup/startup.js @@ -1,8 +1,9 @@ -/* globals UserPresence, fireGlobalEvent */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { Session } from 'meteor/session'; import { TimeSync } from 'meteor/mizzao:timesync'; +import { UserPresence } from 'meteor/konecty:user-presence'; +import { fireGlobalEvent } from 'meteor/rocketchat:ui'; import toastr from 'toastr'; import hljs from 'highlight.js'; import 'highlight.js/styles/github.css'; diff --git a/client/startup/unread.js b/client/startup/unread.js index 5580c0635bf7..03bae2b49253 100644 --- a/client/startup/unread.js +++ b/client/startup/unread.js @@ -1,9 +1,9 @@ -/* globals fireGlobalEvent, readMessage, favico, menu */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; import { Favico } from 'meteor/rocketchat:favico'; +import { fireGlobalEvent, readMessage } from 'meteor/rocketchat:ui'; Meteor.startup(function() { Tracker.autorun(function() { @@ -77,8 +77,8 @@ Meteor.startup(function() { const unread = Session.get('unread'); fireGlobalEvent('unread-changed', unread); - if (favico) { - favico.badge(unread, { + if (window.favico) { + window.favico.badge(unread, { bgColor: typeof unread !== 'number' ? '#3d8a3a' : '#ac1b1b', }); } diff --git a/packages/meteor-accounts-saml/client/saml_client.js b/packages/meteor-accounts-saml/client/saml_client.js index a30ad29dca19..c89f8ca6632f 100644 --- a/packages/meteor-accounts-saml/client/saml_client.js +++ b/packages/meteor-accounts-saml/client/saml_client.js @@ -1,4 +1,3 @@ -/* globals cordova */ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; diff --git a/packages/rocketchat-authorization/server/functions/canAccessRoom.js b/packages/rocketchat-authorization/server/functions/canAccessRoom.js index eb67c5078b87..dc83d5652648 100644 --- a/packages/rocketchat-authorization/server/functions/canAccessRoom.js +++ b/packages/rocketchat-authorization/server/functions/canAccessRoom.js @@ -1,4 +1,5 @@ -/* globals RocketChat */ +import { RocketChat } from 'meteor/rocketchat:lib'; + RocketChat.authz.roomAccessValidators = [ function(room, user = {}) { if (room && room.t === 'c') { diff --git a/packages/rocketchat-channel-settings/client/views/channelSettings.js b/packages/rocketchat-channel-settings/client/views/channelSettings.js index d207a2d7fb1f..09c868db0ccd 100644 --- a/packages/rocketchat-channel-settings/client/views/channelSettings.js +++ b/packages/rocketchat-channel-settings/client/views/channelSettings.js @@ -1,8 +1,8 @@ -/* globals popover */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; import { TAPi18n } from 'meteor/tap:i18n'; +import { popover } from 'meteor/rocketchat:ui'; import toastr from 'toastr'; import moment from 'moment'; import s from 'underscore.string'; diff --git a/packages/rocketchat-channel-settings/package.js b/packages/rocketchat-channel-settings/package.js index 24d436c97e47..3ce10ab02904 100644 --- a/packages/rocketchat-channel-settings/package.js +++ b/packages/rocketchat-channel-settings/package.js @@ -12,6 +12,7 @@ Package.onUse(function(api) { 'tracker', 'templating', 'rocketchat:lib', + 'rocketchat:ui', ]); api.addFiles('client/stylesheets/channel-settings.css', 'client'); api.mainModule('client/index.js', 'client'); diff --git a/packages/rocketchat-custom-oauth/client/custom_oauth_client.js b/packages/rocketchat-custom-oauth/client/custom_oauth_client.js index bf2fa7ab3064..da6abfeada4f 100644 --- a/packages/rocketchat-custom-oauth/client/custom_oauth_client.js +++ b/packages/rocketchat-custom-oauth/client/custom_oauth_client.js @@ -1,8 +1,8 @@ -/* globals OAuth*/ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; import { Random } from 'meteor/random'; +import { OAuth } from 'meteor/oauth'; import s from 'underscore.string'; // Request custom OAuth credentials for the user diff --git a/packages/rocketchat-custom-oauth/server/custom_oauth_server.js b/packages/rocketchat-custom-oauth/server/custom_oauth_server.js index 75c82b1a8d79..7e4ef1e84509 100644 --- a/packages/rocketchat-custom-oauth/server/custom_oauth_server.js +++ b/packages/rocketchat-custom-oauth/server/custom_oauth_server.js @@ -1,7 +1,7 @@ -/* globals OAuth*/ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Accounts } from 'meteor/accounts-base'; +import { OAuth } from 'meteor/oauth'; import { HTTP } from 'meteor/http'; import _ from 'underscore'; diff --git a/packages/rocketchat-e2e/client/accountEncryption.js b/packages/rocketchat-e2e/client/accountEncryption.js index 9b09ebbf6d41..4b25397a90af 100644 --- a/packages/rocketchat-e2e/client/accountEncryption.js +++ b/packages/rocketchat-e2e/client/accountEncryption.js @@ -1,4 +1,6 @@ -/* globals Template, t, ReactiveVar */ + +import { Template } from 'meteor/templating'; +import { ReactiveVar } from 'meteor/reactive-var'; import toastr from 'toastr'; import s from 'underscore.string'; import { RocketChat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-e2e/client/rocketchat.e2e.js b/packages/rocketchat-e2e/client/rocketchat.e2e.js index ae8059af9401..2ef8992bd0ab 100644 --- a/packages/rocketchat-e2e/client/rocketchat.e2e.js +++ b/packages/rocketchat-e2e/client/rocketchat.e2e.js @@ -1,4 +1,3 @@ -/* globals alerts, modal */ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; import { ReactiveVar } from 'meteor/reactive-var'; diff --git a/packages/rocketchat-e2e/package.js b/packages/rocketchat-e2e/package.js index f3f89020c5be..2626854b6ddd 100644 --- a/packages/rocketchat-e2e/package.js +++ b/packages/rocketchat-e2e/package.js @@ -1,5 +1,3 @@ -/* globals Package: false */ - Package.describe({ name: 'rocketchat:e2e', version: '0.0.1', diff --git a/packages/rocketchat-emoji/client/keyboardFix.js b/packages/rocketchat-emoji/client/keyboardFix.js index c50f6bc2485b..7f65426c2d33 100644 --- a/packages/rocketchat-emoji/client/keyboardFix.js +++ b/packages/rocketchat-emoji/client/keyboardFix.js @@ -1,4 +1,3 @@ -/* global device */ import { Meteor } from 'meteor/meteor'; import { RocketChat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js b/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js index 0ad23ff54dbd..534ebeef82bb 100644 --- a/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js +++ b/packages/rocketchat-file-upload/client/lib/fileUploadHandler.js @@ -1,8 +1,8 @@ -/* globals FileUploadBase, UploadFS, fileUploadHandler:true */ -/* exported fileUploadHandler */ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; import { Tracker } from 'meteor/tracker'; +import { UploadFS } from 'meteor/jalik:ufs'; +import { FileUploadBase } from '../../lib/FileUploadBase'; new UploadFS.Store({ collection: RocketChat.models.Uploads.model, diff --git a/packages/rocketchat-file-upload/globalFileRestrictions.js b/packages/rocketchat-file-upload/globalFileRestrictions.js index 677202d1dba5..0cda9fb97626 100644 --- a/packages/rocketchat-file-upload/globalFileRestrictions.js +++ b/packages/rocketchat-file-upload/globalFileRestrictions.js @@ -1,6 +1,6 @@ -/* globals Slingshot */ import { Meteor } from 'meteor/meteor'; import { TAPi18n } from 'meteor/tap:i18n'; +import { Slingshot } from 'meteor/edgee:slingshot'; import filesize from 'filesize'; diff --git a/packages/rocketchat-file-upload/lib/FileUpload.js b/packages/rocketchat-file-upload/lib/FileUpload.js index 86508e369e52..50974ed99be8 100644 --- a/packages/rocketchat-file-upload/lib/FileUpload.js +++ b/packages/rocketchat-file-upload/lib/FileUpload.js @@ -1,5 +1,3 @@ -/* globals FileUpload:true */ -/* exported FileUpload */ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { TAPi18n } from 'meteor/tap:i18n'; diff --git a/packages/rocketchat-file-upload/lib/FileUploadBase.js b/packages/rocketchat-file-upload/lib/FileUploadBase.js index 0327222401b6..cf60ae02d2d4 100644 --- a/packages/rocketchat-file-upload/lib/FileUploadBase.js +++ b/packages/rocketchat-file-upload/lib/FileUploadBase.js @@ -1,7 +1,6 @@ -/* globals FileUploadBase:true, UploadFS */ -/* exported FileUploadBase */ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; +import { UploadFS } from 'meteor/jalik:ufs'; import _ from 'underscore'; UploadFS.config.defaultStorePermissions = new UploadFS.StorePermissions({ @@ -35,7 +34,7 @@ UploadFS.config.defaultStorePermissions = new UploadFS.StorePermissions({ }); -FileUploadBase = class FileUploadBase { +export class FileUploadBase { constructor(store, meta, file) { this.id = Random.id(); this.meta = meta; diff --git a/packages/rocketchat-file-upload/package.js b/packages/rocketchat-file-upload/package.js index 26bec0342c39..a027ba7285ee 100644 --- a/packages/rocketchat-file-upload/package.js +++ b/packages/rocketchat-file-upload/package.js @@ -1,4 +1,3 @@ -/* globals Package */ Package.describe({ name: 'rocketchat:file-upload', version: '0.0.1', diff --git a/packages/rocketchat-file-upload/server/config/AmazonS3.js b/packages/rocketchat-file-upload/server/config/AmazonS3.js index ec8b5d220036..1b03831f2384 100644 --- a/packages/rocketchat-file-upload/server/config/AmazonS3.js +++ b/packages/rocketchat-file-upload/server/config/AmazonS3.js @@ -1,5 +1,3 @@ -/* globals FileUpload */ - import _ from 'underscore'; import { FileUploadClass } from '../lib/FileUpload'; import '../../ufs/AmazonS3/server.js'; diff --git a/packages/rocketchat-file-upload/server/config/FileSystem.js b/packages/rocketchat-file-upload/server/config/FileSystem.js index d0e74e5f29d1..36933d93ade3 100644 --- a/packages/rocketchat-file-upload/server/config/FileSystem.js +++ b/packages/rocketchat-file-upload/server/config/FileSystem.js @@ -1,6 +1,5 @@ -/* globals FileUpload, UploadFS */ - import { Meteor } from 'meteor/meteor'; +import { UploadFS } from 'meteor/jalik:ufs'; import _ from 'underscore'; import fs from 'fs'; import { FileUploadClass } from '../lib/FileUpload'; diff --git a/packages/rocketchat-file-upload/server/config/GoogleStorage.js b/packages/rocketchat-file-upload/server/config/GoogleStorage.js index 1491b335c324..f0a20fc7db36 100644 --- a/packages/rocketchat-file-upload/server/config/GoogleStorage.js +++ b/packages/rocketchat-file-upload/server/config/GoogleStorage.js @@ -1,5 +1,3 @@ -/* globals FileUpload */ - import _ from 'underscore'; import { FileUploadClass } from '../lib/FileUpload'; import '../../ufs/GoogleStorage/server.js'; diff --git a/packages/rocketchat-file-upload/server/config/GridFS.js b/packages/rocketchat-file-upload/server/config/GridFS.js index cb001e0737af..4a6adfe55ea2 100644 --- a/packages/rocketchat-file-upload/server/config/GridFS.js +++ b/packages/rocketchat-file-upload/server/config/GridFS.js @@ -1,4 +1,4 @@ -/* globals FileUpload, UploadFS */ +import { UploadFS } from 'meteor/jalik:ufs'; import stream from 'stream'; import zlib from 'zlib'; import util from 'util'; diff --git a/packages/rocketchat-file-upload/server/config/Slingshot_DEPRECATED.js b/packages/rocketchat-file-upload/server/config/Slingshot_DEPRECATED.js index 2a7539bb17c8..bcb130c8fa67 100644 --- a/packages/rocketchat-file-upload/server/config/Slingshot_DEPRECATED.js +++ b/packages/rocketchat-file-upload/server/config/Slingshot_DEPRECATED.js @@ -1,6 +1,6 @@ -/* globals Slingshot, FileUpload */ import _ from 'underscore'; import { Random } from 'meteor/random'; +import { Slingshot } from 'meteor/edgee:slingshot'; const configureSlingshot = _.debounce(() => { const type = RocketChat.settings.get('FileUpload_Storage_Type'); diff --git a/packages/rocketchat-file-upload/server/config/Webdav.js b/packages/rocketchat-file-upload/server/config/Webdav.js index 9fda1473702f..bc29c284f360 100644 --- a/packages/rocketchat-file-upload/server/config/Webdav.js +++ b/packages/rocketchat-file-upload/server/config/Webdav.js @@ -1,5 +1,3 @@ -/* globals FileUpload */ - import _ from 'underscore'; import { FileUploadClass } from '../lib/FileUpload'; import '../../ufs/Webdav/server.js'; diff --git a/packages/rocketchat-file-upload/server/config/_configUploadStorage.js b/packages/rocketchat-file-upload/server/config/_configUploadStorage.js index 44b0587a0740..b85f2c91a689 100644 --- a/packages/rocketchat-file-upload/server/config/_configUploadStorage.js +++ b/packages/rocketchat-file-upload/server/config/_configUploadStorage.js @@ -1,5 +1,4 @@ -/* globals UploadFS */ - +import { UploadFS } from 'meteor/jalik:ufs'; import _ from 'underscore'; import './AmazonS3.js'; import './FileSystem.js'; diff --git a/packages/rocketchat-file-upload/server/lib/FileUpload.js b/packages/rocketchat-file-upload/server/lib/FileUpload.js index 064970ab1666..88fa990759eb 100644 --- a/packages/rocketchat-file-upload/server/lib/FileUpload.js +++ b/packages/rocketchat-file-upload/server/lib/FileUpload.js @@ -1,5 +1,3 @@ -/* globals UploadFS */ - import { Meteor } from 'meteor/meteor'; import fs from 'fs'; import stream from 'stream'; @@ -7,6 +5,7 @@ import mime from 'mime-type/with-db'; import Future from 'fibers/future'; import sharp from 'sharp'; import { Cookies } from 'meteor/ostrio:cookies'; +import { UploadFS } from 'meteor/jalik:ufs'; const cookie = new Cookies(); diff --git a/packages/rocketchat-file-upload/server/lib/proxy.js b/packages/rocketchat-file-upload/server/lib/proxy.js index 83653bd43a24..da8637cdfb99 100644 --- a/packages/rocketchat-file-upload/server/lib/proxy.js +++ b/packages/rocketchat-file-upload/server/lib/proxy.js @@ -1,7 +1,7 @@ -/* globals UploadFS, InstanceStatus */ - import { Meteor } from 'meteor/meteor'; import { WebApp } from 'meteor/webapp'; +import { UploadFS } from 'meteor/jalik:ufs'; +import { InstanceStatus } from 'meteor/konecty:multiple-instances-status'; import http from 'http'; import URL from 'url'; diff --git a/packages/rocketchat-file-upload/server/lib/requests.js b/packages/rocketchat-file-upload/server/lib/requests.js index 1324891569b6..cac712ca25a1 100644 --- a/packages/rocketchat-file-upload/server/lib/requests.js +++ b/packages/rocketchat-file-upload/server/lib/requests.js @@ -1,6 +1,5 @@ -/* globals FileUpload, WebApp */ - import { Meteor } from 'meteor/meteor'; +import { WebApp } from 'meteor/webapp'; WebApp.connectHandlers.use('/file-upload/', function(req, res, next) { diff --git a/packages/rocketchat-file-upload/server/methods/getS3FileUrl.js b/packages/rocketchat-file-upload/server/methods/getS3FileUrl.js index 86bd8b7fbc1f..d104a60eca5c 100644 --- a/packages/rocketchat-file-upload/server/methods/getS3FileUrl.js +++ b/packages/rocketchat-file-upload/server/methods/getS3FileUrl.js @@ -1,5 +1,5 @@ -/* globals UploadFS */ import { Meteor } from 'meteor/meteor'; +import { UploadFS } from 'meteor/jalik:ufs'; let protectedFiles; diff --git a/packages/rocketchat-iframe-login/client/iframe_client.js b/packages/rocketchat-iframe-login/client/iframe_client.js index ae80309896ce..19825a9ba837 100644 --- a/packages/rocketchat-iframe-login/client/iframe_client.js +++ b/packages/rocketchat-iframe-login/client/iframe_client.js @@ -1,4 +1,3 @@ -/* globals facebookConnectPlugin, TwitterConnect */ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { RocketChat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-internal-hubot/server/hubot.js b/packages/rocketchat-internal-hubot/server/hubot.js index 5fa518092f7c..3c6fd1499ae9 100644 --- a/packages/rocketchat-internal-hubot/server/hubot.js +++ b/packages/rocketchat-internal-hubot/server/hubot.js @@ -1,4 +1,3 @@ -/* globals __meteor_bootstrap__ */ import { Meteor } from 'meteor/meteor'; import { RocketChat } from 'meteor/rocketchat:lib'; import _ from 'underscore'; diff --git a/packages/rocketchat-lib/client/lib/openRoom.js b/packages/rocketchat-lib/client/lib/openRoom.js index b7550a9ab1f4..c12383cd87c0 100644 --- a/packages/rocketchat-lib/client/lib/openRoom.js +++ b/packages/rocketchat-lib/client/lib/openRoom.js @@ -1,4 +1,4 @@ -/* globals fireGlobalEvent readMessage currentTracker*/ +/* globals fireGlobalEvent currentTracker*/ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; diff --git a/packages/rocketchat-ui/client/lib/avatar.js b/packages/rocketchat-ui/client/lib/avatar.js index 5c7f6378bca8..6ff52065450a 100644 --- a/packages/rocketchat-ui/client/lib/avatar.js +++ b/packages/rocketchat-ui/client/lib/avatar.js @@ -24,7 +24,7 @@ this.getAvatarAsPng = function(username, cb) { }; }; -this.updateAvatarOfUsername = function(username) { +updateAvatarOfUsername = function(username) { //eslint-disable-line const key = `avatar_random_${ username }`; Session.set(key, Math.round(Math.random() * 1000)); diff --git a/packages/rocketchat-ui/client/lib/collections.js b/packages/rocketchat-ui/client/lib/collections.js index 51f9638a2d51..bcf54ee71119 100644 --- a/packages/rocketchat-ui/client/lib/collections.js +++ b/packages/rocketchat-ui/client/lib/collections.js @@ -7,8 +7,8 @@ ChatMessage = new Mongo.Collection(null); //eslint-disable-line this.CachedChatRoom = new RocketChat.CachedCollection({ name: 'rooms' }); ChatRoom = this.CachedChatRoom.collection; -this.CachedChatSubscription = new RocketChat.CachedCollection({ name: 'subscriptions' }); -ChatSubscription = this.CachedChatSubscription.collection; //eslint-disable-line +CachedChatSubscription = new RocketChat.CachedCollection({ name: 'subscriptions' }); //eslint-disable-line +ChatSubscription = CachedChatSubscription.collection; //eslint-disable-line UserRoles = new Mongo.Collection(null); //eslint-disable-line RoomRoles = new Mongo.Collection(null); //eslint-disable-line this.UserAndRoom = new Mongo.Collection(null); @@ -24,7 +24,7 @@ Meteor.startup(() => { Tracker.autorun(() => { if (!Meteor.userId() && RocketChat.settings.get('Accounts_AllowAnonymousRead') === true) { this.CachedChatRoom.init(); - this.CachedChatSubscription.ready.set(true); + CachedChatSubscription.ready.set(true); //eslint-disable-line } }); }); diff --git a/packages/rocketchat-ui/client/lib/fileUpload.js b/packages/rocketchat-ui/client/lib/fileUpload.js index bf9dc1669254..d4adfd3327d3 100644 --- a/packages/rocketchat-ui/client/lib/fileUpload.js +++ b/packages/rocketchat-ui/client/lib/fileUpload.js @@ -1,9 +1,10 @@ -/* globals fileUploadHandler, Handlebars, fileUpload, modal, t */ +/* globals Handlebars, fileUpload, modal, t */ /* exported fileUpload */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { Session } from 'meteor/session'; import s from 'underscore.string'; +import { fileUploadHandler } from 'meteor/rocketchat:file-upload'; const readAsDataURL = (file, callback) => { const reader = new FileReader(); diff --git a/packages/rocketchat-ui/client/lib/readMessages.js b/packages/rocketchat-ui/client/lib/readMessages.js index b35db6edb2d2..c002f3754809 100644 --- a/packages/rocketchat-ui/client/lib/readMessages.js +++ b/packages/rocketchat-ui/client/lib/readMessages.js @@ -15,7 +15,7 @@ import _ from 'underscore'; // window.addEventListener 'focus', -> // readMessage.refreshUnreadMark(undefined, true) -const readMessage = new class { +readMessage = new class { constructor() { this.debug = false; this.callbacks = []; @@ -211,5 +211,3 @@ Meteor.startup(function() { } }); }); -export { readMessage }; -this.readMessage = readMessage; diff --git a/packages/rocketchat-ui/package.js b/packages/rocketchat-ui/package.js index f36d5d225924..ac46fd441ea6 100644 --- a/packages/rocketchat-ui/package.js +++ b/packages/rocketchat-ui/package.js @@ -27,6 +27,7 @@ Package.onUse(function(api) { 'rocketchat:lazy-load', 'rocketchat:e2e', 'mizzao:autocomplete', + 'rocketchat:file-upload', ]); api.use('kadira:flow-router', 'client'); @@ -168,4 +169,7 @@ Package.onUse(function(api) { api.export('alerts', 'client'); api.export('AccountBox', 'client'); api.export('chatMessages', 'client'); + api.export('CachedChatSubscription', 'client'); + api.export('readMessage', 'client'); + api.export('updateAvatarOfUsername', 'client'); }); From 88689ec090c7ac28bbca7690e190ccf710dd3acb Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Tue, 18 Dec 2018 16:29:53 -0200 Subject: [PATCH 2/6] Fix lint --- packages/rocketchat-e2e/.eslintrc | 4 ---- packages/rocketchat-file-upload/lib/FileUploadBase.js | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 packages/rocketchat-e2e/.eslintrc diff --git a/packages/rocketchat-e2e/.eslintrc b/packages/rocketchat-e2e/.eslintrc deleted file mode 100644 index 625a0007ef14..000000000000 --- a/packages/rocketchat-e2e/.eslintrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": ["@rocket.chat/eslint-config"], - "root": true -} diff --git a/packages/rocketchat-file-upload/lib/FileUploadBase.js b/packages/rocketchat-file-upload/lib/FileUploadBase.js index cf60ae02d2d4..28e2d3cc5302 100644 --- a/packages/rocketchat-file-upload/lib/FileUploadBase.js +++ b/packages/rocketchat-file-upload/lib/FileUploadBase.js @@ -76,4 +76,4 @@ export class FileUploadBase { stop() { return this.handler.stop(); } -}; +} From 23160109851b72169d42a3795126538ee8f3e1a0 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Tue, 18 Dec 2018 20:58:43 -0200 Subject: [PATCH 3/6] Remove /* globals */ wave 2 --- .eslintrc | 7 +++++++ packages/rocketchat-file-upload/package.js | 1 + packages/rocketchat-lib/client/MessageAction.js | 1 - packages/rocketchat-lib/client/OAuthProxy.js | 2 +- packages/rocketchat-lib/client/lib/openRoom.js | 3 +-- packages/rocketchat-lib/client/lib/roomExit.js | 2 +- packages/rocketchat-lib/client/lib/roomTypes.js | 1 - packages/rocketchat-lib/client/lib/settings.js | 3 +-- packages/rocketchat-lib/client/lib/userRoles.js | 1 - packages/rocketchat-lib/lib/RoomTypesCommon.js | 1 - packages/rocketchat-lib/lib/roomTypes/direct.js | 1 - packages/rocketchat-lib/lib/roomTypes/private.js | 1 - packages/rocketchat-lib/lib/roomTypes/public.js | 1 - .../rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.js | 2 +- packages/rocketchat-lib/package.js | 4 ++++ packages/rocketchat-lib/server/functions/createRoom.js | 1 - packages/rocketchat-lib/server/functions/deleteMessage.js | 1 - .../rocketchat-lib/server/functions/getFullUserData.js | 1 - .../server/functions/getRoomByNameOrIdWithOptionToJoin.js | 1 - packages/rocketchat-lib/server/functions/saveUser.js | 3 ++- packages/rocketchat-lib/server/functions/setUsername.js | 1 - packages/rocketchat-lib/server/lib/PushNotification.js | 3 ++- packages/rocketchat-lib/server/lib/RateLimiter.js | 2 +- packages/rocketchat-lib/server/lib/configLogger.js | 2 +- packages/rocketchat-lib/server/lib/debug.js | 2 +- packages/rocketchat-lib/server/methods/cleanRoomHistory.js | 1 - packages/rocketchat-lib/server/models/Avatars.js | 2 +- packages/rocketchat-lib/server/models/Uploads.js | 2 +- packages/rocketchat-lib/server/models/_BaseDb.js | 3 +-- packages/rocketchat-lib/server/oauth/google.js | 2 +- packages/rocketchat-lib/server/oauth/proxy.js | 2 +- .../rocketchat-lib/server/startup/oAuthServicesUpdate.js | 2 +- .../server/startup/settingsOnLoadCdnPrefix.js | 2 +- 33 files changed, 31 insertions(+), 33 deletions(-) diff --git a/.eslintrc b/.eslintrc index ea923ee84d23..636ca719e250 100644 --- a/.eslintrc +++ b/.eslintrc @@ -10,6 +10,7 @@ "Assets" : false, "ChatMessage" : false, "ChatMessages" : false, + "chatMessages" : false, "ChatRoom" : false, "ChatSubscription" : false, "cordova" : false, @@ -17,22 +18,28 @@ "facebookConnectPlugin" : false, "FileUpload" : false, "fileUploadHandler" : false, + "fireGlobalEvent" : false, "handleError" : false, "getAvatarUrlFromUsername" : false, + "getAvatarSuggestionForUser" : false, "Logger" : false, "modal" : false, "menu" : false, "Npm" : false, + "openRoom" : false, "Package" : false, "readMessage" : false, "RocketChat" : true, + "roomExit" : true, "RoomHistoryManager" : false, "RoomManager" : false, + "RoomRoles" : false, "Settings" : false, "SideNav" : false, "t" : false, "toastr" : false, "TwitterConnect" : false, + "UserRoles" : false, "VideoRecorder" : false, "VRecDialog" : false } diff --git a/packages/rocketchat-file-upload/package.js b/packages/rocketchat-file-upload/package.js index a027ba7285ee..2a0ed2811e6d 100644 --- a/packages/rocketchat-file-upload/package.js +++ b/packages/rocketchat-file-upload/package.js @@ -19,6 +19,7 @@ Package.onUse(function(api) { api.use('accounts-base'); api.use('tracker'); api.use('webapp'); + api.use('konecty:multiple-instances-status'); api.use('rocketchat:e2e'); api.addFiles('globalFileRestrictions.js'); diff --git a/packages/rocketchat-lib/client/MessageAction.js b/packages/rocketchat-lib/client/MessageAction.js index 0548b33e7ce5..92257e842cce 100644 --- a/packages/rocketchat-lib/client/MessageAction.js +++ b/packages/rocketchat-lib/client/MessageAction.js @@ -1,4 +1,3 @@ -/* globals chatMessages cordova */ import { Meteor } from 'meteor/meteor'; import { TAPi18n } from 'meteor/tap:i18n'; import { ReactiveVar } from 'meteor/reactive-var'; diff --git a/packages/rocketchat-lib/client/OAuthProxy.js b/packages/rocketchat-lib/client/OAuthProxy.js index b5c36676b0bb..a923d3dded88 100644 --- a/packages/rocketchat-lib/client/OAuthProxy.js +++ b/packages/rocketchat-lib/client/OAuthProxy.js @@ -1,5 +1,5 @@ -/* globals OAuth */ import _ from 'underscore'; +import { OAuth } from 'meteor/oauth'; OAuth.launchLogin = _.wrap(OAuth.launchLogin, function(func, options) { const proxy = RocketChat.settings.get('Accounts_OAuth_Proxy_services').replace(/\s/g, '').split(','); diff --git a/packages/rocketchat-lib/client/lib/openRoom.js b/packages/rocketchat-lib/client/lib/openRoom.js index c12383cd87c0..56e766bb1506 100644 --- a/packages/rocketchat-lib/client/lib/openRoom.js +++ b/packages/rocketchat-lib/client/lib/openRoom.js @@ -1,4 +1,3 @@ -/* globals fireGlobalEvent currentTracker*/ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; @@ -6,7 +5,7 @@ import { BlazeLayout } from 'meteor/kadira:blaze-layout'; import { Session } from 'meteor/session'; import _ from 'underscore'; -currentTracker = undefined; +export let currentTracker = undefined; openRoom = function(type, name) { // eslint-disable-line Session.set('openedRoom', null); diff --git a/packages/rocketchat-lib/client/lib/roomExit.js b/packages/rocketchat-lib/client/lib/roomExit.js index c6daea088cd4..fabf375a6769 100644 --- a/packages/rocketchat-lib/client/lib/roomExit.js +++ b/packages/rocketchat-lib/client/lib/roomExit.js @@ -1,6 +1,6 @@ -/* globals currentTracker */ import { Blaze } from 'meteor/blaze'; import { BlazeLayout } from 'meteor/kadira:blaze-layout'; +import { currentTracker } from './openRoom'; this.roomExit = function() { // 7370 - Close flex-tab when opening a room on mobile UI diff --git a/packages/rocketchat-lib/client/lib/roomTypes.js b/packages/rocketchat-lib/client/lib/roomTypes.js index e2a39a360484..9201d9bba291 100644 --- a/packages/rocketchat-lib/client/lib/roomTypes.js +++ b/packages/rocketchat-lib/client/lib/roomTypes.js @@ -49,7 +49,6 @@ RocketChat.roomTypes = new class RocketChatRoomTypes extends RoomTypesCommon { if (!user) { return room && room.ro; } - /* globals RoomRoles */ const userOwner = RoomRoles.findOne({ rid: roomId, 'u._id': user._id, diff --git a/packages/rocketchat-lib/client/lib/settings.js b/packages/rocketchat-lib/client/lib/settings.js index 7516f5aef277..07697e94bb10 100644 --- a/packages/rocketchat-lib/client/lib/settings.js +++ b/packages/rocketchat-lib/client/lib/settings.js @@ -1,13 +1,12 @@ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; +import { ReactiveDict } from 'meteor/reactive-dict'; /* * RocketChat.settings holds all packages settings * @namespace RocketChat.settings */ -/* globals ReactiveDict*/ - RocketChat.settings.cachedCollection = new RocketChat.CachedCollection({ name: 'public-settings', eventType: 'onAll', diff --git a/packages/rocketchat-lib/client/lib/userRoles.js b/packages/rocketchat-lib/client/lib/userRoles.js index 11a1380aeb63..e9af46a219d2 100644 --- a/packages/rocketchat-lib/client/lib/userRoles.js +++ b/packages/rocketchat-lib/client/lib/userRoles.js @@ -1,4 +1,3 @@ -/* globals UserRoles, RoomRoles */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; diff --git a/packages/rocketchat-lib/lib/RoomTypesCommon.js b/packages/rocketchat-lib/lib/RoomTypesCommon.js index e80c0f90464a..ee17d5bbb858 100644 --- a/packages/rocketchat-lib/lib/RoomTypesCommon.js +++ b/packages/rocketchat-lib/lib/RoomTypesCommon.js @@ -1,4 +1,3 @@ -/* globals roomExit */ import { Meteor } from 'meteor/meteor'; import { RoomTypeConfig } from './RoomTypeConfig'; import { FlowRouter } from 'meteor/kadira:flow-router'; diff --git a/packages/rocketchat-lib/lib/roomTypes/direct.js b/packages/rocketchat-lib/lib/roomTypes/direct.js index b3d201578181..be171722811c 100644 --- a/packages/rocketchat-lib/lib/roomTypes/direct.js +++ b/packages/rocketchat-lib/lib/roomTypes/direct.js @@ -1,4 +1,3 @@ -/* globals openRoom */ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; import { RoomTypeConfig, RoomTypeRouteConfig, RoomSettingsEnum, UiTextContext } from '../RoomTypeConfig'; diff --git a/packages/rocketchat-lib/lib/roomTypes/private.js b/packages/rocketchat-lib/lib/roomTypes/private.js index 9b86b2d17abc..c41443215004 100644 --- a/packages/rocketchat-lib/lib/roomTypes/private.js +++ b/packages/rocketchat-lib/lib/roomTypes/private.js @@ -1,4 +1,3 @@ -/* globals openRoom */ import { Meteor } from 'meteor/meteor'; import { RoomSettingsEnum, RoomTypeConfig, RoomTypeRouteConfig, UiTextContext } from '../RoomTypeConfig'; diff --git a/packages/rocketchat-lib/lib/roomTypes/public.js b/packages/rocketchat-lib/lib/roomTypes/public.js index 5168415c1b39..493496dfd7ee 100644 --- a/packages/rocketchat-lib/lib/roomTypes/public.js +++ b/packages/rocketchat-lib/lib/roomTypes/public.js @@ -1,4 +1,3 @@ -/* globals openRoom */ import { Meteor } from 'meteor/meteor'; import { RoomTypeConfig, RoomTypeRouteConfig, RoomSettingsEnum, UiTextContext } from '../RoomTypeConfig'; diff --git a/packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.js b/packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.js index 70c6d78cb6f0..7d6aa29034a5 100644 --- a/packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.js +++ b/packages/rocketchat-lib/lib/startup/settingsOnLoadSiteUrl.js @@ -1,5 +1,5 @@ -/* globals WebAppInternals */ import { Meteor } from 'meteor/meteor'; +import { WebAppInternals } from 'meteor/webapp'; RocketChat.settings.get('Site_Url', function(key, value) { if (value == null || value.trim() === '') { diff --git a/packages/rocketchat-lib/package.js b/packages/rocketchat-lib/package.js index 782066489ad9..ec59039597b8 100644 --- a/packages/rocketchat-lib/package.js +++ b/packages/rocketchat-lib/package.js @@ -14,8 +14,10 @@ Package.onUse(function(api) { api.use('accounts-base'); api.use('ecmascript'); api.use('random'); + api.use('google-oauth'); api.use('check'); api.use('tracker'); + api.use('jparker:gravatar'); api.use('ddp-rate-limiter'); api.use('mongo'); api.use('oauth'); @@ -31,7 +33,9 @@ Package.onUse(function(api) { api.use('rocketchat:mailer'); api.use('mizzao:timesync'); api.use('rocketchat:custom-oauth'); + api.use('konecty:multiple-instances-status'); api.use('rocketchat:file'); + api.use('rocketchat:push'); api.use('rocketchat:authorization', { unordered: true }); api.use('rocketchat:push-notifications', { unordered: true }); diff --git a/packages/rocketchat-lib/server/functions/createRoom.js b/packages/rocketchat-lib/server/functions/createRoom.js index 532b2e8c0ea7..f901eb3e1b24 100644 --- a/packages/rocketchat-lib/server/functions/createRoom.js +++ b/packages/rocketchat-lib/server/functions/createRoom.js @@ -1,4 +1,3 @@ -/* globals RocketChat */ import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-lib/server/functions/deleteMessage.js b/packages/rocketchat-lib/server/functions/deleteMessage.js index 27a576d4141b..0f04f99cc519 100644 --- a/packages/rocketchat-lib/server/functions/deleteMessage.js +++ b/packages/rocketchat-lib/server/functions/deleteMessage.js @@ -1,4 +1,3 @@ -/* globals FileUpload */ import { Meteor } from 'meteor/meteor'; RocketChat.deleteMessage = function(message, user) { diff --git a/packages/rocketchat-lib/server/functions/getFullUserData.js b/packages/rocketchat-lib/server/functions/getFullUserData.js index 352ca6e24e7f..a9ba2d99ffec 100644 --- a/packages/rocketchat-lib/server/functions/getFullUserData.js +++ b/packages/rocketchat-lib/server/functions/getFullUserData.js @@ -1,4 +1,3 @@ -/* globals RocketChat */ import s from 'underscore.string'; const logger = new Logger('getFullUserData'); diff --git a/packages/rocketchat-lib/server/functions/getRoomByNameOrIdWithOptionToJoin.js b/packages/rocketchat-lib/server/functions/getRoomByNameOrIdWithOptionToJoin.js index 4ccf99191686..89a88f11ad53 100644 --- a/packages/rocketchat-lib/server/functions/getRoomByNameOrIdWithOptionToJoin.js +++ b/packages/rocketchat-lib/server/functions/getRoomByNameOrIdWithOptionToJoin.js @@ -1,4 +1,3 @@ -/* globals RocketChat */ import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; diff --git a/packages/rocketchat-lib/server/functions/saveUser.js b/packages/rocketchat-lib/server/functions/saveUser.js index 7d6fbf9f5f64..b997f0f512d9 100644 --- a/packages/rocketchat-lib/server/functions/saveUser.js +++ b/packages/rocketchat-lib/server/functions/saveUser.js @@ -1,9 +1,10 @@ -/* globals Gravatar */ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; import _ from 'underscore'; import s from 'underscore.string'; import * as Mailer from 'meteor/rocketchat:mailer'; +import { Gravatar } from 'meteor/jparker:gravatar'; + let html = ''; Meteor.startup(() => { Mailer.getTemplate('Accounts_UserAddedEmail_Email', (template) => { diff --git a/packages/rocketchat-lib/server/functions/setUsername.js b/packages/rocketchat-lib/server/functions/setUsername.js index 109a7f4e6ecd..bada501f6649 100644 --- a/packages/rocketchat-lib/server/functions/setUsername.js +++ b/packages/rocketchat-lib/server/functions/setUsername.js @@ -37,7 +37,6 @@ RocketChat._setUsername = function(userId, u) { } // Set new username* RocketChat.models.Users.setUsername(user._id, username); - /* globals getAvatarSuggestionForUser */ user.username = username; if (!previousUsername && RocketChat.settings.get('Accounts_SetDefaultAvatar') === true) { const avatarSuggestions = getAvatarSuggestionForUser(user); diff --git a/packages/rocketchat-lib/server/lib/PushNotification.js b/packages/rocketchat-lib/server/lib/PushNotification.js index 24255e03b26f..fea610a53521 100644 --- a/packages/rocketchat-lib/server/lib/PushNotification.js +++ b/packages/rocketchat-lib/server/lib/PushNotification.js @@ -1,4 +1,5 @@ -/* globals Push */ +import { Push } from 'meteor/rocketchat:push'; + class PushNotification { getNotificationId(roomId) { const serverId = RocketChat.settings.get('uniqueID'); diff --git a/packages/rocketchat-lib/server/lib/RateLimiter.js b/packages/rocketchat-lib/server/lib/RateLimiter.js index 001ad9d57eef..dcbb7ce5a0c1 100644 --- a/packages/rocketchat-lib/server/lib/RateLimiter.js +++ b/packages/rocketchat-lib/server/lib/RateLimiter.js @@ -1,6 +1,6 @@ -/* globals RateLimiter */ import { Meteor } from 'meteor/meteor'; import { DDPRateLimiter } from 'meteor/ddp-rate-limiter'; +import { RateLimiter } from 'meteor/rate-limit'; import _ from 'underscore'; RocketChat.RateLimiter = new class { diff --git a/packages/rocketchat-lib/server/lib/configLogger.js b/packages/rocketchat-lib/server/lib/configLogger.js index b0d2fef6170c..e8d79ffe7b25 100644 --- a/packages/rocketchat-lib/server/lib/configLogger.js +++ b/packages/rocketchat-lib/server/lib/configLogger.js @@ -1,5 +1,5 @@ -/* globals LoggerManager */ import { Meteor } from 'meteor/meteor'; +import { LoggerManager } from 'meteor/rocketchat:logger'; RocketChat.settings.get('Log_Package', function(key, value) { return LoggerManager.showPackage = value; diff --git a/packages/rocketchat-lib/server/lib/debug.js b/packages/rocketchat-lib/server/lib/debug.js index 35e8a92989d3..712a34d25608 100644 --- a/packages/rocketchat-lib/server/lib/debug.js +++ b/packages/rocketchat-lib/server/lib/debug.js @@ -1,6 +1,6 @@ -/* global InstanceStatus */ import { Meteor } from 'meteor/meteor'; import { WebApp } from 'meteor/webapp'; +import { InstanceStatus } from 'meteor/konecty:multiple-instances-status'; import _ from 'underscore'; const logger = new Logger('Meteor', { diff --git a/packages/rocketchat-lib/server/methods/cleanRoomHistory.js b/packages/rocketchat-lib/server/methods/cleanRoomHistory.js index 506091149fc6..b93cf480fa48 100644 --- a/packages/rocketchat-lib/server/methods/cleanRoomHistory.js +++ b/packages/rocketchat-lib/server/methods/cleanRoomHistory.js @@ -1,4 +1,3 @@ -/* globals FileUpload */ import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; diff --git a/packages/rocketchat-lib/server/models/Avatars.js b/packages/rocketchat-lib/server/models/Avatars.js index 732c7c352320..b056909215cb 100644 --- a/packages/rocketchat-lib/server/models/Avatars.js +++ b/packages/rocketchat-lib/server/models/Avatars.js @@ -1,6 +1,6 @@ -/* globals InstanceStatus */ import _ from 'underscore'; import s from 'underscore.string'; +import { InstanceStatus } from 'meteor/konecty:multiple-instances-status'; RocketChat.models.Avatars = new class extends RocketChat.models._Base { constructor() { diff --git a/packages/rocketchat-lib/server/models/Uploads.js b/packages/rocketchat-lib/server/models/Uploads.js index 3030d4283d31..e25823640caf 100644 --- a/packages/rocketchat-lib/server/models/Uploads.js +++ b/packages/rocketchat-lib/server/models/Uploads.js @@ -1,6 +1,6 @@ -/* globals InstanceStatus */ import _ from 'underscore'; import s from 'underscore.string'; +import { InstanceStatus } from 'meteor/konecty:multiple-instances-status'; RocketChat.models.Uploads = new class extends RocketChat.models._Base { constructor() { diff --git a/packages/rocketchat-lib/server/models/_BaseDb.js b/packages/rocketchat-lib/server/models/_BaseDb.js index ede844222268..4b739f8a1bf1 100644 --- a/packages/rocketchat-lib/server/models/_BaseDb.js +++ b/packages/rocketchat-lib/server/models/_BaseDb.js @@ -1,6 +1,5 @@ -/* globals MongoInternals */ import { Match } from 'meteor/check'; -import { Mongo } from 'meteor/mongo'; +import { Mongo, MongoInternals } from 'meteor/mongo'; import _ from 'underscore'; const baseName = 'rocketchat_'; diff --git a/packages/rocketchat-lib/server/oauth/google.js b/packages/rocketchat-lib/server/oauth/google.js index 7da5f80d4f59..cdb50a05daed 100644 --- a/packages/rocketchat-lib/server/oauth/google.js +++ b/packages/rocketchat-lib/server/oauth/google.js @@ -1,7 +1,7 @@ -/* globals Google */ import { Match, check } from 'meteor/check'; import _ from 'underscore'; import { HTTP } from 'meteor/http'; +import { Google } from 'meteor/google-oauth'; function getIdentity(accessToken) { try { diff --git a/packages/rocketchat-lib/server/oauth/proxy.js b/packages/rocketchat-lib/server/oauth/proxy.js index 8886aabba8a0..7770f8fbc13e 100644 --- a/packages/rocketchat-lib/server/oauth/proxy.js +++ b/packages/rocketchat-lib/server/oauth/proxy.js @@ -1,5 +1,5 @@ -/* globals OAuth */ import _ from 'underscore'; +import { OAuth } from 'meteor/oauth'; OAuth._redirectUri = _.wrap(OAuth._redirectUri, function(func, serviceName, ...args) { const proxy = RocketChat.settings.get('Accounts_OAuth_Proxy_services').replace(/\s/g, '').split(','); diff --git a/packages/rocketchat-lib/server/startup/oAuthServicesUpdate.js b/packages/rocketchat-lib/server/startup/oAuthServicesUpdate.js index cc375ffffee0..7bff4f149603 100644 --- a/packages/rocketchat-lib/server/startup/oAuthServicesUpdate.js +++ b/packages/rocketchat-lib/server/startup/oAuthServicesUpdate.js @@ -1,6 +1,6 @@ -/* globals CustomOAuth */ import { Meteor } from 'meteor/meteor'; import { ServiceConfiguration } from 'meteor/service-configuration'; +import { CustomOAuth } from 'meteor/rocketchat:custom-oauth'; import _ from 'underscore'; const logger = new Logger('rocketchat:lib', { diff --git a/packages/rocketchat-lib/server/startup/settingsOnLoadCdnPrefix.js b/packages/rocketchat-lib/server/startup/settingsOnLoadCdnPrefix.js index 8e3ada873bb7..bf8c2bbc9a52 100644 --- a/packages/rocketchat-lib/server/startup/settingsOnLoadCdnPrefix.js +++ b/packages/rocketchat-lib/server/startup/settingsOnLoadCdnPrefix.js @@ -1,5 +1,5 @@ -/* globals WebAppInternals*/ import { Meteor } from 'meteor/meteor'; +import { WebAppInternals } from 'meteor/webapp'; import _ from 'underscore'; function testWebAppInternals(fn) { From 7f5bf8986023f8528309393308f4f808527bb474 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Wed, 19 Dec 2018 17:17:54 -0200 Subject: [PATCH 4/6] remove-globals-wave-3 --- .eslintrc | 15 ++++++++++++++- .../rocketchat-livechat/assets/rocket-livechat.js | 2 -- .../client/views/app/livechatAppearance.js | 1 - packages/rocketchat-message-snippet/package.js | 1 - .../rocketchat-reactions/server/setReaction.js | 1 - .../rocketchat-search/client/search/search.js | 3 ++- .../server/service/providerService.js | 3 +-- .../server/slackbridge_import.server.js | 1 - .../client/tabs/inviteUsers.js | 3 ++- packages/rocketchat-ui-login/client/login/form.js | 1 - packages/rocketchat-ui-master/client/main.js | 1 - packages/rocketchat-ui-master/server/inject.js | 2 +- packages/rocketchat-ui-message/client/message.js | 2 +- .../rocketchat-ui-message/client/messageBox.js | 1 - .../client/popup/messagePopup.js | 1 - .../popup/messagePopupSlashCommandPreview.js | 1 - .../client/startup/messageBoxActions.js | 1 - packages/rocketchat-ui-sidenav/client/roomList.js | 3 +-- packages/rocketchat-ui-sidenav/client/sideNav.js | 2 -- .../rocketchat-ui-sidenav/client/sidebarHeader.js | 2 +- .../rocketchat-ui-sidenav/client/sidebarItem.js | 3 +-- packages/rocketchat-ui-sidenav/client/sortlist.js | 2 +- packages/rocketchat-ui-sidenav/client/toolbar.js | 2 -- .../client/components/header/header.js | 1 - packages/rocketchat-ui/client/components/icon.js | 1 - packages/rocketchat-ui/client/lib/avatar.js | 2 +- packages/rocketchat-ui/client/lib/chatMessages.js | 2 -- .../client/lib/codeMirror/codeMirrorComponent.js | 3 +-- .../client/lib/cordova/facebook-login.js | 2 +- .../client/lib/cordova/keyboard-fix.js | 1 - packages/rocketchat-ui/client/lib/cordova/push.js | 2 +- .../client/lib/cordova/user-state.js | 2 +- packages/rocketchat-ui/client/lib/fileUpload.js | 5 ++--- packages/rocketchat-ui/client/lib/menu.js | 1 - packages/rocketchat-ui/client/lib/notification.js | 2 +- .../client/lib/recorderjs/audioRecorder.js | 3 +-- packages/rocketchat-ui/package.js | 1 + 37 files changed, 35 insertions(+), 47 deletions(-) diff --git a/.eslintrc b/.eslintrc index 3990ce906197..8b34f20d191e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -8,6 +8,7 @@ "alerts" : false, "Apps" : false, "Assets" : false, + "CachedChatSubscription" : false, "ChatMessage" : false, "ChatMessages" : false, "chatMessages" : false, @@ -15,29 +16,41 @@ "ChatSubscription" : false, "cordova" : false, "device" : false, - "facebookConnectPlugin" : false, + "DynamicCss" : false, + "facebookConnectPlugin" : false, "FileUpload" : false, "fileUploadHandler" : false, "fireGlobalEvent" : false, "handleError" : false, "getAvatarUrlFromUsername" : false, "getAvatarSuggestionForUser" : false, + "isChrome" : false, + "isFirefox" : false, + "isRtl" : false, + "jscolor" : false, + "KonchatNotification" : false, "Logger" : false, + "msgStream" : false, + "MsgTyping" : false, "modal" : false, "menu" : false, "Npm" : false, "openRoom" : false, + "OnePassword" : false, "Package" : false, + "popover" : false, "readMessage" : false, "RocketChat" : true, "roomExit" : true, "RoomHistoryManager" : false, "RoomManager" : false, "RoomRoles" : false, + "Servers" : false, "Settings" : false, "SideNav" : false, "t" : false, "toastr" : false, + "toolbarSearch" : false, "TwitterConnect" : false, "UserRoles" : false, "VideoRecorder" : false, diff --git a/packages/rocketchat-livechat/assets/rocket-livechat.js b/packages/rocketchat-livechat/assets/rocket-livechat.js index 6d61b917dabb..09620b8baefd 100644 --- a/packages/rocketchat-livechat/assets/rocket-livechat.js +++ b/packages/rocketchat-livechat/assets/rocket-livechat.js @@ -472,8 +472,6 @@ } }(this || {})); -/* globals EventEmitter */ - (function(w) { w.RocketChat = w.RocketChat || { _: [] }; var config = {}; diff --git a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js index 3019a1a5686e..1a6356db4e37 100644 --- a/packages/rocketchat-livechat/client/views/app/livechatAppearance.js +++ b/packages/rocketchat-livechat/client/views/app/livechatAppearance.js @@ -1,4 +1,3 @@ -/* globals jscolor */ /* eslint new-cap: ["error", { "newIsCapExceptions": ["jscolor"] }]*/ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; diff --git a/packages/rocketchat-message-snippet/package.js b/packages/rocketchat-message-snippet/package.js index 4de3d9a55861..563daf7638de 100644 --- a/packages/rocketchat-message-snippet/package.js +++ b/packages/rocketchat-message-snippet/package.js @@ -1,4 +1,3 @@ -/* globals Package */ Package.describe({ name: 'rocketchat:message-snippet', version: '0.0.1', diff --git a/packages/rocketchat-reactions/server/setReaction.js b/packages/rocketchat-reactions/server/setReaction.js index 26a8d5dc0c59..b090cd559b21 100644 --- a/packages/rocketchat-reactions/server/setReaction.js +++ b/packages/rocketchat-reactions/server/setReaction.js @@ -1,4 +1,3 @@ -/* global msgStream */ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; import { TAPi18n } from 'meteor/tap:i18n'; diff --git a/packages/rocketchat-search/client/search/search.js b/packages/rocketchat-search/client/search/search.js index 3238c2c6ccd5..22be63831ccc 100644 --- a/packages/rocketchat-search/client/search/search.js +++ b/packages/rocketchat-search/client/search/search.js @@ -1,7 +1,8 @@ -/* globals ReactiveVar, TAPi18n */ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { ReactiveVar } from 'meteor/reactive-var'; +import { TAPi18n } from 'meteor/tap:i18n'; import toastr from 'toastr'; import _ from 'underscore'; diff --git a/packages/rocketchat-search/server/service/providerService.js b/packages/rocketchat-search/server/service/providerService.js index 78d893f092eb..64590845ac15 100644 --- a/packages/rocketchat-search/server/service/providerService.js +++ b/packages/rocketchat-search/server/service/providerService.js @@ -1,7 +1,6 @@ -/* globals RocketChat */ import { Meteor } from 'meteor/meteor'; +import { RocketChat } from 'meteor/rocketchat:lib'; import _ from 'underscore'; - import { validationService } from '../service/validationService'; import SearchLogger from '../logger/logger'; diff --git a/packages/rocketchat-slackbridge/server/slackbridge_import.server.js b/packages/rocketchat-slackbridge/server/slackbridge_import.server.js index bdf3602d1551..2b869e0e32da 100644 --- a/packages/rocketchat-slackbridge/server/slackbridge_import.server.js +++ b/packages/rocketchat-slackbridge/server/slackbridge_import.server.js @@ -1,4 +1,3 @@ -/* globals msgStream */ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { Random } from 'meteor/random'; diff --git a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js index 00e35f7787e5..0391f5d3181e 100644 --- a/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js +++ b/packages/rocketchat-ui-flextab/client/tabs/inviteUsers.js @@ -6,6 +6,7 @@ import { Template } from 'meteor/templating'; import { AutoComplete } from 'meteor/mizzao:autocomplete'; import { RocketChat } from 'meteor/rocketchat:lib'; import { t } from 'meteor/rocketchat:ui'; +import { Deps } from 'meteor/deps'; import toastr from 'toastr'; const acEvents = { @@ -124,7 +125,7 @@ Template.inviteUsers.onRendered(function() { users.set(usersArr); }); }); -/* global Deps */ + Template.inviteUsers.onCreated(function() { this.selectedUsers = new ReactiveVar([]); const filter = { exceptions :[Meteor.user().username].concat(this.selectedUsers.get().map((u) => u.username)) }; diff --git a/packages/rocketchat-ui-login/client/login/form.js b/packages/rocketchat-ui-login/client/login/form.js index 6a91957a98d0..86e1c30ebed7 100644 --- a/packages/rocketchat-ui-login/client/login/form.js +++ b/packages/rocketchat-ui-login/client/login/form.js @@ -1,4 +1,3 @@ -/* globals OnePassword, device */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Tracker } from 'meteor/tracker'; diff --git a/packages/rocketchat-ui-master/client/main.js b/packages/rocketchat-ui-master/client/main.js index b3e542c30449..459e5508b538 100644 --- a/packages/rocketchat-ui-master/client/main.js +++ b/packages/rocketchat-ui-master/client/main.js @@ -1,4 +1,3 @@ -/* globals toolbarSearch, menu, fireGlobalEvent, CachedChatSubscription, DynamicCss, popover */ import { Meteor } from 'meteor/meteor'; import { Match } from 'meteor/check'; import { ReactiveVar } from 'meteor/reactive-var'; diff --git a/packages/rocketchat-ui-master/server/inject.js b/packages/rocketchat-ui-master/server/inject.js index fffa2d89526e..1ef0717440fd 100644 --- a/packages/rocketchat-ui-master/server/inject.js +++ b/packages/rocketchat-ui-master/server/inject.js @@ -1,5 +1,5 @@ -/* globals Inject */ import { Meteor } from 'meteor/meteor'; +import { Inject } from 'meteor/meteorhacks:inject-initial'; import _ from 'underscore'; import s from 'underscore.string'; diff --git a/packages/rocketchat-ui-message/client/message.js b/packages/rocketchat-ui-message/client/message.js index 4acd3f952ffd..fb1b63a914d3 100644 --- a/packages/rocketchat-ui-message/client/message.js +++ b/packages/rocketchat-ui-message/client/message.js @@ -9,6 +9,7 @@ import { DateFormat } from 'meteor/rocketchat:lib'; import { renderEmoji } from 'meteor/rocketchat:emoji'; import { renderMessageBody } from './renderMessageBody'; import { RocketChat } from 'meteor/rocketchat:lib'; +import { RoomRoles, UserRoles } from 'meteor/rocketchat:ui'; import { t } from 'meteor/rocketchat:ui'; async function renderPdfToCanvas(canvasId, pdfLink) { @@ -92,7 +93,6 @@ Template.message.helpers({ if (!this.u || !this.u._id) { return []; } - /* globals UserRoles RoomRoles */ const userRoles = UserRoles.findOne(this.u._id); const roomRoles = RoomRoles.findOne({ 'u._id': this.u._id, diff --git a/packages/rocketchat-ui-message/client/messageBox.js b/packages/rocketchat-ui-message/client/messageBox.js index 9f5b68d6926c..f8b7a76b9f57 100644 --- a/packages/rocketchat-ui-message/client/messageBox.js +++ b/packages/rocketchat-ui-message/client/messageBox.js @@ -229,7 +229,6 @@ Template.messageBox.helpers({ }, }; }, - /* globals MsgTyping*/ usersTyping() { const maxUsernames = 4; const users = MsgTyping.get(this._id); diff --git a/packages/rocketchat-ui-message/client/popup/messagePopup.js b/packages/rocketchat-ui-message/client/popup/messagePopup.js index 27f89fadc0fc..4a109515b84d 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopup.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopup.js @@ -1,4 +1,3 @@ -/* globals toolbarSearch */ // This is not supposed to be a complete list // it is just to improve readability in this file diff --git a/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js b/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js index dc7693954d80..d59fd6a382d0 100644 --- a/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js +++ b/packages/rocketchat-ui-message/client/popup/messagePopupSlashCommandPreview.js @@ -1,4 +1,3 @@ -/* global toolbarSearch */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; diff --git a/packages/rocketchat-ui-message/client/startup/messageBoxActions.js b/packages/rocketchat-ui-message/client/startup/messageBoxActions.js index d99a94614863..1dac2185a4d3 100644 --- a/packages/rocketchat-ui-message/client/startup/messageBoxActions.js +++ b/packages/rocketchat-ui-message/client/startup/messageBoxActions.js @@ -1,4 +1,3 @@ -/* globals device */ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; import mime from 'mime-type/with-db'; diff --git a/packages/rocketchat-ui-sidenav/client/roomList.js b/packages/rocketchat-ui-sidenav/client/roomList.js index 558eff571379..6b77ce7e35d0 100644 --- a/packages/rocketchat-ui-sidenav/client/roomList.js +++ b/packages/rocketchat-ui-sidenav/client/roomList.js @@ -1,6 +1,5 @@ -/* globals RocketChat */ import { Meteor } from 'meteor/meteor'; -import { UiTextContext } from 'meteor/rocketchat:lib'; +import { RocketChat, UiTextContext } from 'meteor/rocketchat:lib'; import { Template } from 'meteor/templating'; Template.roomList.helpers({ diff --git a/packages/rocketchat-ui-sidenav/client/sideNav.js b/packages/rocketchat-ui-sidenav/client/sideNav.js index 0474135186ad..15400b520be7 100644 --- a/packages/rocketchat-ui-sidenav/client/sideNav.js +++ b/packages/rocketchat-ui-sidenav/client/sideNav.js @@ -4,8 +4,6 @@ import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; -/* globals menu*/ - Template.sideNav.helpers({ flexTemplate() { return SideNav.getFlex().template; diff --git a/packages/rocketchat-ui-sidenav/client/sidebarHeader.js b/packages/rocketchat-ui-sidenav/client/sidebarHeader.js index 88f87cb2cae0..4c540e7b1906 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarHeader.js +++ b/packages/rocketchat-ui-sidenav/client/sidebarHeader.js @@ -1,8 +1,8 @@ -/* globals popover menu */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; +import { popover } from 'meteor/rocketchat:ui'; const setStatus = (status) => { AccountBox.setStatus(status); diff --git a/packages/rocketchat-ui-sidenav/client/sidebarItem.js b/packages/rocketchat-ui-sidenav/client/sidebarItem.js index 0fcdb1c8eccc..8aa05be9ca74 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarItem.js +++ b/packages/rocketchat-ui-sidenav/client/sidebarItem.js @@ -1,11 +1,10 @@ -/* globals menu popover */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; import moment from 'moment'; import { renderMessageBody } from 'meteor/rocketchat:ui-message'; - +import { popover } from 'meteor/rocketchat:ui'; Template.sidebarItem.helpers({ or(...args) { diff --git a/packages/rocketchat-ui-sidenav/client/sortlist.js b/packages/rocketchat-ui-sidenav/client/sortlist.js index fc381364b3e4..899093c82405 100644 --- a/packages/rocketchat-ui-sidenav/client/sortlist.js +++ b/packages/rocketchat-ui-sidenav/client/sortlist.js @@ -1,6 +1,6 @@ -/* globals popover */ import { Meteor } from 'meteor/meteor'; import { Template } from 'meteor/templating'; +import { popover } from 'meteor/rocketchat:ui'; const checked = function(prop, field) { const userId = Meteor.userId(); diff --git a/packages/rocketchat-ui-sidenav/client/toolbar.js b/packages/rocketchat-ui-sidenav/client/toolbar.js index 026f4bee1079..6bd7d26a8a92 100644 --- a/packages/rocketchat-ui-sidenav/client/toolbar.js +++ b/packages/rocketchat-ui-sidenav/client/toolbar.js @@ -1,5 +1,3 @@ -/* global menu, toolbarSearch */ - import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { ReactiveVar } from 'meteor/reactive-var'; diff --git a/packages/rocketchat-ui/client/components/header/header.js b/packages/rocketchat-ui/client/components/header/header.js index e2a1fd576a36..b21fbed5410a 100644 --- a/packages/rocketchat-ui/client/components/header/header.js +++ b/packages/rocketchat-ui/client/components/header/header.js @@ -1,4 +1,3 @@ -/* globals fireGlobalEvent*/ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; diff --git a/packages/rocketchat-ui/client/components/icon.js b/packages/rocketchat-ui/client/components/icon.js index bf942d44cd1e..ca728b0d4e76 100644 --- a/packages/rocketchat-ui/client/components/icon.js +++ b/packages/rocketchat-ui/client/components/icon.js @@ -1,4 +1,3 @@ -/* globals isFirefox, isChrome */ import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; diff --git a/packages/rocketchat-ui/client/lib/avatar.js b/packages/rocketchat-ui/client/lib/avatar.js index 6ff52065450a..43eaede3db41 100644 --- a/packages/rocketchat-ui/client/lib/avatar.js +++ b/packages/rocketchat-ui/client/lib/avatar.js @@ -3,7 +3,7 @@ import { Session } from 'meteor/session'; Blaze.registerHelper('avatarUrlFromUsername', getAvatarUrlFromUsername); -this.getAvatarAsPng = function(username, cb) { +export const getAvatarAsPng = function(username, cb) { const image = new Image; image.src = getAvatarUrlFromUsername(username); image.onload = function() { diff --git a/packages/rocketchat-ui/client/lib/chatMessages.js b/packages/rocketchat-ui/client/lib/chatMessages.js index e0e53e20238b..629c913d135b 100644 --- a/packages/rocketchat-ui/client/lib/chatMessages.js +++ b/packages/rocketchat-ui/client/lib/chatMessages.js @@ -1,4 +1,3 @@ -/* globals MsgTyping */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; @@ -195,7 +194,6 @@ ChatMessages = class ChatMessages { //eslint-disable-line this.editing.saved = this.input.value; return this.editing.savedCursor = this.input.selectionEnd; } - /* globals readMessage KonchatNotification */ /** * * @param {string} rim room ID * * @param {Element} input DOM element diff --git a/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js b/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js index 193a5a8a209a..60cd4ab84eff 100644 --- a/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js +++ b/packages/rocketchat-ui/client/lib/codeMirror/codeMirrorComponent.js @@ -1,5 +1,4 @@ -/* global CodeMirrors */ -CodeMirrors = {}; +const CodeMirrors = {}; import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; diff --git a/packages/rocketchat-ui/client/lib/cordova/facebook-login.js b/packages/rocketchat-ui/client/lib/cordova/facebook-login.js index 32cf7486acfc..0677892ae34c 100644 --- a/packages/rocketchat-ui/client/lib/cordova/facebook-login.js +++ b/packages/rocketchat-ui/client/lib/cordova/facebook-login.js @@ -1,6 +1,6 @@ -/* globals facebookConnectPlugin Facebook*/ import { Meteor } from 'meteor/meteor'; import { Accounts } from 'meteor/accounts-base'; +import { Facebook } from 'meteor/facebook-oauth'; Meteor.loginWithFacebookCordova = function(options, callback) { if (!callback && typeof options === 'function') { diff --git a/packages/rocketchat-ui/client/lib/cordova/keyboard-fix.js b/packages/rocketchat-ui/client/lib/cordova/keyboard-fix.js index 1f29da562996..95b5344f32a6 100644 --- a/packages/rocketchat-ui/client/lib/cordova/keyboard-fix.js +++ b/packages/rocketchat-ui/client/lib/cordova/keyboard-fix.js @@ -1,4 +1,3 @@ -/* globals device cordova*/ import { Meteor } from 'meteor/meteor'; if (Meteor.isCordova) { diff --git a/packages/rocketchat-ui/client/lib/cordova/push.js b/packages/rocketchat-ui/client/lib/cordova/push.js index d3f8b02b88ba..dbb098ab7bf4 100644 --- a/packages/rocketchat-ui/client/lib/cordova/push.js +++ b/packages/rocketchat-ui/client/lib/cordova/push.js @@ -1,7 +1,7 @@ -/* globals Push Servers*/ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { FlowRouter } from 'meteor/kadira:flow-router'; +import { Push } from 'meteor/rocketchat:push'; if (Meteor.isCordova) { // Push.addListener 'token', (token) -> diff --git a/packages/rocketchat-ui/client/lib/cordova/user-state.js b/packages/rocketchat-ui/client/lib/cordova/user-state.js index db4762e0f4e5..a7dd9d0892f9 100644 --- a/packages/rocketchat-ui/client/lib/cordova/user-state.js +++ b/packages/rocketchat-ui/client/lib/cordova/user-state.js @@ -1,5 +1,5 @@ -/* globals UserPresence, readMessage */ import { Meteor } from 'meteor/meteor'; +import { UserPresence } from 'meteor/konecty:user-presence'; import _ from 'underscore'; let timer = undefined; diff --git a/packages/rocketchat-ui/client/lib/fileUpload.js b/packages/rocketchat-ui/client/lib/fileUpload.js index d4adfd3327d3..b0d48defee7d 100644 --- a/packages/rocketchat-ui/client/lib/fileUpload.js +++ b/packages/rocketchat-ui/client/lib/fileUpload.js @@ -1,10 +1,9 @@ -/* globals Handlebars, fileUpload, modal, t */ -/* exported fileUpload */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { Session } from 'meteor/session'; import s from 'underscore.string'; import { fileUploadHandler } from 'meteor/rocketchat:file-upload'; +import { Handlebars } from 'meteor/ui'; const readAsDataURL = (file, callback) => { const reader = new FileReader(); @@ -135,7 +134,7 @@ const getUploadPreview = async(file, preview) => { return getGenericUploadPreview(file, preview); }; -fileUpload = async(files) => { +fileUpload = async(files) => { //eslint-disable-line files = [].concat(files); const roomId = Session.get('openedRoom'); diff --git a/packages/rocketchat-ui/client/lib/menu.js b/packages/rocketchat-ui/client/lib/menu.js index 2ebabfd3f197..80a5c38791a0 100644 --- a/packages/rocketchat-ui/client/lib/menu.js +++ b/packages/rocketchat-ui/client/lib/menu.js @@ -18,7 +18,6 @@ window.addEventListener('resize', _.debounce((() => { }; })(), 100)); -/* globals isRtl */ this.menu = new class extends EventEmitter { constructor() { super(); diff --git a/packages/rocketchat-ui/client/lib/notification.js b/packages/rocketchat-ui/client/lib/notification.js index 0baca53d0b2e..45bbb61d84c9 100644 --- a/packages/rocketchat-ui/client/lib/notification.js +++ b/packages/rocketchat-ui/client/lib/notification.js @@ -8,6 +8,7 @@ import { Session } from 'meteor/session'; import _ from 'underscore'; import s from 'underscore.string'; import { e2e } from 'meteor/rocketchat:e2e'; +import { getAvatarAsPng } from './avatar'; KonchatNotification = { //eslint-disable-line notificationStatus: new ReactiveVar, @@ -85,7 +86,6 @@ KonchatNotification = { //eslint-disable-line } } - /* globals getAvatarAsPng*/ return getAvatarAsPng(notification.payload.sender.username, function(avatarAsPng) { notification.icon = avatarAsPng; return KonchatNotification.notify(notification); //eslint-disable-line diff --git a/packages/rocketchat-ui/client/lib/recorderjs/audioRecorder.js b/packages/rocketchat-ui/client/lib/recorderjs/audioRecorder.js index 24b3955da678..aae356ec0d7a 100644 --- a/packages/rocketchat-ui/client/lib/recorderjs/audioRecorder.js +++ b/packages/rocketchat-ui/client/lib/recorderjs/audioRecorder.js @@ -1,4 +1,3 @@ -/* globals Recorder */ AudioRecorder = new class { //eslint-disable-line start(cb) { window.AudioContext = window.AudioContext || window.webkitAudioContext; @@ -26,7 +25,7 @@ AudioRecorder = new class { //eslint-disable-line startUserMedia(stream) { this.stream = stream; const input = window.audioContext.createMediaStreamSource(stream); - this.recorder = new Recorder(input, { + this.recorder = new window.Recorder(input, { workerPath: 'mp3-realtime-worker.js', numChannels: 1, }); diff --git a/packages/rocketchat-ui/package.js b/packages/rocketchat-ui/package.js index ac46fd441ea6..1d7bff405e88 100644 --- a/packages/rocketchat-ui/package.js +++ b/packages/rocketchat-ui/package.js @@ -28,6 +28,7 @@ Package.onUse(function(api) { 'rocketchat:e2e', 'mizzao:autocomplete', 'rocketchat:file-upload', + 'konecty:user-presence', ]); api.use('kadira:flow-router', 'client'); From a7712b1bca161c2c54085dd7a473fb792a8e3e78 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Wed, 19 Dec 2018 19:23:37 -0200 Subject: [PATCH 5/6] Remove /* globals */ wave 4 --- .eslintrc | 6 ++++++ packages/rocketchat-ui/client/lib/RoomHistoryManager.js | 1 - packages/rocketchat-ui/client/lib/RoomManager.js | 3 +-- packages/rocketchat-ui/client/lib/collections.js | 6 +++--- packages/rocketchat-ui/client/lib/rocket.js | 1 - packages/rocketchat-ui/client/views/app/alerts.js | 3 +-- packages/rocketchat-ui/client/views/app/modal.js | 1 - packages/rocketchat-ui/client/views/app/popover.js | 1 - packages/rocketchat-ui/client/views/app/room.js | 4 +--- packages/rocketchat-ui/client/views/app/secretURL.js | 1 - .../client/views/app/videoCall/videoButtons.js | 2 +- .../rocketchat-ui/client/views/app/videoCall/videoCall.js | 2 +- packages/rocketchat-ui/package.js | 1 + .../rocketchat-videobridge/client/views/videoFlexTab.js | 1 - packages/rocketchat-webrtc/client/WebRTCClass.js | 2 +- packages/rocketchat-webrtc/client/screenShare.js | 3 +-- packages/tap-i18n/lib/globals.js | 1 - packages/tap-i18n/lib/plugin/etc/language_names.js | 1 - packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js | 1 - server/lib/cordova.js | 2 +- server/methods/deleteFileMessage.js | 2 +- server/methods/eraseRoom.js | 2 +- server/methods/getAvatarSuggestion.js | 2 +- server/methods/getUsernameSuggestion.js | 2 +- server/methods/ignoreUser.js | 2 +- server/startup/avatar.js | 2 +- server/startup/cron.js | 3 ++- server/startup/migrations/v002.js | 2 +- server/startup/migrations/v007.js | 2 +- server/startup/presence.js | 4 +++- server/startup/serverRunning.js | 3 +-- server/stream/streamBroadcast.js | 4 ++-- 32 files changed, 34 insertions(+), 39 deletions(-) diff --git a/.eslintrc b/.eslintrc index cc352eef163a..2820e1f3a1f1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -14,24 +14,30 @@ "chatMessages" : false, "ChatRoom" : false, "ChatSubscription" : false, + "chrome" : false, "cordova" : false, "device" : false, "DynamicCss" : false, "facebookConnectPlugin" : false, "FileUpload" : false, + "fileUpload" : false, "fileUploadHandler" : false, "fireGlobalEvent" : false, "handleError" : false, "getAvatarUrlFromUsername" : false, "getAvatarSuggestionForUser" : false, + "globals" : true, "isChrome" : false, "isFirefox" : false, "isRtl" : false, + "JitsiMeetExternalAPI" : false, "jscolor" : false, "KonchatNotification" : false, + "language_names" : true, "msgStream" : false, "MsgTyping" : false, "modal" : false, + "Modernizr" : false, "menu" : false, "Npm" : false, "openRoom" : false, diff --git a/packages/rocketchat-ui/client/lib/RoomHistoryManager.js b/packages/rocketchat-ui/client/lib/RoomHistoryManager.js index 42bf22cfb42b..a3177c8fbcb2 100644 --- a/packages/rocketchat-ui/client/lib/RoomHistoryManager.js +++ b/packages/rocketchat-ui/client/lib/RoomHistoryManager.js @@ -1,4 +1,3 @@ -/* globals readMessage UserRoles RoomRoles*/ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Blaze } from 'meteor/blaze'; diff --git a/packages/rocketchat-ui/client/lib/RoomManager.js b/packages/rocketchat-ui/client/lib/RoomManager.js index 36426ca3391f..84c633b0e410 100644 --- a/packages/rocketchat-ui/client/lib/RoomManager.js +++ b/packages/rocketchat-ui/client/lib/RoomManager.js @@ -6,7 +6,7 @@ import { FlowRouter } from 'meteor/kadira:flow-router'; import { Template } from 'meteor/templating'; import _ from 'underscore'; import { upsertMessage } from './RoomHistoryManager'; - +import { CachedChatRoom } from './collections'; const maxRoomsOpen = parseInt(localStorage && localStorage.getItem('rc-maxRoomsOpen')) || 5 ; @@ -29,7 +29,6 @@ RoomManager = new function() { //eslint-disable-line const Dep = new Tracker.Dependency(); const Cls = class { static initClass() { - /* globals CachedChatRoom CachedChatSubscription */ this.prototype.openedRooms = openedRooms; this.prototype.onlineUsers = onlineUsers; this.prototype.computation = Tracker.autorun(() => { diff --git a/packages/rocketchat-ui/client/lib/collections.js b/packages/rocketchat-ui/client/lib/collections.js index bcf54ee71119..a57a9ceeaf98 100644 --- a/packages/rocketchat-ui/client/lib/collections.js +++ b/packages/rocketchat-ui/client/lib/collections.js @@ -4,8 +4,8 @@ import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; ChatMessage = new Mongo.Collection(null); //eslint-disable-line -this.CachedChatRoom = new RocketChat.CachedCollection({ name: 'rooms' }); -ChatRoom = this.CachedChatRoom.collection; +export const CachedChatRoom = new RocketChat.CachedCollection({ name: 'rooms' }); +ChatRoom = CachedChatRoom.collection; CachedChatSubscription = new RocketChat.CachedCollection({ name: 'subscriptions' }); //eslint-disable-line ChatSubscription = CachedChatSubscription.collection; //eslint-disable-line @@ -23,7 +23,7 @@ RocketChat.models.Messages = _.extend({}, RocketChat.models.Messages, ChatMessag Meteor.startup(() => { Tracker.autorun(() => { if (!Meteor.userId() && RocketChat.settings.get('Accounts_AllowAnonymousRead') === true) { - this.CachedChatRoom.init(); + CachedChatRoom.init(); CachedChatSubscription.ready.set(true); //eslint-disable-line } }); diff --git a/packages/rocketchat-ui/client/lib/rocket.js b/packages/rocketchat-ui/client/lib/rocket.js index 38321bdfd776..87e2679835bc 100644 --- a/packages/rocketchat-ui/client/lib/rocket.js +++ b/packages/rocketchat-ui/client/lib/rocket.js @@ -1,4 +1,3 @@ -/* globals Modernizr */ RocketChat.Login = (function() { function onClick(el) { const $el = $(el); diff --git a/packages/rocketchat-ui/client/views/app/alerts.js b/packages/rocketchat-ui/client/views/app/alerts.js index 7acb2ed6dd33..1ebe6e6609e4 100644 --- a/packages/rocketchat-ui/client/views/app/alerts.js +++ b/packages/rocketchat-ui/client/views/app/alerts.js @@ -1,8 +1,7 @@ -/* globals alerts */ import { Blaze } from 'meteor/blaze'; import { Template } from 'meteor/templating'; -alerts = { //eslint-disable-line +alerts = { renderedAlert: null, open(config) { this.close(false); diff --git a/packages/rocketchat-ui/client/views/app/modal.js b/packages/rocketchat-ui/client/views/app/modal.js index f20bffda3a35..481e8383ffc9 100644 --- a/packages/rocketchat-ui/client/views/app/modal.js +++ b/packages/rocketchat-ui/client/views/app/modal.js @@ -1,4 +1,3 @@ -/* globals modal */ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; import { Template } from 'meteor/templating'; diff --git a/packages/rocketchat-ui/client/views/app/popover.js b/packages/rocketchat-ui/client/views/app/popover.js index 1959125f764f..7c9cdab030eb 100644 --- a/packages/rocketchat-ui/client/views/app/popover.js +++ b/packages/rocketchat-ui/client/views/app/popover.js @@ -1,4 +1,3 @@ -/* globals popover isRtl */ import { Meteor } from 'meteor/meteor'; import { Blaze } from 'meteor/blaze'; import { FlowRouter } from 'meteor/kadira:flow-router'; diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index d56353a7732d..310f1d73ebf1 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -1,4 +1,3 @@ -/* globals chatMessages, fileUpload , fireGlobalEvent , cordova , readMessage , RoomRoles, popover , device */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Random } from 'meteor/random'; @@ -8,7 +7,7 @@ import { FlowRouter } from 'meteor/kadira:flow-router'; import { RocketChatTabBar } from 'meteor/rocketchat:lib'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; - +import { WebRTC } from 'meteor/rocketchat:webrtc'; import _ from 'underscore'; import moment from 'moment'; import mime from 'mime-type/with-db'; @@ -1114,7 +1113,6 @@ Template.room.onRendered(function() { }); wrapper.addEventListener('scroll', () => updateUnreadCount()); - /* globals WebRTC */ // salva a data da renderizaĆ§Ć£o para exibir alertas de novas mensagens $.data(this.firstNode, 'renderedAt', new Date); diff --git a/packages/rocketchat-ui/client/views/app/secretURL.js b/packages/rocketchat-ui/client/views/app/secretURL.js index 6a9e7cf89421..f8b1f3fc7091 100644 --- a/packages/rocketchat-ui/client/views/app/secretURL.js +++ b/packages/rocketchat-ui/client/views/app/secretURL.js @@ -1,4 +1,3 @@ -/* globals KonchatNotification */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router'; diff --git a/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js b/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js index f43a0fcad29d..6f8ed24b20e9 100644 --- a/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js +++ b/packages/rocketchat-ui/client/views/app/videoCall/videoButtons.js @@ -1,6 +1,6 @@ -/* globals WebRTC */ import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { WebRTC } from 'meteor/rocketchat:webrtc'; Template.videoButtons.helpers({ videoAvaliable() { diff --git a/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js b/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js index 3a76a2176b1d..00c4cb2163c2 100644 --- a/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js +++ b/packages/rocketchat-ui/client/views/app/videoCall/videoCall.js @@ -1,8 +1,8 @@ -/* globals WebRTC */ import { Meteor } from 'meteor/meteor'; import { ReactiveVar } from 'meteor/reactive-var'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; +import { WebRTC } from 'meteor/rocketchat:webrtc'; Template.videoCall.onCreated(function() { return this.mainVideo = new ReactiveVar('$auto'); diff --git a/packages/rocketchat-ui/package.js b/packages/rocketchat-ui/package.js index 1d7bff405e88..5d224c996dc1 100644 --- a/packages/rocketchat-ui/package.js +++ b/packages/rocketchat-ui/package.js @@ -29,6 +29,7 @@ Package.onUse(function(api) { 'mizzao:autocomplete', 'rocketchat:file-upload', 'konecty:user-presence', + 'rocketchat:webrtc', ]); api.use('kadira:flow-router', 'client'); diff --git a/packages/rocketchat-videobridge/client/views/videoFlexTab.js b/packages/rocketchat-videobridge/client/views/videoFlexTab.js index 4be20574d3e2..c0167281cf7d 100644 --- a/packages/rocketchat-videobridge/client/views/videoFlexTab.js +++ b/packages/rocketchat-videobridge/client/views/videoFlexTab.js @@ -1,5 +1,4 @@ /* eslint new-cap: [2, {"capIsNewExceptions": ["MD5"]}] */ -/* globals JitsiMeetExternalAPI */ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; diff --git a/packages/rocketchat-webrtc/client/WebRTCClass.js b/packages/rocketchat-webrtc/client/WebRTCClass.js index 604d27cd69e7..3bb61d24f4ff 100644 --- a/packages/rocketchat-webrtc/client/WebRTCClass.js +++ b/packages/rocketchat-webrtc/client/WebRTCClass.js @@ -1,9 +1,9 @@ -/* globals chrome, ChromeScreenShare */ import { Meteor } from 'meteor/meteor'; import { Tracker } from 'meteor/tracker'; import { ReactiveVar } from 'meteor/reactive-var'; import { FlowRouter } from 'meteor/kadira:flow-router' ; import { TAPi18n } from 'meteor/tap:i18n'; +import { ChromeScreenShare } from './screenShare'; class WebRTCTransportClass { constructor(webrtcInstance) { diff --git a/packages/rocketchat-webrtc/client/screenShare.js b/packages/rocketchat-webrtc/client/screenShare.js index 4167f4dd0bd7..742599143db4 100644 --- a/packages/rocketchat-webrtc/client/screenShare.js +++ b/packages/rocketchat-webrtc/client/screenShare.js @@ -1,5 +1,4 @@ -/* globals ChromeScreenShare, fireGlobalEvent */ -this.ChromeScreenShare = { +export const ChromeScreenShare = { callbacks: {}, installed: false, init() { diff --git a/packages/tap-i18n/lib/globals.js b/packages/tap-i18n/lib/globals.js index e9c4edbe3a0a..637d36c8c3f6 100755 --- a/packages/tap-i18n/lib/globals.js +++ b/packages/tap-i18n/lib/globals.js @@ -2,7 +2,6 @@ // the client /* eslint no-unused-vars: 0 */ -/* globals globals: 1 */ globals = { fallback_language: 'en', diff --git a/packages/tap-i18n/lib/plugin/etc/language_names.js b/packages/tap-i18n/lib/plugin/etc/language_names.js index 7dfd07abb1f5..c55689742cb5 100755 --- a/packages/tap-i18n/lib/plugin/etc/language_names.js +++ b/packages/tap-i18n/lib/plugin/etc/language_names.js @@ -1,5 +1,4 @@ /* eslint no-unused-vars: 0 */ -/* globals language_names: 1 */ language_names = { af: ['Afrikaans', 'Afrikaans'], diff --git a/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js b/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js index a3417a2be076..e3a4deaa8843 100755 --- a/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js +++ b/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js @@ -1,2 +1 @@ -/* globals globals: 1 */ TAPi18next.init({ resStore: {}, fallbackLng: globals.fallback_language, useCookie: false }); // eslint-disable-line diff --git a/server/lib/cordova.js b/server/lib/cordova.js index 3e9ac8b2ec90..2eb5a33a0c0a 100644 --- a/server/lib/cordova.js +++ b/server/lib/cordova.js @@ -1,8 +1,8 @@ -/* global Push */ import { Meteor } from 'meteor/meteor'; import { HTTP } from 'meteor/http'; import { TAPi18n } from 'meteor/tap:i18n'; import { SystemLogger } from 'meteor/rocketchat:logger'; +import { Push } from 'meteor/rocketchat:push'; Meteor.methods({ // log() { diff --git a/server/methods/deleteFileMessage.js b/server/methods/deleteFileMessage.js index 3fdc4ca43d9d..6f033a295117 100644 --- a/server/methods/deleteFileMessage.js +++ b/server/methods/deleteFileMessage.js @@ -1,6 +1,6 @@ -/* global FileUpload */ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; +import { FileUpload } from 'meteor/rocketchat:file-upload'; Meteor.methods({ deleteFileMessage(fileID) { diff --git a/server/methods/eraseRoom.js b/server/methods/eraseRoom.js index b4f901643d2d..bdd9d8491d41 100644 --- a/server/methods/eraseRoom.js +++ b/server/methods/eraseRoom.js @@ -1,6 +1,6 @@ -/* globals RocketChat */ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; +import { RocketChat } from 'meteor/rocketchat:lib'; Meteor.methods({ eraseRoom(rid) { diff --git a/server/methods/getAvatarSuggestion.js b/server/methods/getAvatarSuggestion.js index 12cfcc2337a3..7b22428b96df 100644 --- a/server/methods/getAvatarSuggestion.js +++ b/server/methods/getAvatarSuggestion.js @@ -1,7 +1,7 @@ -/* global Gravatar */ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; import { HTTP } from 'meteor/http'; +import { Gravatar } from 'meteor/jparker:gravatar'; function getAvatarSuggestionForUser(user) { check(user, Object); diff --git a/server/methods/getUsernameSuggestion.js b/server/methods/getUsernameSuggestion.js index f7b2a0c5bf13..076bd08e0523 100644 --- a/server/methods/getUsernameSuggestion.js +++ b/server/methods/getUsernameSuggestion.js @@ -1,5 +1,5 @@ -/* global slugify */ import { Meteor } from 'meteor/meteor'; +import { slugify } from 'meteor/yasaricli:slugify'; function slug(text) { return slugify(text, '.').replace(/[^0-9a-z-_.]/g, ''); diff --git a/server/methods/ignoreUser.js b/server/methods/ignoreUser.js index ac171cdcbf48..a968b213e4eb 100644 --- a/server/methods/ignoreUser.js +++ b/server/methods/ignoreUser.js @@ -1,6 +1,6 @@ -/* globals RocketChat */ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; +import { RocketChat } from 'meteor/rocketchat:lib'; Meteor.methods({ ignoreUser({ rid, userId: ignoredUser, ignore = true }) { diff --git a/server/startup/avatar.js b/server/startup/avatar.js index f1e66b5408da..bb589e9aa38f 100644 --- a/server/startup/avatar.js +++ b/server/startup/avatar.js @@ -1,9 +1,9 @@ -/* globals FileUpload */ import { WebApp } from 'meteor/webapp'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import sharp from 'sharp'; import { Cookies } from 'meteor/ostrio:cookies'; +import { FileUpload } from 'meteor/rocketchat:file-upload'; const cookie = new Cookies(); diff --git a/server/startup/cron.js b/server/startup/cron.js index 49e251ffd965..a4b5130d6455 100644 --- a/server/startup/cron.js +++ b/server/startup/cron.js @@ -1,7 +1,8 @@ -/* global SyncedCron */ import { Meteor } from 'meteor/meteor'; import { HTTP } from 'meteor/http'; import { Logger } from 'meteor/rocketchat:logger'; +import { SyncedCron } from 'meteor/littledata:synced-cron'; + const logger = new Logger('SyncedCron'); SyncedCron.config({ diff --git a/server/startup/migrations/v002.js b/server/startup/migrations/v002.js index 1da3b03d453c..c9d8cdea99fa 100644 --- a/server/startup/migrations/v002.js +++ b/server/startup/migrations/v002.js @@ -1,5 +1,5 @@ -/* globals getAvatarSuggestionForUser */ import { RocketChatFile } from 'meteor/rocketchat:file'; + RocketChat.Migrations.add({ version: 2, up() { diff --git a/server/startup/migrations/v007.js b/server/startup/migrations/v007.js index 9e6342cd41cf..2a21bc87dfed 100644 --- a/server/startup/migrations/v007.js +++ b/server/startup/migrations/v007.js @@ -1,4 +1,4 @@ -/* globals OEmbed */ +import { OEmbed } from 'meteor/rocketchat:oembed'; import _ from 'underscore'; RocketChat.Migrations.add({ diff --git a/server/startup/presence.js b/server/startup/presence.js index 123aa2309625..1337059aa7ac 100644 --- a/server/startup/presence.js +++ b/server/startup/presence.js @@ -1,5 +1,7 @@ -/* globals InstanceStatus, UserPresence, UserPresenceMonitor */ import { Meteor } from 'meteor/meteor'; +import { InstanceStatus } from 'meteor/konecty:multiple-instances-status'; +import { UserPresence } from 'meteor/konecty:user-presence'; +import { UserPresenceMonitor } from 'meteor/konecty:user-presence'; Meteor.startup(function() { const instance = { diff --git a/server/startup/serverRunning.js b/server/startup/serverRunning.js index 12444d7d38c9..2d73b4985aa0 100644 --- a/server/startup/serverRunning.js +++ b/server/startup/serverRunning.js @@ -1,6 +1,5 @@ -/* globals MongoInternals */ - import { Meteor } from 'meteor/meteor'; +import { MongoInternals } from 'meteor/mongo'; import { SystemLogger } from 'meteor/rocketchat:logger'; import fs from 'fs'; import path from 'path'; diff --git a/server/stream/streamBroadcast.js b/server/stream/streamBroadcast.js index b0a8a68aeee1..68045b4d91e0 100644 --- a/server/stream/streamBroadcast.js +++ b/server/stream/streamBroadcast.js @@ -1,8 +1,8 @@ -/* global InstanceStatus, DDP */ - import { Meteor } from 'meteor/meteor'; +import { InstanceStatus } from 'meteor/konecty:multiple-instances-status'; import { check } from 'meteor/check'; import _ from 'underscore'; +import { DDP } from 'meteor/ddp'; import { DDPCommon } from 'meteor/ddp-common'; import { Logger, LoggerManager } from 'meteor/rocketchat:logger'; From a2b697af07076d9d6cadf7bd65a9c559cac337c2 Mon Sep 17 00:00:00 2001 From: Marcos Defendi Date: Wed, 19 Dec 2018 19:42:46 -0200 Subject: [PATCH 6/6] Remove some // eslint comments --- .eslintrc | 4 ++++ .scripts/version.js | 2 -- packages/rocketchat-grant/server/providers.js | 5 ++--- packages/rocketchat-lib/client/lib/openRoom.js | 6 +++--- .../rocketchat-lib/server/methods/saveSetting.js | 1 - .../server/methods/saveCustomField.js | 1 - .../rocketchat-livechat/server/methods/saveInfo.js | 1 - .../server/methods/saveSurveyFeedback.js | 1 - .../server/methods/startVideoCall.js | 1 - .../rocketchat-livechat/server/methods/transfer.js | 2 -- .../rocketchat-ui-sidenav/client/sidebarHeader.js | 4 ++-- .../rocketchat-ui/client/lib/RoomHistoryManager.js | 2 +- packages/rocketchat-ui/client/lib/RoomManager.js | 2 +- packages/rocketchat-ui/client/lib/accountBox.js | 2 +- packages/rocketchat-ui/client/lib/avatar.js | 3 +-- packages/rocketchat-ui/client/lib/chatMessages.js | 4 ++-- packages/rocketchat-ui/client/lib/collections.js | 14 +++++++------- packages/rocketchat-ui/client/lib/fileUpload.js | 2 +- packages/rocketchat-ui/client/lib/fireEvent.js | 2 +- packages/rocketchat-ui/client/lib/notification.js | 6 +++--- .../client/lib/recorderjs/audioRecorder.js | 2 +- packages/rocketchat-ui/client/lib/sideNav.js | 2 +- packages/rocketchat-ui/client/lib/tapi18n.js | 2 +- packages/rocketchat-ui/client/views/app/popout.js | 1 - packages/rocketchat-ui/client/views/app/popover.js | 2 +- packages/rocketchat-ui/client/views/app/room.js | 2 +- packages/rocketchat-ui/getAvatarUrlFromUsername.js | 2 +- .../client/views/videoFlexTab.js | 1 - .../client/views/videoFlexTabBbb.js | 1 - .../tap-i18n/lib/tap_i18next/tap_i18next_init.js | 2 +- 30 files changed, 36 insertions(+), 46 deletions(-) diff --git a/.eslintrc b/.eslintrc index 2820e1f3a1f1..7ee543533e74 100644 --- a/.eslintrc +++ b/.eslintrc @@ -8,6 +8,7 @@ "alerts" : false, "Apps" : false, "Assets" : false, + "AudioRecorder" : false, "CachedChatSubscription" : false, "ChatMessage" : false, "ChatMessages" : false, @@ -43,6 +44,7 @@ "openRoom" : false, "OnePassword" : false, "Package" : false, + "popout" : false, "popover" : false, "readMessage" : false, "RocketChat" : true, @@ -53,9 +55,11 @@ "Servers" : false, "Settings" : false, "SideNav" : false, + "TAPi18next" : false, "t" : false, "toolbarSearch" : false, "TwitterConnect" : false, + "updateAvatarOfUsername" : false, "UserRoles" : false, "VideoRecorder" : false, "VRecDialog" : false diff --git a/.scripts/version.js b/.scripts/version.js index cd18c6711439..79f523ab48da 100644 --- a/.scripts/version.js +++ b/.scripts/version.js @@ -1,5 +1,3 @@ -/* eslint object-shorthand: 0, prefer-template: 0 */ - const path = require('path'); let pkgJson = {}; diff --git a/packages/rocketchat-grant/server/providers.js b/packages/rocketchat-grant/server/providers.js index a4983a5b6dfa..ba9de5d65fe5 100644 --- a/packages/rocketchat-grant/server/providers.js +++ b/packages/rocketchat-grant/server/providers.js @@ -1,4 +1,4 @@ -import { check } from 'meteor/check'; +import { Match, check } from 'meteor/check'; import { Storage } from './storage'; import { routes } from './routes'; @@ -7,8 +7,7 @@ class Providers extends Storage { register(name, options, getUser) { check(name, String); check(options, { - // eslint-disable-next-line - scope: Match.OneOf(String, [String]) + scope: Match.OneOf(String, [String]), }); check(getUser, Function); diff --git a/packages/rocketchat-lib/client/lib/openRoom.js b/packages/rocketchat-lib/client/lib/openRoom.js index 56e766bb1506..5a43167f236e 100644 --- a/packages/rocketchat-lib/client/lib/openRoom.js +++ b/packages/rocketchat-lib/client/lib/openRoom.js @@ -7,7 +7,7 @@ import _ from 'underscore'; export let currentTracker = undefined; -openRoom = function(type, name) { // eslint-disable-line +openRoom = function(type, name) { Session.set('openedRoom', null); return Meteor.defer(() => @@ -33,7 +33,7 @@ openRoom = function(type, name) { // eslint-disable-line Meteor.call('createDirectMessage', name, function(error) { if (!error) { RoomManager.close(type + name); - return openRoom('d', name); // eslint-disable-line + return openRoom('d', name); } else { Session.set('roomNotFound', { type, name, error }); BlazeLayout.render('main', { center: 'roomNotFound' }); @@ -48,7 +48,7 @@ openRoom = function(type, name) { // eslint-disable-line } else { RocketChat.models.Rooms.upsert({ _id: record._id }, _.omit(record, '_id')); RoomManager.close(type + name); - return openRoom(type, name); // eslint-disable-line + return openRoom(type, name); } }); } diff --git a/packages/rocketchat-lib/server/methods/saveSetting.js b/packages/rocketchat-lib/server/methods/saveSetting.js index ae0817c389e4..724e24a494bb 100644 --- a/packages/rocketchat-lib/server/methods/saveSetting.js +++ b/packages/rocketchat-lib/server/methods/saveSetting.js @@ -1,4 +1,3 @@ -/* eslint new-cap: 0 */ import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; diff --git a/packages/rocketchat-livechat/server/methods/saveCustomField.js b/packages/rocketchat-livechat/server/methods/saveCustomField.js index 58e22a4bde21..567f1d929573 100644 --- a/packages/rocketchat-livechat/server/methods/saveCustomField.js +++ b/packages/rocketchat-livechat/server/methods/saveCustomField.js @@ -1,4 +1,3 @@ -/* eslint new-cap: [2, {"capIsNewExceptions": ["Match.ObjectIncluding", "Match.Optional"]}] */ import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; import { RocketChat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-livechat/server/methods/saveInfo.js b/packages/rocketchat-livechat/server/methods/saveInfo.js index 19f14a9970c8..663a8abf56c6 100644 --- a/packages/rocketchat-livechat/server/methods/saveInfo.js +++ b/packages/rocketchat-livechat/server/methods/saveInfo.js @@ -1,4 +1,3 @@ -/* eslint new-cap: [2, {"capIsNewExceptions": ["Match.ObjectIncluding", "Match.Optional"]}] */ import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; import { RocketChat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js b/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js index 9554cf7b358d..4636a42a7a4b 100644 --- a/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js +++ b/packages/rocketchat-livechat/server/methods/saveSurveyFeedback.js @@ -1,4 +1,3 @@ -/* eslint new-cap: [2, {"capIsNewExceptions": ["Match.ObjectIncluding"]}] */ import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; import { RocketChat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-livechat/server/methods/startVideoCall.js b/packages/rocketchat-livechat/server/methods/startVideoCall.js index d7ecb67a0f6d..12da5cdd76db 100644 --- a/packages/rocketchat-livechat/server/methods/startVideoCall.js +++ b/packages/rocketchat-livechat/server/methods/startVideoCall.js @@ -1,4 +1,3 @@ -/* eslint new-cap: [2, {"capIsNewExceptions": ["MD5"]}] */ import { Meteor } from 'meteor/meteor'; import { Random } from 'meteor/random'; import { RocketChat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-livechat/server/methods/transfer.js b/packages/rocketchat-livechat/server/methods/transfer.js index aaa857982b0a..eabe665348da 100644 --- a/packages/rocketchat-livechat/server/methods/transfer.js +++ b/packages/rocketchat-livechat/server/methods/transfer.js @@ -1,5 +1,3 @@ -/* eslint new-cap: [2, {"capIsNewExceptions": ["Match.Optional"]}] */ - import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; import { RocketChat } from 'meteor/rocketchat:lib'; diff --git a/packages/rocketchat-ui-sidenav/client/sidebarHeader.js b/packages/rocketchat-ui-sidenav/client/sidebarHeader.js index 4c540e7b1906..2ca64d93d6c4 100644 --- a/packages/rocketchat-ui-sidenav/client/sidebarHeader.js +++ b/packages/rocketchat-ui-sidenav/client/sidebarHeader.js @@ -38,7 +38,7 @@ const extendedViewOption = (user) => { const showToolbar = new ReactiveVar(false); const selectorSearch = '.toolbar__search .rc-input__element'; -toolbarSearch = { //eslint-disable-line +toolbarSearch = { shortcut: false, clear() { const $inputMessage = $('.js-input-message'); @@ -67,7 +67,7 @@ const toolbarButtons = (user) => [{ name: t('Search'), icon: 'magnifier', action: () => { - toolbarSearch.show(false); //eslint-disable-line + toolbarSearch.show(false); }, }, { diff --git a/packages/rocketchat-ui/client/lib/RoomHistoryManager.js b/packages/rocketchat-ui/client/lib/RoomHistoryManager.js index a3177c8fbcb2..e36aaa2d86e7 100644 --- a/packages/rocketchat-ui/client/lib/RoomHistoryManager.js +++ b/packages/rocketchat-ui/client/lib/RoomHistoryManager.js @@ -21,7 +21,7 @@ export const upsertMessage = ({ msg, subscription }) => { return ChatMessage.upsert({ _id: msg._id }, msg); }; -RoomHistoryManager = new class { //eslint-disable-line +RoomHistoryManager = new class { constructor() { this.defaultLimit = 50; this.histories = {}; diff --git a/packages/rocketchat-ui/client/lib/RoomManager.js b/packages/rocketchat-ui/client/lib/RoomManager.js index 84c633b0e410..f5ed7d5f69ed 100644 --- a/packages/rocketchat-ui/client/lib/RoomManager.js +++ b/packages/rocketchat-ui/client/lib/RoomManager.js @@ -22,7 +22,7 @@ const onDeleteMessageBulkStream = ({ rid, ts, excludePinned, users }) => { ChatMessage.remove(query); }; -RoomManager = new function() { //eslint-disable-line +RoomManager = new function() { const openedRooms = {}; const msgStream = new Meteor.Streamer('room-messages'); const onlineUsers = new ReactiveVar({}); diff --git a/packages/rocketchat-ui/client/lib/accountBox.js b/packages/rocketchat-ui/client/lib/accountBox.js index f5ead2eed532..3c08a3b34d63 100644 --- a/packages/rocketchat-ui/client/lib/accountBox.js +++ b/packages/rocketchat-ui/client/lib/accountBox.js @@ -6,7 +6,7 @@ import { BlazeLayout } from 'meteor/kadira:blaze-layout'; import { Session } from 'meteor/session'; import _ from 'underscore'; -AccountBox = (function() { //eslint-disable-line +AccountBox = (function() { let status = 0; const items = new ReactiveVar([]); function setStatus(status) { diff --git a/packages/rocketchat-ui/client/lib/avatar.js b/packages/rocketchat-ui/client/lib/avatar.js index 43eaede3db41..b5920a8c1f8b 100644 --- a/packages/rocketchat-ui/client/lib/avatar.js +++ b/packages/rocketchat-ui/client/lib/avatar.js @@ -24,8 +24,7 @@ export const getAvatarAsPng = function(username, cb) { }; }; -updateAvatarOfUsername = function(username) { //eslint-disable-line - +updateAvatarOfUsername = function(username) { const key = `avatar_random_${ username }`; Session.set(key, Math.round(Math.random() * 1000)); diff --git a/packages/rocketchat-ui/client/lib/chatMessages.js b/packages/rocketchat-ui/client/lib/chatMessages.js index 629c913d135b..e04755f36342 100644 --- a/packages/rocketchat-ui/client/lib/chatMessages.js +++ b/packages/rocketchat-ui/client/lib/chatMessages.js @@ -19,10 +19,10 @@ Meteor.startup(() => { }); }); -ChatMessages = class ChatMessages { //eslint-disable-line +ChatMessages = class ChatMessages { constructor() { - this.saveTextMessageBox = _.debounce((rid, value) => { // eslint + this.saveTextMessageBox = _.debounce((rid, value) => { const key = `messagebox_${ rid }`; return value.length ? localStorage.setItem(key, value) : localStorage.removeItem(key); }, 1000); diff --git a/packages/rocketchat-ui/client/lib/collections.js b/packages/rocketchat-ui/client/lib/collections.js index a57a9ceeaf98..0b54d4fd1a3c 100644 --- a/packages/rocketchat-ui/client/lib/collections.js +++ b/packages/rocketchat-ui/client/lib/collections.js @@ -3,20 +3,20 @@ import { Mongo } from 'meteor/mongo'; import { Tracker } from 'meteor/tracker'; import _ from 'underscore'; -ChatMessage = new Mongo.Collection(null); //eslint-disable-line +ChatMessage = new Mongo.Collection(null); export const CachedChatRoom = new RocketChat.CachedCollection({ name: 'rooms' }); ChatRoom = CachedChatRoom.collection; -CachedChatSubscription = new RocketChat.CachedCollection({ name: 'subscriptions' }); //eslint-disable-line -ChatSubscription = CachedChatSubscription.collection; //eslint-disable-line -UserRoles = new Mongo.Collection(null); //eslint-disable-line -RoomRoles = new Mongo.Collection(null); //eslint-disable-line +CachedChatSubscription = new RocketChat.CachedCollection({ name: 'subscriptions' }); +ChatSubscription = CachedChatSubscription.collection; +UserRoles = new Mongo.Collection(null); +RoomRoles = new Mongo.Collection(null); this.UserAndRoom = new Mongo.Collection(null); this.CachedChannelList = new Mongo.Collection(null); this.CachedUserList = new Mongo.Collection(null); RocketChat.models.Users = _.extend({}, RocketChat.models.Users, Meteor.users); -RocketChat.models.Subscriptions = _.extend({}, RocketChat.models.Subscriptions, ChatSubscription); //eslint-disable-line +RocketChat.models.Subscriptions = _.extend({}, RocketChat.models.Subscriptions, ChatSubscription); RocketChat.models.Rooms = _.extend({}, RocketChat.models.Rooms, ChatRoom); RocketChat.models.Messages = _.extend({}, RocketChat.models.Messages, ChatMessage); @@ -24,7 +24,7 @@ Meteor.startup(() => { Tracker.autorun(() => { if (!Meteor.userId() && RocketChat.settings.get('Accounts_AllowAnonymousRead') === true) { CachedChatRoom.init(); - CachedChatSubscription.ready.set(true); //eslint-disable-line + CachedChatSubscription.ready.set(true); } }); }); diff --git a/packages/rocketchat-ui/client/lib/fileUpload.js b/packages/rocketchat-ui/client/lib/fileUpload.js index b0d48defee7d..c726753ef244 100644 --- a/packages/rocketchat-ui/client/lib/fileUpload.js +++ b/packages/rocketchat-ui/client/lib/fileUpload.js @@ -134,7 +134,7 @@ const getUploadPreview = async(file, preview) => { return getGenericUploadPreview(file, preview); }; -fileUpload = async(files) => { //eslint-disable-line +fileUpload = async(files) => { files = [].concat(files); const roomId = Session.get('openedRoom'); diff --git a/packages/rocketchat-ui/client/lib/fireEvent.js b/packages/rocketchat-ui/client/lib/fireEvent.js index aa3908c70527..c0d50a6b66e1 100644 --- a/packages/rocketchat-ui/client/lib/fireEvent.js +++ b/packages/rocketchat-ui/client/lib/fireEvent.js @@ -1,6 +1,6 @@ import { Tracker } from 'meteor/tracker'; -fireGlobalEvent = function _fireGlobalEvent(eventName, params) { //eslint-disable-line +fireGlobalEvent = function _fireGlobalEvent(eventName, params) { window.dispatchEvent(new CustomEvent(eventName, { detail: params })); Tracker.autorun((computation) => { diff --git a/packages/rocketchat-ui/client/lib/notification.js b/packages/rocketchat-ui/client/lib/notification.js index 45bbb61d84c9..c8e43ef20879 100644 --- a/packages/rocketchat-ui/client/lib/notification.js +++ b/packages/rocketchat-ui/client/lib/notification.js @@ -10,14 +10,14 @@ import s from 'underscore.string'; import { e2e } from 'meteor/rocketchat:e2e'; import { getAvatarAsPng } from './avatar'; -KonchatNotification = { //eslint-disable-line +KonchatNotification = { notificationStatus: new ReactiveVar, // notificacoes HTML5 getDesktopPermission() { if (window.Notification && (Notification.permission !== 'granted') && !Meteor.settings.public.sandstorm) { return Notification.requestPermission(function(status) { - KonchatNotification.notificationStatus.set(status); //eslint-disable-line + KonchatNotification.notificationStatus.set(status); if (Notification.permission !== status) { return Notification.permission = status; } @@ -88,7 +88,7 @@ KonchatNotification = { //eslint-disable-line return getAvatarAsPng(notification.payload.sender.username, function(avatarAsPng) { notification.icon = avatarAsPng; - return KonchatNotification.notify(notification); //eslint-disable-line + return KonchatNotification.notify(notification); }); }, diff --git a/packages/rocketchat-ui/client/lib/recorderjs/audioRecorder.js b/packages/rocketchat-ui/client/lib/recorderjs/audioRecorder.js index d87921bea587..a10ee9ec2136 100644 --- a/packages/rocketchat-ui/client/lib/recorderjs/audioRecorder.js +++ b/packages/rocketchat-ui/client/lib/recorderjs/audioRecorder.js @@ -1,6 +1,6 @@ // TODO: embed Recorder class here // TODO: create the worker for mp3 encoding on-the-fly -AudioRecorder = new (class AudioRecorder { //eslint-disable-line +AudioRecorder = new (class AudioRecorder { start(cb) { window.audioContext = new (window.AudioContext || window.webkitAudioContext); diff --git a/packages/rocketchat-ui/client/lib/sideNav.js b/packages/rocketchat-ui/client/lib/sideNav.js index a7193113f37c..3c1a283bae2b 100644 --- a/packages/rocketchat-ui/client/lib/sideNav.js +++ b/packages/rocketchat-ui/client/lib/sideNav.js @@ -1,7 +1,7 @@ import { FlowRouter } from 'meteor/kadira:flow-router'; import { Session } from 'meteor/session'; -SideNav = new class { //eslint-disable-line +SideNav = new class { constructor() { this.initiated = false; this.sideNav = {}; diff --git a/packages/rocketchat-ui/client/lib/tapi18n.js b/packages/rocketchat-ui/client/lib/tapi18n.js index 148d3a4cb0d9..14ef48497ab3 100644 --- a/packages/rocketchat-ui/client/lib/tapi18n.js +++ b/packages/rocketchat-ui/client/lib/tapi18n.js @@ -23,7 +23,7 @@ this.tr = function(key, options, ...replaces) { } }; -isRtl = (lang) => { //eslint-disable-line +isRtl = (lang) => { const language = lang || localStorage.getItem('userLanguage') || 'en-US'; return ['ar', 'dv', 'fa', 'he', 'ku', 'ps', 'sd', 'ug', 'ur', 'yi'].includes(language.split('-').shift().toLowerCase()); }; diff --git a/packages/rocketchat-ui/client/views/app/popout.js b/packages/rocketchat-ui/client/views/app/popout.js index 2450dd89225b..a877a9acad30 100644 --- a/packages/rocketchat-ui/client/views/app/popout.js +++ b/packages/rocketchat-ui/client/views/app/popout.js @@ -1,4 +1,3 @@ -/* eslint-disable */ import { Blaze } from 'meteor/blaze'; import { ReactiveVar } from 'meteor/reactive-var'; import { Template } from 'meteor/templating'; diff --git a/packages/rocketchat-ui/client/views/app/popover.js b/packages/rocketchat-ui/client/views/app/popover.js index 7c9cdab030eb..f43104cce605 100644 --- a/packages/rocketchat-ui/client/views/app/popover.js +++ b/packages/rocketchat-ui/client/views/app/popover.js @@ -7,7 +7,7 @@ import _ from 'underscore'; import { hide, leave } from 'meteor/rocketchat:lib'; -popover = { //eslint-disable-line +popover = { renderedPopover: null, open({ currentTarget, ...config }) { // Popover position must be computed as soon as possible, avoiding DOM changes over currentTarget diff --git a/packages/rocketchat-ui/client/views/app/room.js b/packages/rocketchat-ui/client/views/app/room.js index 310f1d73ebf1..b250fe94fcba 100644 --- a/packages/rocketchat-ui/client/views/app/room.js +++ b/packages/rocketchat-ui/client/views/app/room.js @@ -15,7 +15,7 @@ import Clipboard from 'clipboard'; import { lazyloadtick } from 'meteor/rocketchat:lazy-load'; -chatMessages = {}; // eslint-disable-line +chatMessages = {}; const isSubscribed = (_id) => ChatSubscription.find({ rid: _id }).count() > 0; const favoritesEnabled = () => RocketChat.settings.get('Favorite_Rooms'); diff --git a/packages/rocketchat-ui/getAvatarUrlFromUsername.js b/packages/rocketchat-ui/getAvatarUrlFromUsername.js index 11313a0757b2..1f09d9b6e7c9 100644 --- a/packages/rocketchat-ui/getAvatarUrlFromUsername.js +++ b/packages/rocketchat-ui/getAvatarUrlFromUsername.js @@ -2,7 +2,7 @@ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; -getAvatarUrlFromUsername = function(username) { //eslint-disable-line +getAvatarUrlFromUsername = function(username) { const key = `avatar_random_${ username }`; const random = typeof Session !== 'undefined' && typeof Session.keys[key] !== 'undefined' ? Session.keys[key] : 0; if (username == null) { diff --git a/packages/rocketchat-videobridge/client/views/videoFlexTab.js b/packages/rocketchat-videobridge/client/views/videoFlexTab.js index c0167281cf7d..52ed27b4050e 100644 --- a/packages/rocketchat-videobridge/client/views/videoFlexTab.js +++ b/packages/rocketchat-videobridge/client/views/videoFlexTab.js @@ -1,4 +1,3 @@ -/* eslint new-cap: [2, {"capIsNewExceptions": ["MD5"]}] */ import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; import { Template } from 'meteor/templating'; diff --git a/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js b/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js index fc863862eaf9..8d9e9d56e6ea 100644 --- a/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js +++ b/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js @@ -1,4 +1,3 @@ -/* eslint new-cap: [2, {"capIsNewExceptions": ["MD5"]}] */ import { Meteor } from 'meteor/meteor'; import { Template } from 'meteor/templating'; import { RocketChat } from 'meteor/rocketchat:lib'; diff --git a/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js b/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js index e3a4deaa8843..2d9cc458246d 100755 --- a/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js +++ b/packages/tap-i18n/lib/tap_i18next/tap_i18next_init.js @@ -1 +1 @@ -TAPi18next.init({ resStore: {}, fallbackLng: globals.fallback_language, useCookie: false }); // eslint-disable-line +TAPi18next.init({ resStore: {}, fallbackLng: globals.fallback_language, useCookie: false });