Skip to content

Commit

Permalink
refactor: remove unused 'export' declarations (#623)
Browse files Browse the repository at this point in the history
* chore: no-unused-imports

* chore: no-unused-imports (components)

* chore: remove unused getRandomNumber()
  • Loading branch information
ckerr authored Mar 29, 2021
1 parent 126c0aa commit 522d351
Show file tree
Hide file tree
Showing 45 changed files with 62 additions and 124 deletions.
2 changes: 0 additions & 2 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export type WindowNames = 'main';

export type Files = Map<string, string>;

export type FileTransform = (files: Files) => Promise<Files>;
Expand Down
2 changes: 1 addition & 1 deletion src/main/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { getOrCreateMainWindow } from './windows';
* @class IpcManager
* @extends {EventEmitter}
*/
export class IpcMainManager extends EventEmitter {
class IpcMainManager extends EventEmitter {
public readyWebContents = new WeakSet<Electron.WebContents>();
private messageQueue = new WeakMap<
Electron.WebContents,
Expand Down
4 changes: 2 additions & 2 deletions src/main/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ const handlePotentialProtocolLaunch = (url: string) => {
}
};

export const scanArgv = (argv: Array<string>) => {
const scanArgv = (argv: Array<string>) => {
const protocolArg = argv.find((arg) => arg.startsWith(`${PROTOCOL}://`));
if (protocolArg) {
console.info('Found protocol arg in argv:', protocolArg);
handlePotentialProtocolLaunch(protocolArg);
}
};

export const scanNpmArgv = (argv: string) => {
const scanNpmArgv = (argv: string) => {
const parsedArgv = JSON.parse(argv);
const { original: args } = parsedArgv;
scanArgv(args);
Expand Down
2 changes: 1 addition & 1 deletion src/preload/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { IpcEvents } from '../ipc-events';
import { ipcRendererManager } from '../renderer/ipc';

export async function preload() {
async function preload() {
setupGlobalWindow();
await setupPaths();
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/chrome-mac.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getTitle } from '../../utils/get-title';
import { ipcRendererManager } from '../ipc';
import { AppState } from '../state';

export interface ChromeMacProps {
interface ChromeMacProps {
appState: AppState;
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/commands-action-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { EMPTY_EDITOR_CONTENT } from '../constants';
import { ipcRendererManager } from '../ipc';
import { AppState } from '../state';

export interface GistActionButtonProps {
interface GistActionButtonProps {
appState: AppState;
}

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/commands-address-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { idFromUrl, urlFromId } from '../../utils/gist';
import { ipcRendererManager } from '../ipc';
import { AppState } from '../state';

export interface AddressBarProps {
interface AddressBarProps {
appState: AppState;
}

export interface AddressBarState {
interface AddressBarState {
value: string;
loaders: {
gist: any;
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/commands-editors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import { getVisibleMosaics } from '../../utils/editors-mosaic-arrangement';
import { AppState } from '../state';
import { TITLE_MAP } from './editors';

export interface EditorDropdownState {
interface EditorDropdownState {
value: string;
}

export interface EditorDropdownProps {
interface EditorDropdownProps {
appState: AppState;
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/commands-runner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as React from 'react';
import { VersionState } from '../../interfaces';
import { AppState } from '../state';

export interface RunnerProps {
interface RunnerProps {
appState: AppState;
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/commands-version-chooser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as React from 'react';
import { AppState } from '../state';
import { VersionSelect } from './version-select';

export interface VersionChooserProps {
interface VersionChooserProps {
appState: AppState;
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/commands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { GistActionButton } from './commands-action-button';
import { Runner } from './commands-runner';
import { VersionChooser } from './commands-version-chooser';

export interface CommandsProps {
interface CommandsProps {
appState: AppState;
}

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/dialog-add-theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import { GenericDialogType } from '../../../src/interfaces';
import { AppState } from '../state';
import { defaultDark, LoadedFiddleTheme } from '../themes-defaults';

export interface AddThemeDialogProps {
interface AddThemeDialogProps {
appState: AppState;
}

export interface AddThemeDialogState {
interface AddThemeDialogState {
file?: File;
}

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/dialog-add-version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import { getIsDownloaded } from '../binary';
import { ipcRendererManager } from '../ipc';
import { AppState } from '../state';

export interface AddVersionDialogProps {
interface AddVersionDialogProps {
appState: AppState;
}

export interface AddVersionDialogState {
interface AddVersionDialogState {
isValidElectron: boolean;
isValidVersion: boolean;
folderPath?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/dialog-bisect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { Bisector } from '../bisect';
import { AppState } from '../state';
import { VersionSelect } from './version-select';

export interface BisectDialogProps {
interface BisectDialogProps {
appState: AppState;
}

export interface BisectDialogState {
interface BisectDialogState {
startIndex: number;
endIndex: number;
allVersions: Array<RunnableVersion>;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/dialog-generic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as React from 'react';
import { GenericDialogType } from '../../../src/interfaces';
import { AppState } from '../state';

export interface GenericDialogProps {
interface GenericDialogProps {
appState: AppState;
}

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/dialog-token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import * as React from 'react';
import { getOctokit } from '../../utils/octokit';
import { AppState } from '../state';

export interface TokenDialogProps {
interface TokenDialogProps {
appState: AppState;
}

export interface TokenDialogState {
interface TokenDialogState {
tokenInput: string;
verifying: boolean;
error: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/dialogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { GenericDialog } from './dialog-generic';
import { TokenDialog } from './dialog-token';
import { Settings } from './settings';

export interface DialogsProps {
interface DialogsProps {
appState: AppState;
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { EditorId } from '../../interfaces';
import { getContent } from '../content';
import { AppState } from '../state';

export interface EditorProps {
interface EditorProps {
appState: AppState;
monaco: typeof MonacoType;
monacoOptions: MonacoType.editor.IEditorOptions;
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/editors-toolbar-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import {
import { DocsDemoPage, MosaicId } from '../../interfaces';
import { AppState } from '../state';

export interface ToolbarButtonProps {
interface ToolbarButtonProps {
appState: AppState;
id: MosaicId;
}

export abstract class ToolbarButton extends React.PureComponent<ToolbarButtonProps> {
abstract class ToolbarButton extends React.PureComponent<ToolbarButtonProps> {
public static contextType = MosaicWindowContext;
public context: MosaicWindowContext;

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/editors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ export const TITLE_MAP: Record<MosaicId, string> = {
[PanelId.docsDemo]: 'Docs & Demos',
};

export interface EditorsProps {
interface EditorsProps {
appState: AppState;
}

export interface EditorsState {
interface EditorsState {
monaco?: typeof MonacoType;
isMounted?: boolean;
monacoOptions: MonacoType.editor.IEditorOptions;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ChromeMac } from './chrome-mac';
import { Commands } from './commands';
import { WelcomeTour } from './tour-welcome';

export interface HeaderProps {
interface HeaderProps {
appState: AppState;
}

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/output-editors-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { AppState } from '../state';
import { Editors } from './editors';
import { Output } from './output';

export interface WrapperProps {
interface WrapperProps {
appState: AppState;
}

export interface WrapperState {
interface WrapperState {
mosaicArrangement: MosaicNode<WrapperMosaicId>;
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/output.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { OutputEntry } from '../../interfaces';
import { AppState } from '../state';
import { WrapperMosaicId } from './output-editors-wrapper';

export interface CommandsProps {
interface CommandsProps {
appState: AppState;
// Used to keep testing conform
renderTimestamp?: (ts: number) => string;
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/components/settings-credits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import * as React from 'react';

import { AppState } from '../state';

export interface CreditsSettingsProps {
interface CreditsSettingsProps {
appState: AppState;
}

export interface CreditsSettingsState {
interface CreditsSettingsState {
contributors: Array<Contributor>;
}

export interface Contributor {
interface Contributor {
url: string;
api: string;
login: string;
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/settings-electron.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import { sortedElectronMap } from '../../utils/sorted-electron-map';
import { AppState } from '../state';
import { ElectronReleaseChannel, getReleaseChannel } from '../versions';

export interface ElectronSettingsProps {
interface ElectronSettingsProps {
appState: AppState;
}

export interface ElectronSettingsState {
interface ElectronSettingsState {
isDownloadingAll: boolean;
isDeletingAll: boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/settings-execution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as React from 'react';
import { IPackageManager } from '../npm';
import { AppState } from '../state';

export interface ExecutionSettingsProps {
interface ExecutionSettingsProps {
appState: AppState;
}

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/settings-general-appearance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ export const renderItem: ItemRenderer<LoadedFiddleTheme> = (
);
};

export interface AppearanceSettingsProps {
interface AppearanceSettingsProps {
appState: AppState;
toggleHasPopoverOpen: () => void;
}

export interface AppearanceSettingsState {
interface AppearanceSettingsState {
themes: Array<LoadedFiddleTheme>;
selectedTheme?: LoadedFiddleTheme;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BlockableAccelerator } from '../../interfaces';

import { AppState } from '../state';

export interface BlockAcceleratorsSettingsProps {
interface BlockAcceleratorsSettingsProps {
appState: AppState;
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/settings-general-console.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as React from 'react';

import { AppState } from '../state';

export interface ConsoleSettingsProps {
interface ConsoleSettingsProps {
appState: AppState;
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/settings-general-github.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as React from 'react';

import { AppState } from '../state';

export interface GitHubSettingsProps {
interface GitHubSettingsProps {
appState: AppState;
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/settings-general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { BlockAcceleratorsSettings } from './settings-general-block-accelerators
import { ConsoleSettings } from './settings-general-console';
import { GitHubSettings } from './settings-general-github';

export interface GeneralSettingsProps {
interface GeneralSettingsProps {
appState: AppState;
toggleHasPopoverOpen: () => void;
}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const settingsSections = [
SettingsSections.Credits,
];

export interface SettingsProps {
interface SettingsProps {
appState: AppState;
}

export interface SettingsState {
interface SettingsState {
section: SettingsSections;
hasPopoverOpen: boolean;
}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/tour-welcome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import * as React from 'react';
import { AppState } from '../state';
import { Tour, TourScriptStep, TourStepGetButtonParams } from './tour';

export interface WelcomeTourProps {
interface WelcomeTourProps {
appState: AppState;
}

export interface WelcomeTourState {
interface WelcomeTourState {
isTourStarted: boolean;
}

Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/tour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export interface TourScriptStep {
getButtons?: (handlers: TourStepGetButtonParams) => Array<JSX.Element>;
}

export interface TourProps {
interface TourProps {
tour: Set<TourScriptStep>;
onStop: () => void;
}

export interface TourState {
interface TourState {
tour: IterableIterator<Array<TourScriptStep>>;
step: TourScriptStep | null;
i: number;
Expand Down
Loading

0 comments on commit 522d351

Please sign in to comment.