Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Remove /* globals */ from files wave-1 #12984

Merged
merged 3 commits into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,37 @@
"extends": ["@rocket.chat/eslint-config"],
"parser": "babel-eslint",
"globals": {
"__meteor_bootstrap__" : false,
"__meteor_runtime_config__" : false,
"AccountBox" : false,
"alerts" : false,
"Apps" : false,
"Assets" : false,
"ChatMessage" : false,
"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,
"Settings" : false,
"SideNav" : false,
"t" : false,
"toastr" : false,
"TwitterConnect" : false,
"VideoRecorder" : false,
"VRecDialog" : false
}
Expand Down
2 changes: 1 addition & 1 deletion client/notifications/notification.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/notifications/updateAvatar.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion client/notifications/updateUserState.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion client/routes/router.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* globals KonchatNotification */
import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';
import { Tracker } from 'meteor/tracker';
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) {
Expand Down
2 changes: 1 addition & 1 deletion client/startup/i18n.js
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
3 changes: 2 additions & 1 deletion client/startup/startup.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
6 changes: 3 additions & 3 deletions client/startup/unread.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down Expand Up @@ -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',
});
}
Expand Down
1 change: 0 additions & 1 deletion packages/meteor-accounts-saml/client/saml_client.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* globals cordova */
import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';
import { Random } from 'meteor/random';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* globals RocketChat */
import { RocketChat } from 'meteor/rocketchat:lib';

RocketChat.authz.roomAccessValidators = [
function(room, user = {}) {
if (room && room.t === 'c') {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 1 addition & 0 deletions packages/rocketchat-channel-settings/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* globals OAuth*/
import { Meteor } from 'meteor/meteor';
import { Match } from 'meteor/check';
import { Accounts } from 'meteor/accounts-base';
import { Random } from 'meteor/random';
import { ServiceConfiguration } from 'meteor/service-configuration';
import { OAuth } from 'meteor/oauth';
import s from 'underscore.string';

// Request custom OAuth credentials for the user
Expand Down
Original file line number Diff line number Diff line change
@@ -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 { ServiceConfiguration } from 'meteor/service-configuration';
import _ from 'underscore';
Expand Down
4 changes: 0 additions & 4 deletions packages/rocketchat-e2e/.eslintrc

This file was deleted.

4 changes: 3 additions & 1 deletion packages/rocketchat-e2e/client/accountEncryption.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 0 additions & 1 deletion packages/rocketchat-e2e/client/rocketchat.e2e.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* globals alerts, modal */
import { Meteor } from 'meteor/meteor';
import { Random } from 'meteor/random';
import { ReactiveVar } from 'meteor/reactive-var';
Expand Down
2 changes: 0 additions & 2 deletions packages/rocketchat-e2e/package.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* globals Package: false */

Package.describe({
name: 'rocketchat:e2e',
version: '0.0.1',
Expand Down
1 change: 0 additions & 1 deletion packages/rocketchat-emoji/client/keyboardFix.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global device */
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';

Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-file-upload/globalFileRestrictions.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 0 additions & 2 deletions packages/rocketchat-file-upload/lib/FileUpload.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
7 changes: 3 additions & 4 deletions packages/rocketchat-file-upload/lib/FileUploadBase.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -77,4 +76,4 @@ FileUploadBase = class FileUploadBase {
stop() {
return this.handler.stop();
}
};
}
1 change: 0 additions & 1 deletion packages/rocketchat-file-upload/package.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* globals Package */
Package.describe({
name: 'rocketchat:file-upload',
version: '0.0.1',
Expand Down
2 changes: 0 additions & 2 deletions packages/rocketchat-file-upload/server/config/AmazonS3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* globals FileUpload */

import _ from 'underscore';
import { FileUploadClass } from '../lib/FileUpload';
import '../../ufs/AmazonS3/server.js';
Expand Down
3 changes: 1 addition & 2 deletions packages/rocketchat-file-upload/server/config/FileSystem.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* globals FileUpload */

import _ from 'underscore';
import { FileUploadClass } from '../lib/FileUpload';
import '../../ufs/GoogleStorage/server.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-file-upload/server/config/GridFS.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
2 changes: 0 additions & 2 deletions packages/rocketchat-file-upload/server/config/Webdav.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* globals FileUpload */

import _ from 'underscore';
import { FileUploadClass } from '../lib/FileUpload';
import '../../ufs/Webdav/server.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* globals UploadFS */

import { UploadFS } from 'meteor/jalik:ufs';
import _ from 'underscore';
import './AmazonS3.js';
import './FileSystem.js';
Expand Down
3 changes: 1 addition & 2 deletions packages/rocketchat-file-upload/server/lib/FileUpload.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* globals UploadFS */

import { Meteor } from 'meteor/meteor';
import fs from 'fs';
import stream from 'stream';
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();

Expand Down
4 changes: 2 additions & 2 deletions packages/rocketchat-file-upload/server/lib/proxy.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
3 changes: 1 addition & 2 deletions packages/rocketchat-file-upload/server/lib/requests.js
Original file line number Diff line number Diff line change
@@ -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) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* globals UploadFS */
import { Meteor } from 'meteor/meteor';
import { UploadFS } from 'meteor/jalik:ufs';

let protectedFiles;

Expand Down
1 change: 0 additions & 1 deletion packages/rocketchat-iframe-login/client/iframe_client.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* globals facebookConnectPlugin, TwitterConnect */
import { Meteor } from 'meteor/meteor';
import { Match } from 'meteor/check';
import { RocketChat } from 'meteor/rocketchat:lib';
Expand Down
1 change: 0 additions & 1 deletion packages/rocketchat-internal-hubot/server/hubot.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* globals __meteor_bootstrap__ */
import { Meteor } from 'meteor/meteor';
import { RocketChat } from 'meteor/rocketchat:lib';
import _ from 'underscore';
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-lib/client/lib/openRoom.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-ui/client/lib/avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
6 changes: 3 additions & 3 deletions packages/rocketchat-ui/client/lib/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
}
});
});
3 changes: 2 additions & 1 deletion packages/rocketchat-ui/client/lib/fileUpload.js
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
Loading