Skip to content

Commit

Permalink
Update biome to v1.9.4 (#8313)
Browse files Browse the repository at this point in the history
* update biome to v1.9.4

* add config for auto-sorting Typescript imports

* apply auto-sorting to all TS imports (mass action)

* changelog

* ignore import sorting for tests

* exclude shader editor from import sorting

* apply PR feedback
  • Loading branch information
hotzenklotz authored Jan 9, 2025
1 parent 97ce494 commit abce5a5
Show file tree
Hide file tree
Showing 370 changed files with 3,941 additions and 3,930 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Added the option for "Selective Segment Visibility" for segmentation layers. Select this option in the left sidebar to only show segments that are currently active or hovered. [#8281](https://github.com/scalableminds/webknossos/pull/8281)
- A segment can be activated with doubleclick now. [#8281](https://github.com/scalableminds/webknossos/pull/8281)
- It is now possible to select the magnification of the layers on which an AI model will be trained. [#8266](https://github.com/scalableminds/webknossos/pull/8266)
- Enabled auto sorting of Typescript imports in Biome linter. [#8313](https://github.com/scalableminds/webknossos/pull/8313)


### Changed
- Renamed "resolution" to "magnification" in more places within the codebase, including local variables. [#8168](https://github.com/scalableminds/webknossos/pull/8168)
Expand Down
17 changes: 12 additions & 5 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"organizeImports": { "enabled": false },
"organizeImports": {
"enabled": true,
"ignore": [
"frontend/javascripts/test/*",
"frontend/javascripts/oxalis/model/helpers/shader_editor.ts"
]
},
"linter": {
"enabled": true,
"ignore": [
Expand All @@ -12,7 +18,8 @@
"libs/fps_meter.ts",
"libs/parse_stl_buffer.ts",
"libs/trackball_controls.ts",
"*.d.ts"
"*.d.ts",
"frontend/javascripts/test/snapshots/*"
],
"rules": {
"recommended": true,
Expand Down Expand Up @@ -49,16 +56,16 @@
"useValidAnchor": "off",
"useKeyWithClickEvents": "off",
"useIframeTitle": "off",
"noAriaHiddenOnFocusable": "off"
"noAriaHiddenOnFocusable": "off",
"noLabelWithoutControl": "off"
},
"performance": {
"noDelete": "off"
},
"correctness": {
"noUnusedVariables": "error",
"noRenderReturnValue": "off",
"useHookAtTopLevel": "error",
"noUnusedImports": "error"
"useHookAtTopLevel": "error"
},
"suspicious": {
"noExplicitAny": "off",
Expand Down
100 changes: 50 additions & 50 deletions frontend/javascripts/admin/admin_rest_api.ts
Original file line number Diff line number Diff line change
@@ -1,103 +1,103 @@
import ResumableJS from "resumablejs";
import _ from "lodash";
import dayjs from "dayjs";
import { V3 } from "libs/mjs";
import type { RequestOptions } from "libs/request";
import Request from "libs/request";
import type { Message } from "libs/toast";
import Toast from "libs/toast";
import * as Utils from "libs/utils";
import window, { location } from "libs/window";
import _ from "lodash";
import messages from "messages";
import type { AnnotationTypeFilterEnum, LOG_LEVELS, Vector2, Vector3 } from "oxalis/constants";
import Constants, { ControlModeEnum, AnnotationStateFilterEnum } from "oxalis/constants";
import type { SaveQueueType } from "oxalis/model/actions/save_actions";
import type BoundingBox from "oxalis/model/bucket_data_handling/bounding_box";
import {
parseProtoListOfLong,
parseProtoTracing,
serializeProtoListOfLong,
} from "oxalis/model/helpers/proto_helpers";
import type {
DatasetConfiguration,
Mapping,
MappingType,
NumberLike,
PartialDatasetConfiguration,
TraceOrViewCommand,
Tracing,
UserConfiguration,
VolumeTracing,
} from "oxalis/store";
import type { Versions } from "oxalis/view/version_view";
import ResumableJS from "resumablejs";
import type {
APIAnnotation,
APIAnnotationInfo,
APIAnnotationType,
APIAnnotationVisibility,
APIAvailableTasksReport,
APIBuildInfo,
APICompoundType,
APIConnectomeFile,
APIDataSource,
APIDataSourceId,
APIDataStore,
APIDataset,
APIDataSourceId,
APIDatasetCompact,
APIFeatureToggles,
APIHistogramData,
APIMagRestrictions,
APIMapping,
APIMaybeUnimportedDataset,
APIMeshFile,
APIAvailableTasksReport,
APIOrganization,
APIOrganizationCompact,
APIPricingPlanStatus,
APIProject,
APIProjectCreator,
APIProjectProgressReport,
APIProjectUpdater,
APIProjectWithStatus,
APIPublication,
APIMagRestrictions,
APIScript,
APIScriptCreator,
APIScriptUpdater,
APITaskType,
APITeam,
APITimeInterval,
APITimeTrackingPerAnnotation,
APITimeTrackingPerUser,
APITimeTrackingSpan,
APITracingStore,
APIUpdateActionBatch,
APIUser,
APIUserCompact,
APIUserLoggedTime,
APIUserTheme,
AdditionalCoordinate,
AnnotationLayerDescriptor,
AnnotationViewConfiguration,
EditableLayerProperties,
ExperienceDomainList,
LayerLink,
MaintenanceInfo,
ServerEditableMapping,
ServerTracing,
ShortLink,
TracingType,
ServerEditableMapping,
APICompoundType,
ZarrPrivateLink,
VoxelyticsWorkflowReport,
VoxelSize,
VoxelyticsChunkStatistics,
ShortLink,
VoxelyticsWorkflowListing,
APIPricingPlanStatus,
VoxelyticsLogLine,
APIUserCompact,
APIDatasetCompact,
MaintenanceInfo,
AdditionalCoordinate,
LayerLink,
VoxelSize,
APITimeTrackingPerUser,
VoxelyticsWorkflowListing,
VoxelyticsWorkflowReport,
ZarrPrivateLink,
} from "types/api_flow_types";
import type { AnnotationTypeFilterEnum, LOG_LEVELS, Vector2, Vector3 } from "oxalis/constants";
import Constants, { ControlModeEnum, AnnotationStateFilterEnum } from "oxalis/constants";
import type {
DatasetConfiguration,
PartialDatasetConfiguration,
Tracing,
TraceOrViewCommand,
MappingType,
VolumeTracing,
UserConfiguration,
Mapping,
NumberLike,
} from "oxalis/store";
import { V3 } from "libs/mjs";
import type { Versions } from "oxalis/view/version_view";
import type { ArbitraryObject } from "types/globals";
import { enforceValidatedDatasetViewConfiguration } from "types/schemas/dataset_view_configuration_defaults";
import {
parseProtoListOfLong,
parseProtoTracing,
serializeProtoListOfLong,
} from "oxalis/model/helpers/proto_helpers";
import type { RequestOptions } from "libs/request";
import Request from "libs/request";
import type { Message } from "libs/toast";
import Toast from "libs/toast";
import * as Utils from "libs/utils";
import messages from "messages";
import window, { location } from "libs/window";
import type { SaveQueueType } from "oxalis/model/actions/save_actions";
import type { DatasourceConfiguration } from "types/schemas/datasource.types";
import { doWithToken } from "./api/token";
import type BoundingBox from "oxalis/model/bucket_data_handling/bounding_box";
import type { ArbitraryObject } from "types/globals";
import { assertResponseLimit } from "./api/api_utils";
import { getDatasetIdFromNameAndOrganization } from "./api/disambiguate_legacy_routes";
import { doWithToken } from "./api/token";

export * from "./api/token";
export * from "./api/jobs";
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/api/folders.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Request from "libs/request";
import type { Folder, FlatFolderTreeItem, FolderUpdater } from "types/api_flow_types";
import type { FlatFolderTreeItem, Folder, FolderUpdater } from "types/api_flow_types";

export function getFolder(folderId: string): Promise<Folder> {
return Request.receiveJSON(`/api/folders/${folderId}`);
Expand Down
6 changes: 3 additions & 3 deletions frontend/javascripts/admin/api/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { location } from "libs/window";
import type { UnitLong, Vector3, Vector6 } from "oxalis/constants";
import type {
APIAnnotationType,
APIEffectiveJobState,
APIJob,
APIJobState,
APIJobManualState,
APIEffectiveJobState,
APIJobState,
AdditionalCoordinate,
AiModel,
RenderAnimationOptions,
AdditionalCoordinate,
} from "types/api_flow_types";
import { assertResponseLimit } from "./api_utils";

Expand Down
18 changes: 9 additions & 9 deletions frontend/javascripts/admin/api/tasks.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { finishAnnotation } from "admin/admin_rest_api";
import type {
APIActiveUser,
APIAnnotation,
APIAnnotationWithTask,
APITask,
} from "types/api_flow_types";
import { APIAnnotationTypeEnum } from "types/api_flow_types";
import type {
NewTask,
NewNmlTask,
NewTask,
TaskCreationResponseContainer,
} from "admin/task/task_create_bulk_view";
import type { QueryObject } from "admin/task/task_search_form";
import type { RequestOptions } from "libs/request";
import Request from "libs/request";
import * as Utils from "libs/utils";
import type {
APIActiveUser,
APIAnnotation,
APIAnnotationWithTask,
APITask,
} from "types/api_flow_types";
import { APIAnnotationTypeEnum } from "types/api_flow_types";
import { assertResponseLimit } from "./api_utils";
import { finishAnnotation } from "admin/admin_rest_api";

export function peekNextTasks(): Promise<APITask | null | undefined> {
return Request.receiveJSON("/api/user/tasks/peek");
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/admin/api/token.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { location } from "libs/window";
import Request from "libs/request";
import * as Utils from "libs/utils";
import { location } from "libs/window";

const MAX_TOKEN_RETRY_ATTEMPTS = 3;

Expand Down
14 changes: 7 additions & 7 deletions frontend/javascripts/admin/auth/accept_invite_view.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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 { useState } from "react";
import AuthenticationModal from "admin/auth/authentication_modal";
import { useFetch } from "libs/react_helpers";
import {
getOrganizationByInvite,
joinOrganization,
switchToOrganization,
} from "admin/admin_rest_api";
import type { APIUser } from "types/api_flow_types";
import AuthenticationModal from "admin/auth/authentication_modal";
import { Button, Layout, Result, Spin } from "antd";
import { AsyncButton } from "components/async_clickables";
import { useFetch } from "libs/react_helpers";
import Toast from "libs/toast";
import { location } from "libs/window";
import { useState } from "react";
import { useHistory } from "react-router-dom";
import type { APIUser } from "types/api_flow_types";

const { Content } = Layout;

Expand Down
6 changes: 3 additions & 3 deletions frontend/javascripts/admin/auth/auth_token_view.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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";
import type { OxalisState } from "oxalis/store";
import { Button, Col, Form, Input, Row, Space, Spin } from "antd";
import Toast from "libs/toast";
import type { OxalisState } from "oxalis/store";
import { useEffect, useState } from "react";
import { useSelector } from "react-redux";
const FormItem = Form.Item;

Expand Down
14 changes: 7 additions & 7 deletions frontend/javascripts/admin/auth/authentication_modal.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Modal, Alert } from "antd";
import type { ComponentType } from "react";
import React, { useState } from "react";
import Toast from "libs/toast";
import messages from "messages";
import features from "features";
import RegistrationFormWKOrg from "admin/auth/registration_form_wkorg";
import { Alert, Modal } from "antd";
import LinkButton from "components/link_button";
import RegistrationFormGeneric from "./registration_form_generic";
import features from "features";
import Toast from "libs/toast";
import messages from "messages";
import type { ComponentType } from "react";
import React, { useState } from "react";
import LoginForm from "./login_form";
import RegistrationFormGeneric from "./registration_form_generic";
type Props = {
onLoggedIn: (userJustRegistered: boolean) => unknown;
onCancel: () => void;
Expand Down
6 changes: 3 additions & 3 deletions frontend/javascripts/admin/auth/change_password_view.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { type RouteComponentProps, withRouter } from "react-router-dom";
import { Form, Input, Button, Col, Row, Alert } from "antd";
import { LockOutlined } from "@ant-design/icons";
import { Alert, Button, Col, Form, Input, Row } from "antd";
import Request from "libs/request";
import messages from "messages";
import Toast from "libs/toast";
import messages from "messages";
import { logoutUserAction } from "oxalis/model/actions/user_actions";
import Store from "oxalis/store";
import { type RouteComponentProps, withRouter } from "react-router-dom";
const FormItem = Form.Item;
const { Password } = Input;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type RouteComponentProps, withRouter } from "react-router-dom";
import { Form, Input, Button, Col, Row, Card } from "antd";
import { LockOutlined } from "@ant-design/icons";
import { Button, Card, Col, Form, Input, Row } from "antd";
import Request from "libs/request";
import messages from "messages";
import Toast from "libs/toast";
import messages from "messages";
import { type RouteComponentProps, withRouter } from "react-router-dom";
const FormItem = Form.Item;
const { Password } = Input;
type Props = {
Expand Down
12 changes: 6 additions & 6 deletions frontend/javascripts/admin/auth/login_form.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Alert, Button, Form, Input } from "antd";
import { LockOutlined, MailOutlined } from "@ant-design/icons";
import { Link } from "react-router-dom";
import { getIsInIframe } from "libs/utils";
import { loginUser, requestSingleSignOnLogin } from "admin/admin_rest_api";
import { setActiveUserAction } from "oxalis/model/actions/user_actions";
import Store from "oxalis/store";
import messages from "messages";
import { Alert, Button, Form, Input } from "antd";
import features from "features";
import { getIsInIframe } from "libs/utils";
import messages from "messages";
import { setActiveOrganizationAction } from "oxalis/model/actions/organization_actions";
import { setActiveUserAction } from "oxalis/model/actions/user_actions";
import Store from "oxalis/store";
import { Link } from "react-router-dom";

const FormItem = Form.Item;
const { Password } = Input;
Expand Down
4 changes: 2 additions & 2 deletions frontend/javascripts/admin/auth/login_view.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Card, Col, Row } from "antd";
import type { RouteComponentProps } from "react-router-dom";
import { withRouter } from "react-router-dom";
import * as Utils from "libs/utils";
import window from "libs/window";
import type { RouteComponentProps } from "react-router-dom";
import { withRouter } from "react-router-dom";
import LoginForm from "./login_form";

type Props = {
Expand Down
Loading

0 comments on commit abce5a5

Please sign in to comment.