Skip to content

Commit

Permalink
patch: bump @balena/lint to 8.0.2 and fix formating
Browse files Browse the repository at this point in the history
  • Loading branch information
aethernet committed Apr 25, 2024
1 parent 0642611 commit 4aa4140
Show file tree
Hide file tree
Showing 34 changed files with 1,530 additions and 896 deletions.
2 changes: 1 addition & 1 deletion forge.sidecar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PluginBase } from '@electron-forge/plugin-base';
import {
import type {
ForgeHookMap,
ResolvedForgeConfig,
} from '@electron-forge/shared-types';
Expand Down
7 changes: 4 additions & 3 deletions lib/gui/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@

import * as electron from 'electron';
import * as remote from '@electron/remote';
import { debounce, capitalize, Dictionary, values } from 'lodash';
import type { Dictionary } from 'lodash';
import { debounce, capitalize, values } from 'lodash';
import outdent from 'outdent';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { v4 as uuidV4 } from 'uuid';

import * as packageJSON from '../../../package.json';
import { DrivelistDrive } from '../../shared/drive-constraints';
import type { DrivelistDrive } from '../../shared/drive-constraints';
import * as EXIT_CODES from '../../shared/exit-codes';
import * as messages from '../../shared/messages';
import * as availableDrives from './models/available-drives';
Expand All @@ -38,7 +39,7 @@ import * as windowProgress from './os/window-progress';
import MainPage from './pages/main/MainPage';
import './css/main.css';
import * as i18next from 'i18next';
import { SourceMetadata } from '../../shared/typings/source-selector';
import type { SourceMetadata } from '../../shared/typings/source-selector';

window.addEventListener(
'unhandledrejection',
Expand Down
21 changes: 10 additions & 11 deletions lib/gui/app/components/drive-selector/drive-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,19 @@

import ExclamationTriangleSvg from '@fortawesome/fontawesome-free/svgs/solid/triangle-exclamation.svg';
import ChevronDownSvg from '@fortawesome/fontawesome-free/svgs/solid/chevron-down.svg';
import * as sourceDestination from 'etcher-sdk/build/source-destination/';
import type * as sourceDestination from 'etcher-sdk/build/source-destination/';
import * as React from 'react';
import { Flex, ModalProps, Txt, Badge, Link, TableColumn } from 'rendition';
import type { ModalProps, TableColumn } from 'rendition';
import { Flex, Txt, Badge, Link } from 'rendition';
import styled from 'styled-components';

import type {
DriveStatus,
DrivelistDrive,
} from '../../../../shared/drive-constraints';
import {
getDriveImageCompatibilityStatuses,
isDriveValid,
DriveStatus,
DrivelistDrive,
isDriveSizeLarge,
} from '../../../../shared/drive-constraints';
import { compatibility, warning } from '../../../../shared/messages';
Expand All @@ -35,14 +38,10 @@ import { getImage, isDriveSelected } from '../../models/selection-state';
import { store } from '../../models/store';
import { logEvent, logException } from '../../modules/analytics';
import { open as openExternal } from '../../os/open-external/services/open-external';
import {
Alert,
GenericTableProps,
Modal,
Table,
} from '../../styled-components';
import type { GenericTableProps } from '../../styled-components';
import { Alert, Modal, Table } from '../../styled-components';

import { SourceMetadata } from '../../../../shared/typings/source-selector';
import type { SourceMetadata } from '../../../../shared/typings/source-selector';
import { middleEllipsis } from '../../utils/middle-ellipsis';
import * as i18next from 'i18next';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import ExclamationTriangleSvg from '@fortawesome/fontawesome-free/svgs/solid/triangle-exclamation.svg';
import * as React from 'react';
import { Badge, Flex, Txt, ModalProps } from 'rendition';
import type { ModalProps } from 'rendition';
import { Badge, Flex, Txt } from 'rendition';
import { Modal, ScrollableFlex } from '../../styled-components';
import { middleEllipsis } from '../../utils/middle-ellipsis';

import prettyBytes from 'pretty-bytes';
import { DriveWithWarnings } from '../../pages/main/Flash';
import type { DriveWithWarnings } from '../../pages/main/Flash';
import * as i18next from 'i18next';

const DriveStatusWarningModal = ({
Expand Down
3 changes: 2 additions & 1 deletion lib/gui/app/components/finish/finish.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import * as settings from '../../models/settings';
import { Actions, store } from '../../models/store';
import * as analytics from '../../modules/analytics';
import { FlashAnother } from '../flash-another/flash-another';
import { FlashResults, FlashError } from '../flash-results/flash-results';
import type { FlashError } from '../flash-results/flash-results';
import { FlashResults } from '../flash-results/flash-results';
import { SafeWebview } from '../safe-webview/safe-webview';

function restart(goToMain: () => void) {
Expand Down
3 changes: 2 additions & 1 deletion lib/gui/app/components/flash-results/flash-results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import CircleSvg from '@fortawesome/fontawesome-free/svgs/solid/circle.svg';
import CheckCircleSvg from '@fortawesome/fontawesome-free/svgs/solid/circle-check.svg';
import TimesCircleSvg from '@fortawesome/fontawesome-free/svgs/solid/circle-xmark.svg';
import * as React from 'react';
import { Flex, FlexProps, Link, TableColumn, Txt } from 'rendition';
import type { FlexProps, TableColumn } from 'rendition';
import { Flex, Link, Txt } from 'rendition';
import styled from 'styled-components';

import { progress } from '../../../../shared/messages';
Expand Down
9 changes: 5 additions & 4 deletions lib/gui/app/components/source-selector/source-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ import LinkSvg from '@fortawesome/fontawesome-free/svgs/solid/link.svg';
import ExclamationTriangleSvg from '@fortawesome/fontawesome-free/svgs/solid/triangle-exclamation.svg';
import ChevronDownSvg from '@fortawesome/fontawesome-free/svgs/solid/chevron-down.svg';
import ChevronRightSvg from '@fortawesome/fontawesome-free/svgs/solid/chevron-right.svg';
import { ipcRenderer, IpcRendererEvent } from 'electron';
import type { IpcRendererEvent } from 'electron';
import { ipcRenderer } from 'electron';
import { uniqBy, isNil } from 'lodash';
import * as path from 'path';
import prettyBytes from 'pretty-bytes';
import * as React from 'react';
import { requestMetadata } from '../../app';

import type { ButtonProps } from 'rendition';
import {
Flex,
ButtonProps,
Modal as SmallModal,
Txt,
Card as BaseCard,
Expand Down Expand Up @@ -63,9 +64,9 @@ import { SVGIcon } from '../svg-icon/svg-icon';
import ImageSvg from '../../../assets/image.svg';
import SrcSvg from '../../../assets/src.svg';
import { DriveSelector } from '../drive-selector/drive-selector';
import { DrivelistDrive } from '../../../../shared/drive-constraints';
import type { DrivelistDrive } from '../../../../shared/drive-constraints';
import { isJson } from '../../../../shared/utils';
import {
import type {
SourceMetadata,
Authentication,
Source,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@

import ExclamationTriangleSvg from '@fortawesome/fontawesome-free/svgs/solid/triangle-exclamation.svg';
import * as React from 'react';
import { Flex, FlexProps, Txt } from 'rendition';
import type { FlexProps } from 'rendition';
import { Flex, Txt } from 'rendition';

import {
getDriveImageCompatibilityStatuses,
DriveStatus,
} from '../../../../shared/drive-constraints';
import type { DriveStatus } from '../../../../shared/drive-constraints';
import { getDriveImageCompatibilityStatuses } from '../../../../shared/drive-constraints';
import { compatibility, warning } from '../../../../shared/messages';
import prettyBytes from 'pretty-bytes';
import { getImage, getSelectedDrives } from '../../models/selection-state';
Expand Down
8 changes: 3 additions & 5 deletions lib/gui/app/components/target-selector/target-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
import * as React from 'react';
import { Flex, Txt } from 'rendition';

import {
DriveSelector,
DriveSelectorProps,
} from '../drive-selector/drive-selector';
import type { DriveSelectorProps } from '../drive-selector/drive-selector';
import { DriveSelector } from '../drive-selector/drive-selector';
import {
isDriveSelected,
getImage,
Expand All @@ -36,7 +34,7 @@ import { TargetSelectorButton } from './target-selector-button';
import TgtSvg from '../../../assets/tgt.svg';
import DriveSvg from '../../../assets/drive.svg';
import { warning } from '../../../../shared/messages';
import { DrivelistDrive } from '../../../../shared/drive-constraints';
import type { DrivelistDrive } from '../../../../shared/drive-constraints';
import * as i18next from 'i18next';

export const getDriveListLabel = () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/app/models/available-drives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { DrivelistDrive } from '../../../shared/drive-constraints';
import type { DrivelistDrive } from '../../../shared/drive-constraints';
import { Actions, store } from './store';

export function hasAvailableDrives() {
Expand Down
4 changes: 2 additions & 2 deletions lib/gui/app/models/flash-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

import * as electron from 'electron';
import * as sdk from 'etcher-sdk';
import type * as sdk from 'etcher-sdk';
import * as _ from 'lodash';
import { DrivelistDrive } from '../../../shared/drive-constraints';
import type { DrivelistDrive } from '../../../shared/drive-constraints';
import { bytesToMegabytes } from '../../../shared/units';
import { Actions, store } from './store';

Expand Down
9 changes: 4 additions & 5 deletions lib/gui/app/models/leds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
*/

import * as _ from 'lodash';
import { Animator, AnimationFunction, Color, RGBLed } from 'sys-class-rgb-led';
import type { AnimationFunction, Color } from 'sys-class-rgb-led';
import { Animator, RGBLed } from 'sys-class-rgb-led';

import {
DrivelistDrive,
isSourceDrive,
} from '../../../shared/drive-constraints';
import type { DrivelistDrive } from '../../../shared/drive-constraints';
import { isSourceDrive } from '../../../shared/drive-constraints';
import { getDrives } from './available-drives';
import { getSelectedDrives } from './selection-state';
import * as settings from './settings';
Expand Down
4 changes: 2 additions & 2 deletions lib/gui/app/models/selection-state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DrivelistDrive } from '../../../shared/drive-constraints';
import type { DrivelistDrive } from '../../../shared/drive-constraints';
/*
* Copyright 2016 balena.io
*
Expand All @@ -15,7 +15,7 @@ import { DrivelistDrive } from '../../../shared/drive-constraints';
* limitations under the License.
*/

import { SourceMetadata } from '../../../shared/typings/source-selector';
import type { SourceMetadata } from '../../../shared/typings/source-selector';

import * as availableDrives from './available-drives';
import { Actions, store } from './store';
Expand Down
3 changes: 2 additions & 1 deletion lib/gui/app/modules/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
*/

import * as _ from 'lodash';
import { Client, createClient, createNoopClient } from 'analytics-client';
import type { Client } from 'analytics-client';
import { createClient, createNoopClient } from 'analytics-client';
import * as SentryRenderer from '@sentry/electron/renderer';
import * as settings from '../models/settings';
import { store } from '../models/store';
Expand Down
8 changes: 4 additions & 4 deletions lib/gui/app/modules/image-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

import { Drive as DrivelistDrive } from 'drivelist';
import * as sdk from 'etcher-sdk';
import { Dictionary } from 'lodash';
import type { Drive as DrivelistDrive } from 'drivelist';
import type * as sdk from 'etcher-sdk';
import type { Dictionary } from 'lodash';
import * as errors from '../../../shared/errors';
import { SourceMetadata } from '../../../shared/typings/source-selector';
import type { SourceMetadata } from '../../../shared/typings/source-selector';
import * as flashState from '../models/flash-state';
import * as selectionState from '../models/selection-state';
import * as settings from '../models/settings';
Expand Down
3 changes: 2 additions & 1 deletion lib/gui/app/os/window-progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import * as remote from '@electron/remote';

import { percentageToFloat } from '../../../shared/utils';
import { FlashState, titleFromFlashState } from '../modules/progress-status';
import type { FlashState } from '../modules/progress-status';
import { titleFromFlashState } from '../modules/progress-status';

/**
* @summary The title of the main window upon program launch
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/app/pages/main/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import FinishPage from '../../components/finish/finish';
import { ReducedFlashingInfos } from '../../components/reduced-flashing-infos/reduced-flashing-infos';
import { SettingsModal } from '../../components/settings/settings';
import { SourceSelector } from '../../components/source-selector/source-selector';
import { SourceMetadata } from '../../../../shared/typings/source-selector';
import type { SourceMetadata } from '../../../../shared/typings/source-selector';
import * as flashState from '../../models/flash-state';
import * as selectionState from '../../models/selection-state';
import * as settings from '../../models/settings';
Expand Down
8 changes: 5 additions & 3 deletions lib/gui/app/styled-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@
*/

import * as React from 'react';
import type {
FlexProps,
ButtonProps,
TableProps as BaseTableProps,
} from 'rendition';
import {
Alert as AlertBase,
Flex,
FlexProps,
Button,
ButtonProps,
Modal as ModalBase,
Provider,
Table as BaseTable,
TableProps as BaseTableProps,
Txt,
} from 'rendition';
import styled, { css } from 'styled-components';
Expand Down
2 changes: 1 addition & 1 deletion lib/gui/app/utils/etcher-pro-specific.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { Dictionary } from 'lodash';
import type { Dictionary } from 'lodash';

type BalenaTag = {
id: number;
Expand Down
4 changes: 2 additions & 2 deletions lib/shared/drive-constraints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

import { Drive } from 'drivelist';
import type { Drive } from 'drivelist';
import { isNil } from 'lodash';
import * as pathIsInside from 'path-is-inside';

import * as messages from './messages';
import { SourceMetadata } from './typings/source-selector';
import type { SourceMetadata } from './typings/source-selector';

/**
* @summary The default unknown size for things such as images and drives
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { Dictionary } from 'lodash';
import type { Dictionary } from 'lodash';
import { outdent } from 'outdent';
import prettyBytes from 'pretty-bytes';
import '../gui/app/i18n';
Expand Down
6 changes: 3 additions & 3 deletions lib/shared/typings/source-selector.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GPTPartition, MBRPartition } from 'partitioninfo';
import { sourceDestination } from 'etcher-sdk';
import { DrivelistDrive } from '../drive-constraints';
import type { GPTPartition, MBRPartition } from 'partitioninfo';
import type { sourceDestination } from 'etcher-sdk';
import type { DrivelistDrive } from '../drive-constraints';

export type Source = 'File' | 'BlockDevice' | 'Http';

Expand Down
9 changes: 5 additions & 4 deletions lib/util/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@
*/

import { WebSocketServer } from 'ws';
import { Dictionary, values } from 'lodash';
import type { Dictionary } from 'lodash';
import { values } from 'lodash';

import type { MultiDestinationProgress } from 'etcher-sdk/build/multi-write';

import { toJSON } from '../shared/errors';
import { GENERAL_ERROR, SUCCESS } from '../shared/exit-codes';
import { WriteOptions } from './types/types';
import type { WriteOptions } from './types/types';
import { write, cleanup } from './child-writer';
import { startScanning } from './scanner';
import { getSourceMetadata } from './source-metadata';
import { DrivelistDrive } from '../shared/drive-constraints';
import { SourceMetadata } from '../shared/typings/source-selector';
import type { DrivelistDrive } from '../shared/drive-constraints';
import type { SourceMetadata } from '../shared/typings/source-selector';

const ETCHER_SERVER_ADDRESS = process.env.ETCHER_SERVER_ADDRESS as string;
const ETCHER_SERVER_PORT = process.env.ETCHER_SERVER_PORT as string;
Expand Down
Loading

0 comments on commit 4aa4140

Please sign in to comment.