Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused imports while linting #8102

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"correctness": {
"noUnusedVariables": "error",
"noRenderReturnValue": "off",
"useHookAtTopLevel": "error"
"useHookAtTopLevel": "error",
"noUnusedImports": "error"
},
"suspicious": {
"noExplicitAny": "off",
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/admin/api/mesh.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Request from "libs/request";
import _ from "lodash";
import type { Vector3, Vector4 } from "oxalis/constants";
import type { APIDatasetId } from "types/api_flow_types";
import { doWithToken } from "./token";
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/auth/accept_invite_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Button, Result, Layout, Spin } from "antd";
import { GiftTwoTone } from "@ant-design/icons";
import { useHistory } from "react-router-dom";
import { AsyncButton } from "components/async_clickables";
import React, { useState } from "react";
import { useState } from "react";
import AuthenticationModal from "admin/auth/authentication_modal";
import { useFetch } from "libs/react_helpers";
import {
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/auth/auth_token_view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import { CopyOutlined, SwapOutlined } from "@ant-design/icons";
import { Input, Button, Col, Row, Spin, Form, Space } from "antd";
import { getAuthToken, revokeAuthToken } from "admin/admin_rest_api";
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/admin/auth/change_password_view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { type RouteComponentProps, withRouter } from "react-router-dom";
import { Form, Input, Button, Col, Row, Alert } from "antd";
import { LockOutlined } from "@ant-design/icons";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { type RouteComponentProps, withRouter } from "react-router-dom";
import { Form, Input, Button, Col, Row, Card } from "antd";
import { LockOutlined } from "@ant-design/icons";
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/admin/auth/login_form.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Alert, Button, Form, Input } from "antd";
import { LockOutlined, MailOutlined } from "@ant-design/icons";
import { Link } from "react-router-dom";
import React from "react";
import { getIsInIframe } from "libs/utils";
import { loginUser, requestSingleSignOnLogin } from "admin/admin_rest_api";
import { setActiveUserAction } from "oxalis/model/actions/user_actions";
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/admin/auth/login_view.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Card, Col, Row } from "antd";
import type { RouteComponentProps } from "react-router-dom";
import { withRouter } from "react-router-dom";
import React from "react";
import * as Utils from "libs/utils";
import window from "libs/window";
import LoginForm from "./login_form";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Form, Input, Button, Row, Col, Checkbox } from "antd";
import { UserOutlined, LockOutlined, MailOutlined } from "@ant-design/icons";
import React, { useRef, memo } from "react";
import { useRef, memo } from "react";
import { loginUser } from "admin/admin_rest_api";
import { setActiveUserAction } from "oxalis/model/actions/user_actions";
import Request from "libs/request";
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/auth/registration_view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react";
import { useEffect, useState } from "react";
import { Link, useHistory } from "react-router-dom";
import { Spin, Row, Col, Card } from "antd";
import messages from "messages";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { Link, type RouteComponentProps, withRouter } from "react-router-dom";
import { Form, Input, Button, Col, Row, Card } from "antd";
import { MailOutlined } from "@ant-design/icons";
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/auth/verify_email_view.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Spin } from "antd";
import React, { useEffect } from "react";
import { useEffect } from "react";
import { useFetch } from "libs/react_helpers";
import { requestVerificationMail, verifyEmail } from "admin/admin_rest_api";
import Toast from "libs/toast";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, Radio, type RadioChangeEvent, Space } from "antd";
import React from "react";
import type { WizardComponentProps } from "./common";

export default function SelectImportType({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { SoftError } from "libs/utils";
import _ from "lodash";
import type { Vector3 } from "oxalis/constants";
import { parseNml } from "oxalis/model/helpers/nml_helpers";
import React from "react";
import {
tryToFetchDatasetsByName,
type WizardComponentProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AsyncButton } from "components/async_clickables";
import DatasetSelectionComponent, {
type DatasetSelectionValue,
} from "dashboard/dataset/dataset_selection_component";
import React, { useState } from "react";
import { useState } from "react";
import { tryToFetchDatasetsByName, type WizardComponentProps } from "./common";
import { useEffectOnlyOnce } from "libs/react_hooks";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CardContainer } from "admin/dataset/dataset_components";
import React, { useState } from "react";
import { useState } from "react";
import type { APIDataStore } from "types/api_flow_types";
import SelectImportType from "./composition_wizard/01_select_import_type";
import UploadFiles from "./composition_wizard/02_upload_files";
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/admin/dataset/dataset_url_import.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import DatasetAddRemoteView from "admin/dataset/dataset_add_remote_view";
import { useFetch } from "libs/react_helpers";
import { getDatastores } from "admin/admin_rest_api";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import { connect } from "react-redux";
import { Form, Button, Card, Input, Row, Col, Skeleton, Typography, Space } from "antd";
import {
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/project/project_create_view.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Form, Input, Select, Button, Card, InputNumber, Checkbox } from "antd";
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import { useHistory } from "react-router-dom";
import { useSelector } from "react-redux";
import type { APIUser, APITeam } from "types/api_flow_types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Modal, Table, Spin } from "antd";
import React, { useState } from "react";
import { useState } from "react";
import _ from "lodash";
import type { APIUser, APIProject, APIActiveUser } from "types/api_flow_types";
import {
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/scripts/script_create_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Form, Input, Select, Button, Card } from "antd";
import type { RouteComponentProps } from "react-router-dom";
import { withRouter } from "react-router-dom";
import { connect } from "react-redux";
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import type { APIUser } from "types/api_flow_types";
import type { OxalisState } from "oxalis/store";
import { enforceActiveUser } from "oxalis/model/accessors/user_accessor";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Spin, Table, Card, Typography, Tooltip, Tag } from "antd";
import React, { useState } from "react";
import { useState } from "react";
import type { APIAvailableTasksReport } from "types/api_flow_types";
import { getAvailableTasksReport } from "admin/admin_rest_api";
import { handleGenericError } from "libs/error_handling";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Row, Col, Form, Button } from "antd";
import * as React from "react";
import type { APITeam } from "types/api_flow_types";
import TeamSelectionComponent from "dashboard/dataset/team_selection_component";
const FormItem = Form.Item;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useFetch } from "libs/react_helpers";
import React from "react";
import type { AnnotationTypeFilterEnum } from "./project_and_annotation_type_dropdown";
import { getTimeTrackingForUserSummedPerAnnotation } from "admin/admin_rest_api";
import dayjs from "dayjs";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { getTeams, getTimeEntries, getTimeTrackingForUserSpans } from "admin/admin_rest_api";
import { Card, Select, Spin, Button, DatePicker, type TimeRangePickerProps, Table } from "antd";
import { useFetch } from "libs/react_helpers";
import _ from "lodash";
import React, { useState } from "react";
import { useState } from "react";
import { DownloadOutlined, FilterOutlined } from "@ant-design/icons";
import saveAs from "file-saver";
import { formatMilliseconds } from "libs/format_utils";
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/task/task_annotation_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
DownOutlined,
} from "@ant-design/icons";
import { connect } from "react-redux";
import React, { useEffect, useState } from "react";
import { useEffect, useState } from "react";
import type { APIUser, APITask, APIAnnotation } from "types/api_flow_types";
import type { OxalisState } from "oxalis/store";
import { formatSeconds } from "libs/format_utils";
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/task/task_create_bulk_view.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Form, Input, Button, Card, Upload, Spin, Progress, Divider, App } from "antd";
import React, { useState } from "react";
import { useState } from "react";
import { InboxOutlined } from "@ant-design/icons";
import _ from "lodash";
import type { APITask } from "types/api_flow_types";
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/admin/task/task_create_view.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { BarsOutlined, ScheduleOutlined } from "@ant-design/icons";
import { Tabs, type TabsProps } from "antd";
import React from "react";
import TaskCreateBulkView from "admin/task/task_create_bulk_view";
import TaskCreateFormView from "admin/task/task_create_form_view";

Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/task/task_search_form.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Form, Row, Dropdown, Col, Button, Input, Select } from "antd";
import { DownloadOutlined, DownOutlined, RetweetOutlined } from "@ant-design/icons";
import { PropTypes } from "@scalableminds/prop-types";
import React, { useEffect, useState } from "react";
import { useEffect, useState } from "react";
import _ from "lodash";
import type { APIUser, APIProject, APITaskType } from "types/api_flow_types";
import { getEditableUsers, getProjects, getTaskTypes } from "admin/admin_rest_api";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { syncValidator } from "types/validation";
import { InfoCircleOutlined } from "@ant-design/icons";
import type { RouteComponentProps } from "react-router-dom";
import { withRouter } from "react-router-dom";
import React, { useEffect, useState } from "react";
import { useEffect, useState } from "react";
import _ from "lodash";
import {
type APITaskType,
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/admin/team/create_team_modal_view.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Modal, Input, Form } from "antd";
import { TagOutlined } from "@ant-design/icons";
import * as React from "react";
import { createTeam } from "admin/admin_rest_api";
import Shortcut from "libs/shortcut_component";
const FormItem = Form.Item;
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/admin/team/edit_team_modal_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { MinusCircleOutlined, PlusCircleOutlined } from "@ant-design/icons";
import { getEditableUsers, updateUser } from "admin/admin_rest_api";
import { Modal, AutoComplete, Input, Spin, Tooltip } from "antd";
import type { DefaultOptionType } from "antd/lib/select";
import * as React from "react";
import { useState } from "react";
import type { APITeam, APITeamMembership, APIUser } from "types/api_flow_types";
import { filterTeamMembersOf, renderUsersForTeam } from "./team_list_view";
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/user/experience_modal_view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import { useState } from "react";
import { Modal, Tooltip, Table, InputNumber, Tag, Badge } from "antd";
import { CloseOutlined, DeleteOutlined, RollbackOutlined } from "@ant-design/icons";
import _ from "lodash";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Spin, Select } from "antd";
import * as React from "react";
import _ from "lodash";
import { getUsers } from "admin/admin_rest_api";
import { useFetch } from "libs/react_helpers";
Expand Down
4 changes: 2 additions & 2 deletions frontend/javascripts/admin/voxelytics/ai_model_list_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import _ from "lodash";
import { useState } from "react";
import { PlusOutlined, SyncOutlined } from "@ant-design/icons";
import { Table, Button, Modal, Space } from "antd";
import { getAiModels, getTracingForAnnotationType } from "admin/admin_rest_api";
import type { AiModel, APIAnnotation, ServerVolumeTracing } from "types/api_flow_types";
import { getAiModels } from "admin/admin_rest_api";
import type { AiModel, APIAnnotation } from "types/api_flow_types";
import FormattedDate from "components/formatted_date";
import { formatUserName } from "oxalis/model/accessors/user_accessor";
import { useSelector } from "react-redux";
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/admin/voxelytics/artifacts_view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { JSONTree } from "react-json-tree";
import { Button, Card, message } from "antd";
import { CopyOutlined, ExportOutlined } from "@ant-design/icons";
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/voxelytics/dag_view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, useState } from "react";
import { useRef, useState } from "react";
import ReactFlow, {
MiniMap,
Background,
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/voxelytics/log_tab.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo, useState } from "react";
import { useMemo, useState } from "react";
import { Button, message, Select, Switch } from "antd";
import chalk from "chalk";
import Ansi from "ansi-to-react";
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/voxelytics/statistics_tab.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from "react";
import { useState } from "react";
import { Button, Tooltip } from "antd";
import { SyncOutlined } from "@ant-design/icons";
import { getVoxelyticsChunkStatistics } from "admin/admin_rest_api";
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/admin/voxelytics/task_view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { JSONTree, type ShouldExpandNodeInitially, type LabelRenderer } from "react-json-tree";
import { Progress, Tabs, type TabsProps, Tooltip } from "antd";
import Markdown from "libs/markdown_adapter";
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/voxelytics/workflow_view.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from "lodash";
import React, { useEffect, useState, useMemo } from "react";
import { useEffect, useState, useMemo } from "react";
import { useParams } from "react-router-dom";
import { useSelector } from "react-redux";
import {
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/components/color_picker.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, useState } from "react";
import { useRef, useState } from "react";
import { Popover } from "antd";
import * as Utils from "libs/utils";
import { HexColorInput, HexColorPicker } from "react-colorful";
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/components/credits_footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Layout } from "antd";
import { Link, type RouteComponentProps, withRouter } from "react-router-dom";
import * as React from "react";
const { Footer } = Layout;

const creditsFooter = () => (
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/components/formatted_date.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from "react";
import dayjs from "dayjs";
import FastTooltip from "./fast_tooltip";

Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/components/link_button.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Button, type ButtonProps } from "antd";
import * as React from "react";

// This component should be used instead of <a href="#" onClick={} />.
// One advantage of this component is that clicking the link button won't scroll
Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/components/permission_enforcer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { Button, Result, Col, Row } from "antd";
import { Link } from "react-router-dom";

Expand Down
1 change: 0 additions & 1 deletion frontend/javascripts/components/stacked_bar_chart.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from "react";
import _ from "lodash";
export const colors = {
finished: "#52c41a",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { getDatasets } from "admin/admin_rest_api";
import AsyncSelect from "components/async_select";
import React from "react";

// Usage of AsyncSelect
export interface DatasetSelectionValue {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from "antd";
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";
import type { APIDataset, APIDatasetId } from "types/api_flow_types";
import { getDataset, deleteDatasetOnDisk } from "admin/admin_rest_api";
import Toast from "libs/toast";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Input, Col, Row, DatePicker } from "antd";
import React from "react";
import { FormItemWithInfo } from "./helper_components";

export default function DatasetSettingsMetadataTab() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
Slider,
Divider,
} from "antd";
import React, { useMemo, useState } from "react";
import { useMemo, useState } from "react";
import { Vector3Input } from "libs/vector_input";
import { validateLayerViewConfigurationObjectJSON, syncValidator } from "types/validation";
import { getDefaultLayerViewConfiguration } from "types/schemas/dataset_view_configuration.schema";
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/dashboard/dataset/queries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
updateFolder,
} from "admin/api/folders";
import Toast from "libs/toast";
import React, { useEffect, useRef } from "react";
import { useEffect, useRef } from "react";
import {
type APIDatasetId,
type APIDatasetCompact,
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/dashboard/folders/details_sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
OwningOrganizationRow,
VoxelSizeRow,
} from "oxalis/view/right-border-tabs/dataset_info_tab_view";
import React, { useEffect } from "react";
import { useEffect } from "react";
import type { APIDatasetCompact, Folder } from "types/api_flow_types";
import { DatasetLayerTags, DatasetTags, TeamTags } from "../advanced_dataset/dataset_table";
import { useDatasetCollectionContext } from "../dataset/dataset_collection_context";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FormItemWithInfo } from "dashboard/dataset/helper_components";
import { useFolderQuery } from "dashboard/dataset/queries";
import TeamSelectionComponent from "dashboard/dataset/team_selection_component";
import Shortcut from "libs/shortcut_component";
import React, { useEffect, useRef } from "react";
import { useEffect, useRef } from "react";

import type { APITeam } from "types/api_flow_types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from "lodash";
import { TreeSelect } from "antd";
import React, { useState, useEffect } from "react";
import { useState, useEffect } from "react";

import { useFolderHierarchyQuery } from "dashboard/dataset/queries";
import type { FolderItem } from "types/api_flow_types";
Expand Down
Loading