Skip to content

Commit

Permalink
eslint: imports: organize import groups
Browse files Browse the repository at this point in the history
  • Loading branch information
KKoukiou committed Mar 6, 2024
1 parent 316f366 commit 351683c
Show file tree
Hide file tree
Showing 26 changed files with 10 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"react/prop-types": "off",
"jsx-quotes": ["error", "prefer-double"],
"sort-imports": ["error", { "ignoreDeclarationSort": true }],
"import/order": [ 1, { "groups": ["external", "builtin", "internal", "sibling", "parent", "index"] } ],
"import/order": [ 1, { "groups": ["external", "builtin", ["internal", "sibling", "parent", "index"]], "newlines-between": "always" } ],
"quotes": ["error", "double" ]
},
"globals": {
Expand Down
1 change: 1 addition & 0 deletions src/apis/boss.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

import cockpit from "cockpit";

import { _callClient } from "./helpers.js";

const OBJECT_PATH = "/org/fedoraproject/Anaconda/Boss";
Expand Down
1 change: 1 addition & 0 deletions src/apis/payloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* along with This program; If not, see <http://www.gnu.org/licenses/>.
*/
import cockpit from "cockpit";

import { _callClient } from "./helpers.js";

const OBJECT_PATH = "/org/fedoraproject/Anaconda/Modules/Payloads";
Expand Down
1 change: 0 additions & 1 deletion src/apis/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
getDiskSelectionAction,
getPartitioningDataAction
} from "../actions/storage-actions.js";

import { debug } from "../helpers/log.js";

const INTERFACE_NAME = "org.fedoraproject.Anaconda.Modules.Storage";
Expand Down
1 change: 1 addition & 0 deletions src/apis/storage_bootloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* along with This program; If not, see <http://www.gnu.org/licenses/>.
*/
import cockpit from "cockpit";

import { StorageClient } from "./storage.js";
import { _setProperty } from "./helpers.js";

Expand Down
1 change: 1 addition & 0 deletions src/apis/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* along with This program; If not, see <http://www.gnu.org/licenses/>.
*/
import cockpit from "cockpit";

import { _callClient, _setProperty } from "./helpers.js";

const OBJECT_PATH = "/org/fedoraproject/Anaconda/Modules/Users";
Expand Down
3 changes: 0 additions & 3 deletions src/components/AnacondaHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
* along with This program; If not, see <http://www.gnu.org/licenses/>.
*/
import cockpit from "cockpit";

import React, { useEffect, useState } from "react";

import {
Flex,
Label,
Expand All @@ -28,7 +26,6 @@ import {
import { InfoCircleIcon } from "@patternfly/react-icons";

import { HeaderKebab } from "./HeaderKebab.jsx";

import { getIsFinal } from "../apis/runtime";

import "./AnacondaHeader.scss";
Expand Down
1 change: 0 additions & 1 deletion src/components/AnacondaWizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
import cockpit from "cockpit";
import React, { useContext, useEffect, useMemo, useState } from "react";

import {
ActionList,
Button,
Expand Down
1 change: 0 additions & 1 deletion src/components/Error.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import cockpit from "cockpit";
import React, { useContext, useEffect, useState } from "react";

import {
ActionList,
Button,
Expand Down
1 change: 0 additions & 1 deletion src/components/HeaderKebab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* along with This program; If not, see <http://www.gnu.org/licenses/>.
*/
import cockpit from "cockpit";

import React, { useContext, useEffect, useState } from "react";
import {
AboutModal,
Expand Down
1 change: 0 additions & 1 deletion src/components/Password.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import cockpit from "cockpit";
import React, { useEffect, useMemo, useState } from "react";
import { debounce } from "throttle-debounce";

import {
Button,
FormGroup,
Expand Down
8 changes: 1 addition & 7 deletions src/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,27 @@
* along with This program; If not, see <http://www.gnu.org/licenses/>.
*/
import cockpit from "cockpit";

import React, { useCallback, useEffect, useState } from "react";

import {
Bullseye,
Page, PageGroup,
} from "@patternfly/react-core";

import { read_os_release as readOsRelease } from "os-release.js";

import { WithDialogs } from "dialogs.jsx";
import { EmptyStatePanel } from "cockpit-components-empty-state";

import { AddressContext, LanguageContext, OsReleaseContext, SystemTypeContext, TargetSystemRootContext } from "./Common.jsx";
import { AnacondaHeader } from "./AnacondaHeader.jsx";
import { AnacondaWizard } from "./AnacondaWizard.jsx";
import { CriticalError, bugzillaPrefiledReportURL, errorHandlerWithContext } from "./Error.jsx";

import { BossClient } from "../apis/boss.js";
import { LocalizationClient, initDataLocalization, startEventMonitorLocalization } from "../apis/localization.js";
import { StorageClient, initDataStorage, startEventMonitorStorage } from "../apis/storage.js";
import { PayloadsClient } from "../apis/payloads";
import { RuntimeClient, initDataRuntime, startEventMonitorRuntime } from "../apis/runtime";
import { NetworkClient, initDataNetwork, startEventMonitorNetwork } from "../apis/network.js";
import { UsersClient } from "../apis/users";

import { setCriticalErrorAction, setCriticalErrorFrontendAction } from "../actions/miscellaneous-actions.js";

import { readConf } from "../helpers/conf.js";
import { debug } from "../helpers/log.js";
import { initialState, reducer, useReducerWithThunk } from "../reducer.js";
Expand Down
3 changes: 1 addition & 2 deletions src/components/installation/InstallationProgress.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ import {
InProgressIcon,
PendingIcon
} from "@patternfly/react-icons";

import { EmptyStatePanel } from "cockpit-components-empty-state.jsx";

import { Feedback } from "./Feedback.jsx";
import { OsReleaseContext, SystemTypeContext } from "../Common.jsx";

import { BossClient, getSteps, installWithTasks } from "../../apis/boss.js";
import { exitGui } from "../../helpers/exit.js";

Expand Down
3 changes: 0 additions & 3 deletions src/components/localization/InstallationLanguage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import React, { useEffect, useState } from "react";
import cockpit from "cockpit";

import {
Alert,
Divider,
Expand All @@ -35,11 +34,9 @@ import {

import { AddressContext, LanguageContext } from "../Common.jsx";
import { setLocale } from "../../apis/boss.js";

import {
setLanguage,
} from "../../apis/localization.js";

import {
convertToCockpitLang,
getLangCookie,
Expand Down
2 changes: 0 additions & 2 deletions src/components/review/ReviewConfiguration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
import cockpit from "cockpit";
import React, { useContext, useEffect, useState } from "react";

import {
Button,
DescriptionList, DescriptionListDescription,
Expand All @@ -32,7 +31,6 @@ import {
getPartitioningMethod,
getPartitioningRequest,
} from "../../apis/storage_partitioning.js";

import { getScenario } from "../storage/InstallationScenario.jsx";
import { OsReleaseContext } from "../Common.jsx";

Expand Down
1 change: 0 additions & 1 deletion src/components/review/StorageReview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
import cockpit from "cockpit";
import React from "react";

import {
List, ListItem,
Stack,
Expand Down
6 changes: 1 addition & 5 deletions src/components/storage/CockpitStorageIntegration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
import cockpit from "cockpit";
import React, { useEffect, useMemo, useState } from "react";

import {
ActionList,
Alert,
Expand All @@ -39,16 +38,14 @@ import {
Title,
} from "@patternfly/react-core";
import { ArrowLeftIcon } from "@patternfly/react-icons";

import { EmptyStatePanel } from "cockpit-components-empty-state";

import { checkConfiguredStorage, checkUseFreeSpace } from "./InstallationScenario.jsx";
import { useDiskFreeSpace, useDiskTotalSpace, useMountPointConstraints, useRequiredSize } from "./Common.jsx";

import {
runStorageTask,
scanDevicesWithTask,
} from "../../apis/storage.js";

import {
unlockDevice,
} from "../../apis/storage_devicetree.js";
Expand All @@ -65,7 +62,6 @@ import {
resetPartitioning,
setManualPartitioningRequests
} from "../../apis/storage_partitioning.js";

import { getDevicesAction } from "../../actions/storage-actions.js";
import { getDeviceNameByPath } from "../../helpers/storage.js";

Expand Down
1 change: 0 additions & 1 deletion src/components/storage/DiskEncryption.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import cockpit from "cockpit";
import React, { useEffect, useState } from "react";

import {
Checkbox,
EmptyState,
Expand Down
3 changes: 0 additions & 3 deletions src/components/storage/EncryptedDevices.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import cockpit from "cockpit";
import React, { useState } from "react";

import {
ActionList,
ActionListItem,
Expand All @@ -34,13 +33,11 @@ import {
StackItem, TextInput,
} from "@patternfly/react-core";
import { EyeIcon, EyeSlashIcon, LockIcon } from "@patternfly/react-icons";

import { EmptyStatePanel } from "cockpit-components-empty-state.jsx";
import { InlineNotification } from "cockpit-components-inline-notification.jsx";
import { FormHelper } from "cockpit-components-form-helper.jsx";

import { getDevicesAction } from "../../actions/storage-actions.js";

import {
unlockDevice,
} from "../../apis/storage_devicetree.js";
Expand Down
4 changes: 0 additions & 4 deletions src/components/storage/InstallationDestination.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
import cockpit from "cockpit";
import React, { useContext, useEffect, useRef, useState } from "react";

import {
Alert,
AlertActionCloseButton,
Expand Down Expand Up @@ -44,15 +43,12 @@ import { SyncAltIcon, TimesIcon } from "@patternfly/react-icons";

import { ModifyStorage } from "./ModifyStorage.jsx";
import { SystemTypeContext } from "../Common.jsx";

import {
runStorageTask,
scanDevicesWithTask,
} from "../../apis/storage.js";

import { resetPartitioning } from "../../apis/storage_partitioning.js";
import { setSelectedDisks } from "../../apis/storage_disks_selection.js";

import { getDevicesAction, getDiskSelectionAction } from "../../actions/storage-actions.js";
import { debug } from "../../helpers/log.js";
import { checkIfArraysAreEqual } from "../../helpers/utils.js";
Expand Down
1 change: 0 additions & 1 deletion src/components/storage/InstallationMethod.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
import cockpit from "cockpit";
import React from "react";

import {
Form,
HelperText,
Expand Down
2 changes: 0 additions & 2 deletions src/components/storage/InstallationScenario.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import cockpit from "cockpit";
import React, { useContext, useEffect, useState } from "react";

import {
FormGroup,
Radio,
Expand All @@ -30,7 +29,6 @@ import { SystemTypeContext } from "../Common.jsx";
import {
setInitializationMode,
} from "../../apis/storage_disk_initialization.js";

import { StorageReview } from "../review/StorageReview.jsx";

import "./InstallationScenario.scss";
Expand Down
1 change: 0 additions & 1 deletion src/components/storage/ModifyStorage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
import cockpit from "cockpit";
import React, { useContext } from "react";

import {
Button,
} from "@patternfly/react-core";
Expand Down
3 changes: 0 additions & 3 deletions src/components/storage/MountPointMapping.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import cockpit from "cockpit";
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";

import {
Button,
Flex,
Expand All @@ -34,13 +33,11 @@ import {
SelectVariant
} from "@patternfly/react-core/deprecated";
import { TrashIcon } from "@patternfly/react-icons";

import { ListingTable } from "cockpit-components-table.jsx";
import { EmptyStatePanel } from "cockpit-components-empty-state.jsx";

import { EncryptedDevices } from "./EncryptedDevices.jsx";
import { useMountPointConstraints } from "./Common.jsx";

import {
setBootloaderDrive,
} from "../../apis/storage_bootloader.js";
Expand Down
1 change: 1 addition & 0 deletions src/components/users/Accounts.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
InputGroup,
TextInput,
} from "@patternfly/react-core";

import encryptUserPw from "../../scripts/encrypt-user-pw.py";
import {
clearRootPassword,
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import "../pkg/lib/patternfly/patternfly-5-cockpit.scss";
import React from "react";
import { createRoot } from "react-dom/client";
import cockpit from "cockpit";

import { Application } from "./components/app.jsx";
/*
* PF4 overrides need to come after the JSX components imports because
Expand Down

0 comments on commit 351683c

Please sign in to comment.