Remove unused imports

This commit is contained in:
Samuel Elliott 2018-07-18 20:57:05 +01:00
parent df471161a7
commit 6b97505f66
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
25 changed files with 22 additions and 46 deletions

View File

@ -8,8 +8,8 @@
* LICENSE file in the root directory of this source tree.
*/
import { Events, Settings, Globals, WebpackModules, ReactComponents, MonkeyPatch } from 'modules';
import { DOM, VueInjector, Reflection } from 'ui';
import { Settings, Globals, WebpackModules, ReactComponents, MonkeyPatch } from 'modules';
import { VueInjector, Reflection } from 'ui';
import { Utils, FileUtils, ClientLogger as Logger } from 'common';
import path from 'path';
import EmoteComponent from './EmoteComponent.vue';

View File

@ -8,7 +8,7 @@
* LICENSE file in the root directory of this source tree.
*/
import { Utils, FileUtils, ClientLogger as Logger, AsyncEventEmitter } from 'common';
import { Utils, ClientLogger as Logger, AsyncEventEmitter } from 'common';
import { Modals } from 'ui';
import Database from './database';

View File

@ -12,7 +12,6 @@ import Content from './content';
import Globals from './globals';
import Database from './database';
import { Utils, FileUtils, ClientLogger as Logger } from 'common';
import { Events } from 'modules';
import { SettingsSet, ErrorEvent } from 'structs';
import { Modals } from 'ui';
import path from 'path';

View File

@ -8,7 +8,7 @@
* LICENSE file in the root directory of this source tree.
*/
import { List, InsufficientPermissions } from 'structs';
import { List } from 'structs';
import { User, Channel, Guild, Message } from 'discordstructs';
import { WebpackModules } from './webpackmodules';

View File

@ -8,7 +8,6 @@
* LICENSE file in the root directory of this source tree.
*/
import { Utils, ClientLogger as Logger } from 'common';
import { WebpackModules } from './webpackmodules';
import Events from './events';
import EventListener from './eventlistener';

View File

@ -10,8 +10,6 @@
import ContentManager from './contentmanager';
import ExtModule from './extmodule';
import { ClientLogger as Logger } from 'common';
import { Events } from 'modules';
export default class extends ContentManager {

View File

@ -9,7 +9,7 @@
*/
import { ClientLogger as Logger } from 'common';
import { Events, SocketProxy, EventHook, CssEditor } from 'modules';
import { SocketProxy, EventHook, CssEditor } from 'modules';
import { ProfileBadges, ClassNormaliser } from 'ui';
import Updater from './updater';

View File

@ -9,7 +9,7 @@
*/
import { WebpackModules } from './webpackmodules';
import { ClientLogger as Logger, Utils } from 'common';
import { ClientLogger as Logger } from 'common';
export class Patcher {

View File

@ -231,7 +231,7 @@ export default class PluginApi {
this.injectedStyles.splice(this.injectedStyles.indexOf(styleid), 1);
DOM.deleteStyle(styleid);
}
deleteAllStyles(id, css) {
deleteAllStyles(id) {
for (let id of this.injectedStyles) {
this.deleteStyle(id);
}

View File

@ -8,7 +8,7 @@
* LICENSE file in the root directory of this source tree.
*/
import { Events, Permissions } from 'modules';
import { Permissions } from 'modules';
import { Modals } from 'ui';
import { ErrorEvent } from 'structs';
import { ClientLogger as Logger } from 'common';

View File

@ -12,7 +12,7 @@
import { Reflection } from 'ui';
import { Filters, ClientLogger as Logger } from 'common';
import { MonkeyPatch, Patcher } from './patcher';
import { MonkeyPatch } from './patcher';
import { WebpackModules } from './webpackmodules';
import DiscordApi from './discordapi';
@ -242,7 +242,7 @@ export class ReactComponents {
});
}
static setName(name, filter, callback) {
static setName(name, filter) {
const have = this.components.find(c => c.id === name);
if (have) return have;
@ -260,7 +260,7 @@ export class ReactComponents {
const have = this.unknownComponents.find(c => c.component === component);
for (const [fi, filter] of this.nameSetters.entries()) {
if (filter.filter.filter(component)) {
console.log('filter match!');
Logger.log('ReactComponents', 'Filter match!');
component.displayName = filter.name;
this.nameSetters.splice(fi, 1);
return this.push(component, retVal);

View File

@ -9,8 +9,8 @@
*/
import { EmoteModule } from 'builtin';
import { SettingsSet, SettingUpdatedEvent } from 'structs';
import { Utils, FileUtils, ClientLogger as Logger } from 'common';
import { SettingsSet } from 'structs';
import { FileUtils, ClientLogger as Logger } from 'common';
import path from 'path';
import Globals from './globals';
import CssEditor from './csseditor';

View File

@ -10,8 +10,6 @@
import ContentManager from './contentmanager';
import Theme from './theme';
import { FileUtils } from 'common';
import path from 'path';
export default class ThemeManager extends ContentManager {
@ -116,8 +114,7 @@ export default class ThemeManager extends ContentManager {
* @return {Promise}
*/
static async parseSetting(setting) {
const { type, id, value } = setting;
const name = id.replace(/[^a-zA-Z0-9-]/g, '-').replace(/--/g, '-');
const name = setting.id.replace(/[^a-zA-Z0-9-]/g, '-').replace(/--/g, '-');
const scss = await setting.toSCSS();
if (scss) return [name, scss];

View File

@ -8,8 +8,6 @@
* LICENSE file in the root directory of this source tree.
*/
import { Utils } from 'common';
export default class MultipleChoiceOption {
constructor(args) {

View File

@ -8,8 +8,6 @@
* LICENSE file in the root directory of this source tree.
*/
import { Utils } from 'common';
import BoolSetting from './types/bool';
import StringSetting from './types/text';
import NumberSetting from './types/number';

View File

@ -10,7 +10,6 @@
import SettingsSet from './settingsset';
import SettingsCategory from './settingscategory';
import Setting from './types/basesetting';
const setHandler = {
get({ set }, category_id) {

View File

@ -365,7 +365,7 @@ export default class SettingsSet extends AsyncEventEmitter {
* Merges a set into this set without emitting events (and therefore synchronously).
* This only exists for use by the constructor.
*/
_merge(newSet, emit_multi = true) {
_merge(newSet) {
let updatedSettings = [];
// const categories = newSet instanceof Array ? newSet : newSet.settings;
const categories = newSet && newSet.args ? newSet.args.settings : newSet ? newSet.settings : newSet;

View File

@ -11,8 +11,6 @@
import { Globals } from 'modules';
import path from 'path';
import Setting from './basesetting';
import SettingsCategory from '../settingscategory';
import SettingsScheme from '../settingsscheme';
export default class CustomSetting extends Setting {

View File

@ -8,8 +8,7 @@
* LICENSE file in the root directory of this source tree.
*/
import { Events, WebpackModules, DiscordApi, MonkeyPatch } from 'modules';
import { Utils } from 'common';
import { Events, DiscordApi } from 'modules';
import { remote } from 'electron';
import DOM from './dom';
import Vue from './vue';

View File

@ -8,7 +8,7 @@
* LICENSE file in the root directory of this source tree.
*/
import { Utils, FileUtils, ClientLogger as Logger, AsyncEventEmitter } from 'common';
import { ClientLogger as Logger, AsyncEventEmitter } from 'common';
import { Settings, Events, PluginManager, ThemeManager } from 'modules';
import BaseModal from './components/common/Modal.vue';
import BasicModal from './components/bd/modals/BasicModal.vue';

View File

@ -10,8 +10,7 @@
import { Module, ReactComponents, ReactHelpers, MonkeyPatch, WebpackModules } from 'modules';
import { Reflection } from 'ui';
import { Utils, ClientLogger as Logger } from 'common';
import DOM from './dom';
import { ClientLogger as Logger } from 'common';
import { BdBadge } from './components/bd';
import VueInjector from './vueinjector';
import contributors from '../data/contributors';
@ -95,7 +94,6 @@ export default class extends Module {
async patchNameTag() {
if (this.PatchedNameTag) return this.PatchedNameTag;
const ProfileBadges = this;
const selector = '.' + WebpackModules.getClassName('nameTag', 'username', 'discriminator', 'ownerIcon');
const NameTag = await ReactComponents.getComponent('NameTag', { selector });

View File

@ -11,7 +11,7 @@
import EventEmitter from 'events';
/**
* Extends Node.js' EventEmitter to trigger event listeners asyncronously.
* Extends Node.js' EventEmitter to call event listeners asyncronously.
*/
export default class AsyncEventEmitter extends EventEmitter {
@ -42,7 +42,7 @@ export default class AsyncEventEmitter extends EventEmitter {
/**
* Adds an event listener that will be removed when it is called and therefore only be called once.
* If a callback is not specified a promise that is resolved once the event is triggered is returned.
* If a callback is not specified a promise that is resolved once the event is emitted is returned.
*/
once(event, callback) {
if (callback) {
@ -50,7 +50,7 @@ export default class AsyncEventEmitter extends EventEmitter {
return EventEmitter.prototype.once.apply(this, arguments);
}
// Otherwise return a promise that is resolved once this event is triggered
// Otherwise return a promise that is resolved once this event is emitted
return new Promise((resolve, reject) => {
EventEmitter.prototype.once.call(this, event, data => {
return resolve(data);

View File

@ -8,7 +8,6 @@
* LICENSE file in the root directory of this source tree.
*/
import path from 'path';
import fs from 'fs';
import _ from 'lodash';
import filetype from 'file-type';
@ -91,11 +90,7 @@ export class Utils {
* @return {Any} The cloned value
*/
static deepclone(value, exclude) {
try {
if (exclude && exclude(value)) return value;
} catch (err) {
console.error(arguments, err);
}
if (exclude && exclude(value)) return value;
if (typeof value === 'object') {
if (value instanceof Array) return value.map(i => this.deepclone(i, exclude));

View File

@ -183,7 +183,6 @@ export class BetterDiscord {
}
async waitForWindow() {
const self = this;
return new Promise(resolve => {
const defer = setInterval(() => {
const windows = BrowserWindow.getAllWindows();

View File

@ -10,7 +10,6 @@
// TODO Use common
import path from 'path';
import fs from 'fs';
import Module from './modulebase';