From 51a48a441c7b00bed89b2d59c38773490bdb6fe3 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Fri, 23 Aug 2024 00:50:00 -0700 Subject: [PATCH] chore: convert JSDoc comments to TSDoc --- .eslintrc.js | 11 +++- package.json | 1 + src/main/about-panel.ts | 2 - src/main/content.ts | 12 ++-- src/main/context-menu.ts | 11 ---- src/main/devtools.ts | 3 - src/main/dialogs.ts | 11 +--- src/main/files.ts | 6 -- src/main/ipc.ts | 7 --- src/main/main.ts | 2 - src/main/menu.ts | 13 ----- src/main/npm.ts | 10 +--- src/main/templates.ts | 3 - src/main/themes.ts | 10 ---- src/main/utils/check-first-run.ts | 2 - src/main/utils/devmode.ts | 2 - src/main/utils/exec.ts | 6 -- src/main/utils/get-project-name.ts | 3 - src/main/utils/get-username.ts | 3 - src/main/utils/read-fiddle.ts | 4 +- src/main/versions.ts | 7 +-- src/main/windows.ts | 7 --- src/renderer/app.tsx | 9 +-- .../components/commands-action-button.tsx | 11 ---- .../components/commands-address-bar.tsx | 6 -- src/renderer/components/commands-runner.tsx | 3 - src/renderer/components/commands.tsx | 3 - src/renderer/components/dialog-add-theme.tsx | 7 --- .../components/dialog-add-version.tsx | 7 --- src/renderer/components/dialog-bisect.tsx | 11 ---- src/renderer/components/dialog-generic.tsx | 4 -- src/renderer/components/dialog-token.tsx | 15 ----- src/renderer/components/dialogs.tsx | 3 - src/renderer/components/editor.tsx | 4 -- src/renderer/components/editors.tsx | 20 ------- src/renderer/components/header.tsx | 3 - src/renderer/components/output.tsx | 15 +---- src/renderer/components/settings-credits.tsx | 5 -- src/renderer/components/settings-electron.tsx | 32 ---------- .../components/settings-execution.tsx | 14 ----- .../settings-general-appearance.tsx | 18 ------ .../settings-general-block-accelerators.tsx | 5 -- .../components/settings-general-console.tsx | 5 -- .../components/settings-general-font.tsx | 7 --- .../components/settings-general-github.tsx | 9 --- .../components/settings-general-mirror.tsx | 3 - .../settings-general-package-author.tsx | 5 -- src/renderer/components/settings-general.tsx | 3 - src/renderer/components/settings.tsx | 13 ----- .../components/sidebar-package-manager.tsx | 1 - src/renderer/components/tour-welcome.tsx | 6 -- src/renderer/components/tour.tsx | 10 ---- src/renderer/components/version-select.tsx | 20 +------ src/renderer/file-manager.ts | 13 ----- src/renderer/npm-search.tsx | 1 - src/renderer/remote-loader.ts | 9 +-- src/renderer/runner.ts | 32 +--------- src/renderer/state.ts | 37 +----------- src/renderer/themes.ts | 9 --- src/renderer/transforms/dotfiles.ts | 3 - src/renderer/transforms/forge.ts | 3 - src/renderer/utils/disable-download.ts | 3 +- src/renderer/utils/electron-name.ts | 2 - src/renderer/utils/get-package.ts | 4 -- src/renderer/utils/get-version-range.ts | 8 +-- src/renderer/utils/highlight-text.tsx | 5 -- src/renderer/utils/js-path.ts | 8 --- src/renderer/utils/normalize-version.ts | 3 - src/renderer/utils/octokit.ts | 3 - src/renderer/utils/plural-maybe.ts | 4 -- src/renderer/utils/position-for-rect.ts | 19 ------ src/renderer/utils/sort-versions.ts | 13 ++--- src/renderer/utils/toggle-monaco.ts | 3 - src/renderer/versions.ts | 26 --------- src/utils/gist.ts | 9 --- tests/utils.ts | 22 +++++-- yarn.lock | 58 ++++++++++++++++++- 77 files changed, 112 insertions(+), 598 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 43d7b9b370..7f49ecf293 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,7 +25,7 @@ const config = { 'plugin:import/recommended', // Used along with eslint-plugin-import to sort imports with recommended standards 'plugin:import/typescript', // To handle import order cases for typescript files ], - plugins: ['import'], + plugins: ['import', 'eslint-plugin-tsdoc'], rules: { // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs // e.g. "@typescript-eslint/explicit-function-return-type": "off", @@ -76,7 +76,16 @@ const config = { pathGroupsExcludedImportTypes: ['react'], }, ], + 'tsdoc/syntax': 'error', }, + overrides: [ + { + files: ['rtl-spec/**', 'tests/**'], + rules: { + 'tsdoc/syntax': 'off', + }, + }, + ], // the static folder is linted by standard ignorePatterns: ['/out', '/.webpack', '/coverage', '/static'], }; diff --git a/package.json b/package.json index 7b48e2c09c..848d8cbd83 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,7 @@ "eslint-plugin-import": "^2.27.5", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-react": "^7.32.2", + "eslint-plugin-tsdoc": "^0.3.0", "fork-ts-checker-webpack-plugin": "^8.0.0", "husky": "^9.0.11", "jest": "^29.6.2", diff --git a/src/main/about-panel.ts b/src/main/about-panel.ts index 8883865838..60da68aa05 100644 --- a/src/main/about-panel.ts +++ b/src/main/about-panel.ts @@ -8,8 +8,6 @@ import contributorsJSON from '../../static/contributors.json'; /** * Sets Fiddle's About panel options on Linux and macOS - * - * @returns */ export function setupAboutPanel(): void { const contributors: Array = []; diff --git a/src/main/content.ts b/src/main/content.ts index 7d0ca84977..797d0b113d 100644 --- a/src/main/content.ts +++ b/src/main/content.ts @@ -23,8 +23,8 @@ const TEST_TEMPLATE_BRANCH = 'test-template'; * Ensure we have a fiddle for the specified Electron branch. * If we don't have it already, download it from electron-quick-start. * - * @param {string} branch - Electron branchname, e.g. `12-x-y` or `main` - * @returns {Promise} Path to the folder where the fiddle is kept + * @param branch - Electron branchname, e.g. `12-x-y` or `main` + * @returns Path to the folder where the fiddle is kept */ async function prepareTemplate(branch: string): Promise { let folder = path.join(TEMPLATES_DIR, `electron-quick-start-${branch}`); @@ -69,8 +69,7 @@ const templateCache: Record> = {}; /** * Get a cached copy of the Electron branch's fiddle. * - * @param {string} branch - Electron branchname, e.g. `12-x-y` or `main` - * @returns {Promise} + * @param branch - Electron branchname, e.g. `12-x-y` or `main` */ function getQuickStart(branch: string): Promise { // Load the template for that branch. @@ -86,8 +85,6 @@ function getQuickStart(branch: string): Promise { /** * Get a cached copy of the Electron Test fiddle. - * - * @returns {Promise} */ export function getTestTemplate(): Promise { return getQuickStart(TEST_TEMPLATE_BRANCH); @@ -96,8 +93,7 @@ export function getTestTemplate(): Promise { /** * Get a cached copy of the fiddle for the specified Electron version. * - * @param {string} version - Electron version, e.g. 12.0.0 - * @returns {Promise} + * @param version - Electron version, e.g. 12.0.0 */ export function getTemplate(version: string): Promise { const major = Number.parseInt(version); diff --git a/src/main/context-menu.ts b/src/main/context-menu.ts index 9dbe5974be..55971975de 100644 --- a/src/main/context-menu.ts +++ b/src/main/context-menu.ts @@ -11,8 +11,6 @@ import { IpcEvents } from '../ipc-events'; /** * Returns items related to running the current fiddle. - * - * @returns {Array} */ export function getRunItems(): Array { return [ @@ -36,9 +34,6 @@ export function getRunItems(): Array { * Possibly returns items interacting with the Monaco editor. * Our check for "are we in the Monaco editor" is pretty crude - * we just assume that we are if we can paste text. - * - * @param {ContextMenuParams} { pageURL, editFlags } - * @returns {Array} */ export function getMonacoItems({ pageURL, @@ -105,10 +100,6 @@ export function getMonacoItems({ /** * Possibly returns the `Inspect Element` item. - * - * @param {BrowserWindow} browserWindow - * @param {ContextMenuParams} { x, y } - * @returns {Array} */ export function getInspectItems( browserWindow: BrowserWindow, @@ -137,8 +128,6 @@ export function getInspectItems( /** * Creates a context menu for a given BrowserWindow - * - * @param {BrowserWindow} browserWindow */ export function createContextMenu(browserWindow: BrowserWindow) { browserWindow.webContents.on('context-menu', (_event, props) => { diff --git a/src/main/devtools.ts b/src/main/devtools.ts index d08f66e50b..2dc3f6153c 100644 --- a/src/main/devtools.ts +++ b/src/main/devtools.ts @@ -2,9 +2,6 @@ import { isDevMode } from './utils/devmode'; /** * Installs developer tools if we're in dev mode. - * - * @export - * @returns {Promise} */ export async function setupDevTools(): Promise { if (!isDevMode()) return; diff --git a/src/main/dialogs.ts b/src/main/dialogs.ts index 227171a062..f999a1a09b 100644 --- a/src/main/dialogs.ts +++ b/src/main/dialogs.ts @@ -11,9 +11,7 @@ import { IpcEvents } from '../ipc-events'; /** * Build a default name for a local Electron version * from its dirname. - * - * @param {string} folderPath - * @return {string} human-readable local build name + * @returns human-readable local build name */ function makeLocalName(folderPath: string): string { // take a dirname like '/home/username/electron/gn/main/src/out/testing' @@ -35,9 +33,6 @@ function makeLocalName(folderPath: string): string { /** * Verifies if the local electron path is valid - * - * @param {string} folderPath - * @return {boolean} */ function isValidElectronPath(folderPath: string): boolean { const execPath = Installer.getExecPath(folderPath); @@ -46,8 +41,6 @@ function isValidElectronPath(folderPath: string): boolean { /** * Listens to IPC events related to dialogs and message boxes - * - * @export */ export function setupDialogs() { ipcMainManager.on(IpcEvents.SHOW_WARNING_DIALOG, (event, args) => { @@ -77,8 +70,6 @@ export function setupDialogs() { /** * Shows a warning dialog - * - * @param {Electron.MessageBoxOptions} args */ function showWarningDialog( window: BrowserWindow, diff --git a/src/main/files.ts b/src/main/files.ts index c01817d33d..bb1e3ac60e 100644 --- a/src/main/files.ts +++ b/src/main/files.ts @@ -81,9 +81,6 @@ export async function showSaveDialog( /** * Confirm it's OK to save files in `folder` - * - * @param {string} filePath - * @returns {Promise} */ async function isOkToSaveAt(filePath: string): Promise { return ( @@ -96,9 +93,6 @@ async function isOkToSaveAt(filePath: string): Promise { /** * Pops open a confirmation dialog, asking the user if they really * want to overwrite an existing file - * - * @param {string} filePath - * @returns {Promise} */ async function confirmFileOverwrite(filePath: string): Promise { try { diff --git a/src/main/ipc.ts b/src/main/ipc.ts index cb86260d68..92254a5db8 100644 --- a/src/main/ipc.ts +++ b/src/main/ipc.ts @@ -13,9 +13,6 @@ import { * The main purpose of this class is to be the central * gathering place for IPC calls the main process sends * or listens to. - * - * @class IpcManager - * @extends {EventEmitter} */ class IpcMainManager extends EventEmitter { public readyWebContents = new WeakSet(); @@ -50,10 +47,6 @@ class IpcMainManager extends EventEmitter { /** * Send an IPC message to an instance of Electron.WebContents. * If none is specified, we'll automatically go with the main window. - * - * @param {IpcEvents} channel - * @param {Array} [args] - * @param {Electron.WebContents} [target] */ public send( channel: IpcEvents, diff --git a/src/main/main.ts b/src/main/main.ts index 2dca280ce3..7745fc83b3 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -77,8 +77,6 @@ export async function onReady() { /** * Handle the "before-quit" event - * - * @export */ export function onBeforeQuit() { ipcMainManager.send(IpcEvents.BEFORE_QUIT); diff --git a/src/main/menu.ts b/src/main/menu.ts index 7963aa08ff..bb8ef9b493 100644 --- a/src/main/menu.ts +++ b/src/main/menu.ts @@ -25,9 +25,6 @@ import { SHOW_ME_TEMPLATES } from '../templates'; /** * Is the passed object a constructor for an Electron Menu? - * - * @param {(Array | Electron.Menu)} [submenu] - * @returns {submenu is Array} */ function isSubmenu( submenu?: Array | Menu, @@ -37,8 +34,6 @@ function isSubmenu( /** * Returns additional items for the help menu - * - * @returns {Array} */ function getHelpItems(): Array { const items: MenuItemConstructorOptions[] = []; @@ -112,8 +107,6 @@ function getHelpItems(): Array { /** * Depending on the OS, the `Preferences` either go into the `Fiddle` * menu (macOS) or under `File` (Linux, Windows) - * - * @returns {Array} */ function getPreferencesItems(): Array { return [ @@ -135,8 +128,6 @@ function getPreferencesItems(): Array { /** * Returns the Exit items - * - * @returns {Array} */ function getQuitItems(): Array { return [ @@ -151,8 +142,6 @@ function getQuitItems(): Array { /** * Returns the top-level "File" menu - * - * @returns {Array} */ function getTasksMenu(): MenuItemConstructorOptions { const tasksMenu: Array = [ @@ -219,8 +208,6 @@ function getShowMeMenu( /** * Returns the top-level "File" menu - * - * @returns {Array} */ function getFileMenu( acceleratorsToBlock: BlockableAccelerator[] = [], diff --git a/src/main/npm.ts b/src/main/npm.ts index cb3c863c5d..18b1a3bb1a 100644 --- a/src/main/npm.ts +++ b/src/main/npm.ts @@ -49,10 +49,6 @@ export async function getIsPackageManagerInstalled( /** * Installs given modules to a given folder. - * - * @param {PMOperationOptions} { dir, packageManager } - * @param {...Array} names - * @returns {Promise} */ export async function addModules( { dir, packageManager }: PMOperationOptions, @@ -73,11 +69,7 @@ export async function addModules( } /** - * Execute an "{packageManager} run" command - * - * @param {PMOperationOptions} { dir, packageManager } - * @param {string} command - * @returns {Promise} + * Execute an "\{packageManager\} run" command */ export async function packageRun( { dir, packageManager }: PMOperationOptions, diff --git a/src/main/templates.ts b/src/main/templates.ts index 503d522736..3001750b29 100644 --- a/src/main/templates.ts +++ b/src/main/templates.ts @@ -10,9 +10,6 @@ import { IpcEvents } from '../ipc-events'; /** * Returns expected content for a given name. - * - * @param {string} name - * @returns {Promise} */ export function getTemplateValues(name: string): Promise { const templatePath = path.join(STATIC_DIR, 'show-me', name.toLowerCase()); diff --git a/src/main/themes.ts b/src/main/themes.ts index dfcd6c21e3..43b6ca0603 100644 --- a/src/main/themes.ts +++ b/src/main/themes.ts @@ -19,10 +19,6 @@ export const THEMES_PATH = path.join(CONFIG_PATH, 'themes'); /** * Read in a theme file. - * - * @export - * @param {string} [name] - * @returns {Promise} */ export async function readThemeFile( name?: string, @@ -48,10 +44,6 @@ export async function readThemeFile( /** * Create theme file and show in folder. - * - * @param {FiddleTheme} theme - * @param {string} [name] - * @returns {Promise} */ export async function createThemeFile( theme: FiddleTheme | LoadedFiddleTheme, @@ -87,8 +79,6 @@ export async function createThemeFile( /** * Reads and then returns all available themes. - * - * @returns {Promise>} */ export async function getAvailableThemes(): Promise> { const themes: Array = [defaultDark, defaultLight]; diff --git a/src/main/utils/check-first-run.ts b/src/main/utils/check-first-run.ts index d11567a5d4..897d65ec70 100644 --- a/src/main/utils/check-first-run.ts +++ b/src/main/utils/check-first-run.ts @@ -11,8 +11,6 @@ const getConfigPath = () => { /** * Whether or not the app is being run for * the first time - * - * @returns {boolean} */ export function isFirstRun(): boolean { const configPath = getConfigPath(); diff --git a/src/main/utils/devmode.ts b/src/main/utils/devmode.ts index e41ef3d685..384cdfd78f 100644 --- a/src/main/utils/devmode.ts +++ b/src/main/utils/devmode.ts @@ -1,7 +1,5 @@ /** * Are we currently running in development mode? - * - * @returns {boolean} */ export function isDevMode(): boolean { return !!process.defaultApp; diff --git a/src/main/utils/exec.ts b/src/main/utils/exec.ts index e2e6b96cc6..d4a957d8f4 100644 --- a/src/main/utils/exec.ts +++ b/src/main/utils/exec.ts @@ -6,8 +6,6 @@ import shellEnv from 'shell-env'; /** * On macOS & Linux, we need to fix the $PATH environment variable * so that we can call `npm`. - * - * @returns {Promise} */ export const maybeFixPath = (() => { // Singleton: We don't want to do this more than once. @@ -31,10 +29,6 @@ export const maybeFixPath = (() => { /** * Execute a command in a directory. - * - * @param {string} dir - * @param {string} cliArgs - * @returns {Promise} */ export async function exec(dir: string, cliArgs: string): Promise { await maybeFixPath(); diff --git a/src/main/utils/get-project-name.ts b/src/main/utils/get-project-name.ts index d69f827fc1..3b388e6ffe 100644 --- a/src/main/utils/get-project-name.ts +++ b/src/main/utils/get-project-name.ts @@ -4,9 +4,6 @@ import * as namor from 'namor'; /** * Returns a name for this project - * - * @param {string} [localPath] - * @returns {string} */ export function getProjectName(localPath?: string): string { if (localPath) { diff --git a/src/main/utils/get-username.ts b/src/main/utils/get-username.ts index dd3cbd89eb..aab5a2e534 100644 --- a/src/main/utils/get-username.ts +++ b/src/main/utils/get-username.ts @@ -2,9 +2,6 @@ import * as os from 'node:os'; /** * Returns the current username - * - * @export - * @returns {string} */ export const getUsername = (() => { let username = ''; diff --git a/src/main/utils/read-fiddle.ts b/src/main/utils/read-fiddle.ts index 6893bd67f5..cffd8924fe 100644 --- a/src/main/utils/read-fiddle.ts +++ b/src/main/utils/read-fiddle.ts @@ -8,9 +8,7 @@ import { ensureRequiredFiles, isSupportedFile } from '../../utils/editor-utils'; /** * Reads a Fiddle from a directory. * - * @param {string} folder - * @param {boolean} includePackageJson - * @returns {Promise} the loaded Fiddle + * @returns the loaded Fiddle */ export async function readFiddle( folder: string, diff --git a/src/main/versions.ts b/src/main/versions.ts index 00b60f48a4..2e47dbd15b 100644 --- a/src/main/versions.ts +++ b/src/main/versions.ts @@ -17,8 +17,8 @@ let knownVersions: ElectronVersions; * This way when we have a local version of Electron like '999.0.0' * we'll know to not try & download 999-x-y.zip from GitHub :D * - * @param {number} major - Electron major version number - * @returns {boolean} true if there are releases with that major version + * @param major - Electron major version number + * @returns true if there are releases with that major version */ export function isReleasedMajor(major: number): boolean { return knownVersions.inMajor(major).length > 0; @@ -52,9 +52,6 @@ export function getReleasedVersions(): Array { /** * Gets the current state of a specific version * Valid local electron builds are marked as `installed` - * - * @param {Version} ver - * @returns {InstallState} */ export function getLocalVersionState(ver: Version): InstallState { const { localPath } = ver; diff --git a/src/main/windows.ts b/src/main/windows.ts index b569516922..3c40b56ad4 100644 --- a/src/main/windows.ts +++ b/src/main/windows.ts @@ -35,8 +35,6 @@ export function safelyOpenWebURL(url: string) { /** * Gets default options for the main window - * - * @returns {Electron.BrowserWindowConstructorOptions} */ export function getMainWindowOptions(): Electron.BrowserWindowConstructorOptions { const HEADER_COMMANDS_HEIGHT = 50; @@ -66,9 +64,6 @@ export function getMainWindowOptions(): Electron.BrowserWindowConstructorOptions /** * Creates a new main window. - * - * @export - * @returns {Electron.BrowserWindow} */ export function createMainWindow(): Electron.BrowserWindow { console.log(`Creating main window`); @@ -121,8 +116,6 @@ export function createMainWindow(): Electron.BrowserWindow { /** * Gets or creates the main window, returning it in both cases. - * - * @returns {Promise} */ export async function getOrCreateMainWindow(): Promise { await mainIsReadyPromise; diff --git a/src/renderer/app.tsx b/src/renderer/app.tsx index 3aa9b6b7d6..b443913cae 100644 --- a/src/renderer/app.tsx +++ b/src/renderer/app.tsx @@ -24,8 +24,6 @@ import '../less/root.less'; /** * The top-level class controlling the whole app. This is *not* a React component, * but it does eventually render all components. - * - * @class App */ export class App { public state = new AppState(getElectronVersions()); @@ -82,8 +80,6 @@ export class App { /** * Retrieves the contents of all editor panes. - * - * @returns {EditorValues} */ public async getEditorValues( options?: PackageJsonOptions, @@ -202,7 +198,7 @@ export class App { /** * Opens a fiddle from the specified location. * - * @param {SetFiddleOptions} fiddle The fiddle to open + * @param fiddle - The fiddle to open */ public async openFiddle(fiddle: SetFiddleOptions) { const { localFiddle, gistId } = fiddle; @@ -218,9 +214,6 @@ export class App { /** * Loads theme CSS into the HTML document. - * - * @param {string} name - * @returns {Promise} */ public async loadTheme(name: string): Promise { const tag: HTMLStyleElement | null = diff --git a/src/renderer/components/commands-action-button.tsx b/src/renderer/components/commands-action-button.tsx index bc53b353f1..52618e3030 100644 --- a/src/renderer/components/commands-action-button.tsx +++ b/src/renderer/components/commands-action-button.tsx @@ -36,10 +36,6 @@ interface IGistActionButtonState { /** * The "publish" button takes care of logging you in. - * - * @export - * @class GistActionButton - * @extends {React.Component} */ export const GistActionButton = observer( class GistActionButton extends React.Component< @@ -85,9 +81,6 @@ export const GistActionButton = observer( * If we're showing the authentication dialog, we wait for it * to be closed again (or a GitHub token to show up) before * we publish - * - * @returns {Promise} - * @memberof GistActionButton */ public async handleClick(): Promise { const { appState } = this.props; @@ -306,8 +299,6 @@ export const GistActionButton = observer( /** * Publish fiddles as private. - * - * @memberof GistActionButton */ public setPrivate() { this.setPrivacy(false); @@ -315,8 +306,6 @@ export const GistActionButton = observer( /** * Publish fiddles as public. - * - * @memberof GistActionButton */ public setPublic() { this.setPrivacy(true); diff --git a/src/renderer/components/commands-address-bar.tsx b/src/renderer/components/commands-address-bar.tsx index 2e3a45d159..4eec2e881d 100644 --- a/src/renderer/components/commands-address-bar.tsx +++ b/src/renderer/components/commands-address-bar.tsx @@ -48,8 +48,6 @@ export const AddressBar = observer( /** * Handle the form's submit event, trying to load whatever * URL was entered. - * - * @param {React.SyntheticEvent} event */ private handleSubmit(event: React.SyntheticEvent) { event.preventDefault(); @@ -58,8 +56,6 @@ export const AddressBar = observer( /** * Commit the address bar's value to app state and load the fiddle. - * - * @memberof AddressBar */ private submit() { const { remoteLoader } = window.app; @@ -91,8 +87,6 @@ export const AddressBar = observer( /** * Handle the change event, which usually just updates the address bar's value - * - * @param {React.ChangeEvent} event */ private handleChange(event: React.ChangeEvent) { this.setState({ value: event.target.value }); diff --git a/src/renderer/components/commands-runner.tsx b/src/renderer/components/commands-runner.tsx index 7e709ed7b6..e2fdd124ae 100644 --- a/src/renderer/components/commands-runner.tsx +++ b/src/renderer/components/commands-runner.tsx @@ -13,9 +13,6 @@ interface RunnerProps { /** * The runner component is responsible for actually launching the fiddle * with Electron. It also renders the button that does so. - * - * @class Runner - * @extends {React.Component} */ export const Runner = observer( class Runner extends React.Component { diff --git a/src/renderer/components/commands.tsx b/src/renderer/components/commands.tsx index 05f2218555..86292d2b38 100644 --- a/src/renderer/components/commands.tsx +++ b/src/renderer/components/commands.tsx @@ -18,9 +18,6 @@ interface CommandsProps { /** * The command bar, containing all the buttons doing * all the things - * - * @class Commands - * @extends {React.Component} */ export const Commands = observer( class Commands extends React.Component { diff --git a/src/renderer/components/dialog-add-theme.tsx b/src/renderer/components/dialog-add-theme.tsx index bc3e0ff307..259da6ceff 100644 --- a/src/renderer/components/dialog-add-theme.tsx +++ b/src/renderer/components/dialog-add-theme.tsx @@ -18,9 +18,6 @@ interface AddThemeDialogState { /** * The "add monaco theme" dialog allows users to add custom editor themes. - * - * @class AddThemeDialog - * @extends {React.Component} */ export const AddThemeDialog = observer( class AddThemeDialog extends React.Component< @@ -40,8 +37,6 @@ export const AddThemeDialog = observer( /** * Handles a change of the file input. - * - * @param {React.ChangeEvent} event */ public async onChangeFile(event: React.FormEvent) { const { files } = event.target as HTMLInputElement; @@ -52,8 +47,6 @@ export const AddThemeDialog = observer( /** * Handles the submission of the dialog. - * - * @returns {Promise} */ public async onSubmit(): Promise { const { file } = this.state; diff --git a/src/renderer/components/dialog-add-version.tsx b/src/renderer/components/dialog-add-version.tsx index 3e5bb0f2a2..120b9d7be1 100644 --- a/src/renderer/components/dialog-add-version.tsx +++ b/src/renderer/components/dialog-add-version.tsx @@ -31,9 +31,6 @@ interface AddVersionDialogState { /** * The "add version" dialog allows users to add custom builds of Electron. - * - * @class AddVersionDialog - * @extends {React.Component} */ export const AddVersionDialog = observer( class AddVersionDialog extends React.Component< @@ -74,8 +71,6 @@ export const AddVersionDialog = observer( /** * Handles a change of the file input - * - * @param {React.ChangeEvent} event */ public onChangeVersion(event: React.ChangeEvent) { const version = event.target.value || ''; @@ -89,8 +84,6 @@ export const AddVersionDialog = observer( /** * Handles the submission of the dialog - * - * @returns {Promise} */ public async onSubmit(): Promise { const { diff --git a/src/renderer/components/dialog-bisect.tsx b/src/renderer/components/dialog-bisect.tsx index fe06bfec68..69281ea599 100644 --- a/src/renderer/components/dialog-bisect.tsx +++ b/src/renderer/components/dialog-bisect.tsx @@ -21,9 +21,6 @@ interface BisectDialogState { /** * The "add version" dialog allows users to add custom builds of Electron. - * - * @class BisectDialog - * @extends {React.Component} */ export const BisectDialog = observer( class BisectDialog extends React.Component< @@ -68,8 +65,6 @@ export const BisectDialog = observer( /** * Handles the submission of the dialog - * - * @returns {Promise} */ public async onSubmit(): Promise { const range = this.getBisectRange(); @@ -239,9 +234,6 @@ export const BisectDialog = observer( /** * Should an item in the "earliest version" dropdown be disabled? - * - * @param {RunnableVersion} version - * @returns {boolean} */ public isEarliestItemDisabled(version: RunnableVersion): boolean { const { allVersions, endIndex } = this.state; @@ -256,9 +248,6 @@ export const BisectDialog = observer( /** * Should an item in the "latest version" dropdown be disabled? - * - * @param {RunnableVersion} version - * @returns {boolean} */ public isLatestItemDisabled(version: RunnableVersion): boolean { const { allVersions, startIndex } = this.state; diff --git a/src/renderer/components/dialog-generic.tsx b/src/renderer/components/dialog-generic.tsx index 0ec10936d1..8916aed7f6 100644 --- a/src/renderer/components/dialog-generic.tsx +++ b/src/renderer/components/dialog-generic.tsx @@ -12,10 +12,6 @@ interface GenericDialogProps { /** * The token dialog prompts the user to either continue or cancel the operation. - * - * @export - * @class GenericDialog - * @extends {React.Component} */ export const GenericDialog = observer( class GenericDialog extends React.Component { diff --git a/src/renderer/components/dialog-token.tsx b/src/renderer/components/dialog-token.tsx index b2cf2f13f9..e0c13ab035 100644 --- a/src/renderer/components/dialog-token.tsx +++ b/src/renderer/components/dialog-token.tsx @@ -25,10 +25,6 @@ const TOKEN_PATTERN = /** * The token dialog asks the user for a GitHub Personal Access Token. * It's also responsible for checking if the token is correct. - * - * @export - * @class TokenDialog - * @extends {React.Component} */ export const TokenDialog = observer( class TokenDialog extends React.Component< @@ -54,9 +50,6 @@ export const TokenDialog = observer( /** * Handles the submission of a token - * - * @returns {Promise} - * @memberof TokenDialog */ public async onSubmitToken(): Promise { if (!this.state.tokenInput) return; @@ -102,8 +95,6 @@ export const TokenDialog = observer( /** * Opens GitHub's page for token generation - * - * @memberof TokenDialog */ public openGenerateTokenExternal() { window.open(GENERATE_TOKEN_URL); @@ -112,9 +103,6 @@ export const TokenDialog = observer( /** * When the input field receives focus, we check the clipboard. * Maybe there's already something token-like there! - * - * @returns - * @memberof TokenDialog */ public async onTokenInputFocused() { const text = ((await navigator.clipboard.readText()) || '').trim(); @@ -126,9 +114,6 @@ export const TokenDialog = observer( /** * Handle the change event, which usually just updates the address bar's value - * - * @param {React.ChangeEvent} event - * @memberof AddressBar */ public handleChange(event: React.ChangeEvent) { this.setState({ tokenInput: event.target.value }); diff --git a/src/renderer/components/dialogs.tsx b/src/renderer/components/dialogs.tsx index 465d1f4a5b..b163fbd6e5 100644 --- a/src/renderer/components/dialogs.tsx +++ b/src/renderer/components/dialogs.tsx @@ -16,9 +16,6 @@ interface DialogsProps { /** * Dialogs (like the GitHub PAT input). - * - * @class Dialogs - * @extends {React.Component} */ export const Dialogs = observer( class Dialogs extends React.Component { diff --git a/src/renderer/components/editor.tsx b/src/renderer/components/editor.tsx index 8e527c9eb7..a6707b1376 100644 --- a/src/renderer/components/editor.tsx +++ b/src/renderer/components/editor.tsx @@ -50,8 +50,6 @@ export class Editor extends React.Component { /** * Handle the editor having been mounted. This refers to Monaco's * mount, not React's. - * - * @param {MonacoType.editor.IStandaloneCodeEditor} editor */ public async editorDidMount(editor: MonacoType.editor.IStandaloneCodeEditor) { const { appState, editorDidMount, id } = this.props; @@ -121,8 +119,6 @@ export class Editor extends React.Component { /** * Implements external url handling for Monaco. - * - * @returns {MonacoType.editor.IOpenerService} */ private openerService() { const { appState } = this.props; diff --git a/src/renderer/components/editors.tsx b/src/renderer/components/editors.tsx index 07be780a27..b8bbcf934d 100644 --- a/src/renderer/components/editors.tsx +++ b/src/renderer/components/editors.tsx @@ -54,8 +54,6 @@ export const Editors = observer( /** * Executed right after the component mounts. We'll setup the IPC listeners here. - * - * @memberof Editors */ public async componentDidMount() { this.stopListening(); @@ -135,9 +133,6 @@ export const Editors = observer( /** * Attempt to execute a given commandId on the currently focused editor - * - * @param {string} commandId - * @memberof Editors */ public executeCommand(commandId: string) { const editor = this.props.appState.editorMosaic.focusedEditor(); @@ -179,10 +174,6 @@ export const Editors = observer( /** * Renders the little tool bar on top of each panel - * - * @param {MosaicWindowProps} { title } - * @param {EditorId} id - * @returns {JSX.Element} */ public renderToolbar( { title }: MosaicWindowProps, @@ -209,10 +200,6 @@ export const Editors = observer( /** * Renders a Mosaic tile - * - * @param {EditorId} id - * @param {Array} path - * @returns {JSX.Element} */ public renderTile(id: EditorId, path: Array): JSX.Element { const content = this.renderEditor(id); @@ -234,10 +221,6 @@ export const Editors = observer( /** * Render an editor - * - * @param {EditorId} id - * @returns {(JSX.Element | null)} - * @memberof Editors */ public renderEditor(id: EditorId): JSX.Element | null { const { appState } = this.props; @@ -270,8 +253,6 @@ export const Editors = observer( /** * Handles a change in the visible nodes - * - * @param {(MosaicNode | null)} currentNode */ public onChange(currentNode: MosaicNode | null) { this.props.appState.editorMosaic.mosaic = currentNode; @@ -281,7 +262,6 @@ export const Editors = observer( * Sets the currently-focused editor. This will impact the editor's * z-index, ensuring that its intellisense menus don't get clipped * by the other editor windows. - * @param {EditorId} id */ public setFocused(id: EditorId): void { this.props.appState.editorMosaic.setFocusedFile(id); diff --git a/src/renderer/components/header.tsx b/src/renderer/components/header.tsx index 2566a1b668..176aa00fdd 100644 --- a/src/renderer/components/header.tsx +++ b/src/renderer/components/header.tsx @@ -14,9 +14,6 @@ interface HeaderState { /** * Everything above the editors, so buttons and the address bar. - * - * @class Header - * @extends {React.Component} */ export class Header extends React.Component { constructor(props: HeaderProps) { diff --git a/src/renderer/components/output.tsx b/src/renderer/components/output.tsx index a90e965301..9185929e81 100644 --- a/src/renderer/components/output.tsx +++ b/src/renderer/components/output.tsx @@ -24,9 +24,6 @@ interface CommandsProps { /** * This component represents the "console" that is shown * whenever a Fiddle is launched in Electron. - * - * @class Output - * @extends {React.Component} */ export const Output = observer( class Output extends React.Component { @@ -114,7 +111,7 @@ export const Output = observer( * or a leaf. Leaf nodes are represented by the string value of their ID, * whereas parent nodes are objects containing information about the nested * binary tree. - * @param node A react-mosaic node + * @param node - A react-mosaic node * @returns Whether that node is a MosaicParent or not */ const isParentNode = ( @@ -158,9 +155,6 @@ export const Output = observer( /** * Sets the model and content on the editor - * - * @private - * @memberof Output */ private async updateModel() { // set the lines @@ -181,9 +175,8 @@ export const Output = observer( * An OutputEntry might span multiple lines. * Split it into individual lines to ensure each one has a timestamp. * - * @param {OutputEntry} entries that may include paragraphs - * @returns {OutputEntry} single-line entries - * @memberof Output + * @param entries - that may include paragraphs + * @returns single-line entries */ private static getLines(paragraphs: OutputEntry[]): OutputEntry[] { const lines: OutputEntry[] = []; @@ -201,8 +194,6 @@ export const Output = observer( /** * Implements external url handling for Monaco. - * - * @returns {MonacoType.editor.IOpenerService} */ private openerService() { const { appState } = this.props; diff --git a/src/renderer/components/settings-credits.tsx b/src/renderer/components/settings-credits.tsx index 3a522b80ef..132a08d03d 100644 --- a/src/renderer/components/settings-credits.tsx +++ b/src/renderer/components/settings-credits.tsx @@ -17,9 +17,6 @@ interface CreditsSettingsState { /** * Settings content to manage Credits-related preferences. - * - * @class CreditsSettings - * @extends {React.Component} */ export class CreditsSettings extends React.Component< CreditsSettingsProps, @@ -35,8 +32,6 @@ export class CreditsSettings extends React.Component< /** * Renders a list of contributors of Electron Fiddle. - * - * @returns {Array} */ public renderContributors(): Array { const { contributors } = this.state; diff --git a/src/renderer/components/settings-electron.tsx b/src/renderer/components/settings-electron.tsx index 2863630e25..d38139b72d 100644 --- a/src/renderer/components/settings-electron.tsx +++ b/src/renderer/components/settings-electron.tsx @@ -32,9 +32,6 @@ interface ElectronSettingsProps { /** * Settings content to manage Electron-related preferences. - * - * @class ElectronSettings - * @extends {React.Component} */ export const ElectronSettings = observer( class ElectronSettings extends React.Component { @@ -58,8 +55,6 @@ export const ElectronSettings = observer( /** * Toggles visibility of non-downloaded versions - * - * @param {React.FormEvent} event */ public handleStateChange(event: React.FormEvent) { const { appState } = this.props; @@ -69,8 +64,6 @@ export const ElectronSettings = observer( /** * Toggles visibility of obsolete versions - * - * @param {React.FormEvent} event */ public handleShowObsoleteChange(event: React.FormEvent) { const { appState } = this.props; @@ -80,8 +73,6 @@ export const ElectronSettings = observer( /** * Handles a change in which channels should be displayed. - * - * @param {React.FormEvent} event */ public handleChannelChange(event: React.FormEvent) { const { id, checked } = event.currentTarget; @@ -96,8 +87,6 @@ export const ElectronSettings = observer( /** * Download all visible versions of Electron. - * - * @returns {Promise} */ public async handleDownloadAll(): Promise { const { @@ -120,8 +109,6 @@ export const ElectronSettings = observer( /** * Delete all downloaded versions of Electron. - * - * @returns {Promise} */ public async handleDeleteAll(): Promise { const { versions, removeVersion, startDeletingAll, stopDeletingAll } = @@ -168,9 +155,6 @@ export const ElectronSettings = observer( /** * Renders the various buttons for advanced operations - * - * @private - * @returns {JSX.Element} */ private renderAdvancedButtons(): JSX.Element { const { isUpdatingElectronVersions, isDownloadingAll, isDeletingAll } = @@ -231,9 +215,6 @@ export const ElectronSettings = observer( /** * Renders the various options for which versions should be displayed - * - * @private - * @returns {JSX.Element} */ private renderVersionShowOptions(): JSX.Element { const { appState } = this.props; @@ -293,9 +274,6 @@ export const ElectronSettings = observer( /** * Renders the table with Electron versions. - * - * @private - * @returns {JSX.Element} */ private renderTable(): JSX.Element { return ( @@ -314,9 +292,6 @@ export const ElectronSettings = observer( /** * Renders the rows with Electron version, returning an Array. - * - * @private - * @returns {Array} */ private renderTableRows(): Array { return this.props.appState.versionsToShow.map((item) => ( @@ -330,9 +305,6 @@ export const ElectronSettings = observer( /** * Returns a human-readable state indicator for an Electron version. - * - * @param {RunnableVersion} item - * @returns {JSX.Element} */ private renderHumanState(item: RunnableVersion): JSX.Element { const { state, source } = item; @@ -359,10 +331,6 @@ export const ElectronSettings = observer( /** * Renders the action for a single Electron version. - * - * @private - * @param {RunnableVersion} ver - * @returns {JSX.Element} */ private renderAction(ver: RunnableVersion): JSX.Element { const { state, source, version } = ver; diff --git a/src/renderer/components/settings-execution.tsx b/src/renderer/components/settings-execution.tsx index ca8d3aed91..0ac5d7745e 100644 --- a/src/renderer/components/settings-execution.tsx +++ b/src/renderer/components/settings-execution.tsx @@ -30,9 +30,6 @@ interface ExecutionSettingsState { /** * Settings content to manage execution-related preferences. - * - * @class ExecutionSettings - * @extends {React.Component} */ export const ExecutionSettings = observer( class ExecutionSettings extends React.Component< @@ -80,8 +77,6 @@ export const ExecutionSettings = observer( /** * Handles a change on whether or not the user data dir should be deleted * after a run. - * - * @param {React.FormEvent} event */ public handleDeleteDataChange(event: React.FormEvent) { const { checked } = event.currentTarget; @@ -90,8 +85,6 @@ export const ExecutionSettings = observer( /** * Handles a change on whether or not electron should log more things - * - * @param {React.FormEvent} event */ public handleElectronLoggingChange( event: React.FormEvent, @@ -103,9 +96,6 @@ export const ExecutionSettings = observer( /** * Handles a change in the execution flags or environment variables * run with the Electron executable. - * - * @param {React.ChangeEvent} event - * @param {SettingItemType} type */ public handleSettingsItemChange( event: React.ChangeEvent, @@ -129,8 +119,6 @@ export const ExecutionSettings = observer( /** * Adds a new settings item input field. - * - * @param {SettingItemType} type */ private addNewSettingsItem(type: SettingItemType) { const array = Object.entries(this.state[type]); @@ -146,8 +134,6 @@ export const ExecutionSettings = observer( /** * Handle a change to the package manager used to install modules when running * Fiddles; - * - * @param {React.FormEvent} event */ private handlePMChange = (event: React.FormEvent) => { const { appState } = this.props; diff --git a/src/renderer/components/settings-general-appearance.tsx b/src/renderer/components/settings-general-appearance.tsx index aa3f4e7f46..ca5154e700 100644 --- a/src/renderer/components/settings-general-appearance.tsx +++ b/src/renderer/components/settings-general-appearance.tsx @@ -21,10 +21,6 @@ const ThemeSelect = Select.ofType(); /** * Helper method: Returns the for Electron * versions. - * - * @param {RunnableVersion} item - * @param {IItemRendererProps} { handleClick, modifiers, query } - * @returns */ export const renderItem: ItemRenderer = ( item, @@ -73,9 +65,6 @@ interface AppearanceSettingsState { /** * Settings content to manage appearance-related preferences. - * - * @class AppearanceSettings - * @extends {React.Component} */ export const AppearanceSettings = observer( class AppearanceSettings extends React.Component< @@ -119,8 +108,6 @@ export const AppearanceSettings = observer( /** * Handle change, which usually means that we'd like update * the current theme. - * - * @param {LoadedFiddleTheme} theme */ public handleChange(theme: LoadedFiddleTheme) { this.setState({ selectedTheme: theme }); @@ -129,9 +116,6 @@ export const AppearanceSettings = observer( /** * Creates a new theme from the current template. - * - * @returns {Promise} - * @memberof AppearanceSettings */ public async createNewThemeFromCurrent(): Promise { const { appState } = this.props; @@ -154,8 +138,6 @@ export const AppearanceSettings = observer( /** * Creates the themes folder in .electron-fiddle if one does not * exist yet, then shows that folder in the Finder/Explorer. - * - * @returns {Promise} */ public async openThemeFolder(): Promise { try { diff --git a/src/renderer/components/settings-general-block-accelerators.tsx b/src/renderer/components/settings-general-block-accelerators.tsx index 028b30b66c..01d42186ab 100644 --- a/src/renderer/components/settings-general-block-accelerators.tsx +++ b/src/renderer/components/settings-general-block-accelerators.tsx @@ -12,9 +12,6 @@ interface BlockAcceleratorsSettingsProps { /** * Settings content to block keyboard accelerators. - * - * @class BlockAcceleratorsSettings - * @extends {React.Component} */ export const BlockAcceleratorsSettings = observer( class BlockAcceleratorsSettings extends React.Component { @@ -28,8 +25,6 @@ export const BlockAcceleratorsSettings = observer( /** * Handles a change on whether a keyboard shortcut should be blocked * before fiddle is executed. - * - * @param {React.FormEvent} event */ public handleBlockAcceleratorChange( event: React.FormEvent, diff --git a/src/renderer/components/settings-general-console.tsx b/src/renderer/components/settings-general-console.tsx index 96785850eb..55bc74dbf8 100644 --- a/src/renderer/components/settings-general-console.tsx +++ b/src/renderer/components/settings-general-console.tsx @@ -11,9 +11,6 @@ interface ConsoleSettingsProps { /** * Settings content to manage console-related preferences. - * - * @class ConsoleSettings - * @extends {React.Component} */ export const ConsoleSettings = observer( class ConsoleSettings extends React.Component { @@ -26,8 +23,6 @@ export const ConsoleSettings = observer( /** * Handles a change on whether or not the console should be cleared * before fiddle is executed. - * - * @param {React.FormEvent} event */ public handleClearOnRunChange(event: React.FormEvent) { const { checked } = event.currentTarget; diff --git a/src/renderer/components/settings-general-font.tsx b/src/renderer/components/settings-general-font.tsx index b1cd5f04fd..d9410dd0e0 100644 --- a/src/renderer/components/settings-general-font.tsx +++ b/src/renderer/components/settings-general-font.tsx @@ -16,9 +16,6 @@ interface FontSettingsState { /** * Settings font family and size. - * - * @class FontSettings - * @extends {React.Component} */ @observer export class FontSettings extends React.Component< @@ -39,8 +36,6 @@ export class FontSettings extends React.Component< /** * Handles a change in the editor font family. - * - * @param {React.FormEvent} event */ public handleSetFontFamily(event: React.FormEvent): void { const { value: fontFamily } = event.currentTarget; @@ -50,8 +45,6 @@ export class FontSettings extends React.Component< /** * Handles a change in the editor font size. - * - * @param {React.FormEvent} event */ public handleSetFontSize(event: React.FormEvent): void { const parsedFontSize = parseInt(event.currentTarget.value, 10); diff --git a/src/renderer/components/settings-general-github.tsx b/src/renderer/components/settings-general-github.tsx index 43016ccd28..ddd6949fb6 100644 --- a/src/renderer/components/settings-general-github.tsx +++ b/src/renderer/components/settings-general-github.tsx @@ -11,9 +11,6 @@ interface GitHubSettingsProps { /** * Settings content to manage GitHub-related preferences. - * - * @class GitHubSettings - * @extends {React.Component} */ export const GitHubSettings = observer( class GitHubSettings extends React.Component { @@ -31,8 +28,6 @@ export const GitHubSettings = observer( /** * Render the "logged out" settings experience. - * - * @returns {JSX.Element} */ public renderNotSignedIn(): JSX.Element { return ( @@ -48,8 +43,6 @@ export const GitHubSettings = observer( /** * Render the "logged in" settings experience. - * - * @returns {JSX.Element} */ public renderSignedIn(): JSX.Element { const { gitHubLogin } = this.props.appState; @@ -70,8 +63,6 @@ export const GitHubSettings = observer( /** * Handles a change on whether or not the gist should be published * as a revision on top of the default fiddle gist. - * - * @param {React.FormEvent} event */ public handlePublishGistAsRevisionChange( event: React.FormEvent, diff --git a/src/renderer/components/settings-general-mirror.tsx b/src/renderer/components/settings-general-mirror.tsx index ad0cff2260..bb942413e2 100644 --- a/src/renderer/components/settings-general-mirror.tsx +++ b/src/renderer/components/settings-general-mirror.tsx @@ -15,9 +15,6 @@ type IMirrorSettingsState = Mirrors; /** * Settings electron mirror - * - * @class MirrorSettings - * @extends {React.Component} */ export const MirrorSettings = observer( class MirrorSettings extends React.Component< diff --git a/src/renderer/components/settings-general-package-author.tsx b/src/renderer/components/settings-general-package-author.tsx index 34a0cf3532..1035ead6dc 100644 --- a/src/renderer/components/settings-general-package-author.tsx +++ b/src/renderer/components/settings-general-package-author.tsx @@ -15,9 +15,6 @@ interface IPackageAuthorSettingsState { /** * Settings package.json author info - * - * @class PackageAuthorSettings - * @extends {React.Component} */ export const PackageAuthorSettings = observer( class PackageAuthorSettings extends React.Component< @@ -37,8 +34,6 @@ export const PackageAuthorSettings = observer( /** * Set the author information in package.json when processing uploads to gist - * - * @param {React.ChangeEvent} event */ public handlePackageAuthorChange(event: React.FormEvent) { const { value } = event.currentTarget; diff --git a/src/renderer/components/settings-general.tsx b/src/renderer/components/settings-general.tsx index 5071f43666..25bf04eb7e 100644 --- a/src/renderer/components/settings-general.tsx +++ b/src/renderer/components/settings-general.tsx @@ -19,9 +19,6 @@ interface GeneralSettingsProps { /** * Settings content to manage GitHub-related preferences. - * - * @class GitHubSettings - * @extends {React.Component} */ export const GeneralSettings = observer( class GeneralSettings extends React.Component { diff --git a/src/renderer/components/settings.tsx b/src/renderer/components/settings.tsx index df81d6d701..cb4e4e8694 100644 --- a/src/renderer/components/settings.tsx +++ b/src/renderer/components/settings.tsx @@ -34,9 +34,6 @@ interface SettingsState { /** * Everything above the editors, so buttons and the address bar. - * - * @class Settings - * @extends {React.Component} */ export const Settings = observer( class Settings extends React.Component { @@ -65,8 +62,6 @@ export const Settings = observer( /** * Renders the content of the settings, usually by simply * return the appropriate component. - * - * @returns {(JSX.Element | null)} */ public renderContent(): JSX.Element | null { const { section } = this.state; @@ -98,8 +93,6 @@ export const Settings = observer( /** * Renders the individual menu items - * - * @returns {Array} */ public renderOptions(): Array { const { section } = this.state; @@ -147,10 +140,6 @@ export const Settings = observer( /** * Get the settings icons - * - * @param {SettingsSections} section - * @returns {IconName} - * @memberof Settings */ private getIconForSection(section: SettingsSections): IconName { if (section === SettingsSections.Credits) { @@ -167,8 +156,6 @@ export const Settings = observer( /** * Trigger closing of the settings panel upon Esc * If hasPopoverOpen is set to true, settings will not close as only the popover should close - * - * @param {KeyboardEvent} event */ private closeSettingsPanel(event: KeyboardEvent) { const { appState } = this.props; diff --git a/src/renderer/components/sidebar-package-manager.tsx b/src/renderer/components/sidebar-package-manager.tsx index 718b538399..d8103a3766 100644 --- a/src/renderer/components/sidebar-package-manager.tsx +++ b/src/renderer/components/sidebar-package-manager.tsx @@ -94,7 +94,6 @@ export class SidebarPackageManager extends React.Component { /** * Takes the module map and returns an object * conforming to the BlueprintJS tree schema. - * @returns TreeNodeInfo[] */ private getModuleNodes = (): TreeNodeInfo[] => { const values: TreeNodeInfo[] = []; diff --git a/src/renderer/components/tour-welcome.tsx b/src/renderer/components/tour-welcome.tsx index 22b79bdf85..94fd97697b 100644 --- a/src/renderer/components/tour-welcome.tsx +++ b/src/renderer/components/tour-welcome.tsx @@ -17,8 +17,6 @@ interface WelcomeTourState { /** * This is our "Welcome to Electron Fiddle" Tour. It includes both an intro to * the app and a short intro to Electron. - * - * @returns {Set} */ export function getWelcomeTour(): Set { return new Set([ @@ -175,10 +173,6 @@ export function getWelcomeTour(): Set { /** * The "Welcome to Electron Fiddle" Tour. - * - * @export - * @class WelcomeTour - * @extends {React.Component} */ export const WelcomeTour = observer( class WelcomeTour extends React.Component< diff --git a/src/renderer/components/tour.tsx b/src/renderer/components/tour.tsx index 978e4d40d9..6b47ee2eb3 100644 --- a/src/renderer/components/tour.tsx +++ b/src/renderer/components/tour.tsx @@ -104,9 +104,6 @@ export class Tour extends React.Component { * Return buttons for the dialog for the current step * of the tour. By default, we just return a continue/stop * combo - * - * @param {TourScriptStep} { getButtons } - * @returns {Array} */ private getButtons({ getButtons }: TourScriptStep): Array { // Did the step bring its own buttons? @@ -145,10 +142,6 @@ export class Tour extends React.Component { /** * Renders the dialog for the current step of the tour. - * - * @param {TourScriptStep} step - * @param {ClientRect} rect - * @returns {JSX.Element} */ private getDialogForStep( step: TourScriptStep, @@ -188,9 +181,6 @@ export class Tour extends React.Component { /** * Returns the "mask" for a given step. - * - * @param {TourScriptStep} step - * @returns {(JSX.Element | null)} */ private getStep(step: TourScriptStep): JSX.Element | null { const { selector } = step; diff --git a/src/renderer/components/version-select.tsx b/src/renderer/components/version-select.tsx index 7e9f1b478b..9eb8a718ba 100644 --- a/src/renderer/components/version-select.tsx +++ b/src/renderer/components/version-select.tsx @@ -61,9 +61,6 @@ const itemListRenderer: ItemListRenderer = ({ /** * Helper method: Returns the icon for an Electron * version. - * - * @param {RunnableVersion} { state } - * @returns {IconName} */ export function getItemIcon({ source, state }: RunnableVersion): IconName { // If a version is local, either it's there or it's not. @@ -114,10 +108,6 @@ export function getItemIcon({ source, state }: RunnableVersion): IconName { * [3.0.0, 14.3.0, 13.2.0, 12.0.0-nightly.20210301, 12.0.0-beta.3] * and a search query of '3', this method would sort them into: * [3.0.0, 13.2.0, 14.3.0, 12.0.0-beta.3, 12.0.0-nightly.20210301] - * - * @param {string} query - * @param {RunnableVersion[]} versions - * @returns */ export const filterItems: ItemListPredicate = ( query, @@ -153,8 +143,7 @@ export const filterItems: ItemListPredicate = ( /** * Renders a context menu to copy the current Electron version. * - * @param {React.MouseEvent} e - * @param {string} version the Electron version number to copy. + * @param version - the Electron version number to copy. */ export const renderVersionContextMenu = ( e: React.MouseEvent, @@ -178,10 +167,6 @@ export const renderVersionContextMenu = ( /** * Helper method: Returns the