Skip to content

Commit

Permalink
Merge pull request #18589 from dannon/import-type-enforcement
Browse files Browse the repository at this point in the history
Consistent type imports, fixes and linting.
  • Loading branch information
dannon authored Jul 24, 2024
2 parents 119c334 + 09481bb commit e18ba47
Show file tree
Hide file tree
Showing 228 changed files with 381 additions and 356 deletions.
5 changes: 5 additions & 0 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ const baseRules = {
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",

"@typescript-eslint/consistent-type-imports": [
"error",
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
],
};

const baseExtends = [
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/configTemplates.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { components } from "@/api/schema/schema";
import { type components } from "@/api/schema/schema";

export type Instance =
| components["schemas"]["UserFileSourceModel"]
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/datasetCollections.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CollectionEntry, DCESummary, HDCADetailed, HDCASummary, isHDCA } from "@/api";
import { type CollectionEntry, type DCESummary, type HDCADetailed, type HDCASummary, isHDCA } from "@/api";
import { fetcher } from "@/api/schema";

const DEFAULT_LIMIT = 50;
Expand Down
6 changes: 3 additions & 3 deletions client/src/api/datasets.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import axios from "axios";
import type { FetchArgType } from "openapi-typescript-fetch";
import { type FetchArgType } from "openapi-typescript-fetch";

import { HDADetailed } from "@/api";
import { components, fetcher } from "@/api/schema";
import { type HDADetailed } from "@/api";
import { type components, fetcher } from "@/api/schema";
import { withPrefix } from "@/utils/redirect";

export const datasetsFetcher = fetcher.path("/api/datasets").method("get").create();
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/groups.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";

import { components, fetcher } from "@/api/schema";
import { type components, fetcher } from "@/api/schema";

type GroupModel = components["schemas"]["GroupModel"];
export async function getAllGroups(): Promise<GroupModel[]> {
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/histories.archived.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FetchArgType } from "openapi-typescript-fetch";
import { type FetchArgType } from "openapi-typescript-fetch";

import { type components, fetcher } from "@/api/schema";

Expand Down
3 changes: 1 addition & 2 deletions client/src/api/histories.export.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { components } from "@/api/schema";
import { fetcher } from "@/api/schema";
import { type components, fetcher } from "@/api/schema";
import {
type ExportRecord,
ExportRecordModel,
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** Contains type alias and definitions related to Galaxy API models. */

import { components } from "@/api/schema";
import { type components } from "@/api/schema";

/**
* Contains minimal information about a History.
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/invocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from "axios";

import { getAppRoot } from "@/onload";

import { ApiResponse, components, fetcher } from "./schema";
import { type ApiResponse, type components, fetcher } from "./schema";

export type WorkflowInvocationElementView = components["schemas"]["WorkflowInvocationElementView"];
export type WorkflowInvocationCollectionView = components["schemas"]["WorkflowInvocationCollectionView"];
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/jobs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { components, fetcher } from "@/api/schema";
import { type components, fetcher } from "@/api/schema";

export type JobDestinationParams = components["schemas"]["JobDestinationParams"];

Expand Down
2 changes: 1 addition & 1 deletion client/src/api/objectStores.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { fetcher } from "@/api/schema";
import type { components } from "@/api/schema/schema";
import { type components } from "@/api/schema/schema";

export type UserConcreteObjectStore = components["schemas"]["UserConcreteObjectStoreModel"];

Expand Down
2 changes: 1 addition & 1 deletion client/src/api/remoteFiles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { components } from "@/api/schema";
import { type components } from "@/api/schema";
import { fetcher } from "@/api/schema/fetcher";

/** The browsing mode:
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/schema/__mocks__/fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { paths } from "@/api/schema";
import { type paths } from "@/api/schema";

jest.mock("@/api/schema", () => ({
fetcher: mockFetcher,
Expand Down
7 changes: 3 additions & 4 deletions client/src/api/schema/fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { ApiResponse, Middleware } from "openapi-typescript-fetch";
import { Fetcher } from "openapi-typescript-fetch";
import { type ApiResponse, Fetcher, type Middleware } from "openapi-typescript-fetch";

import { getAppRoot } from "@/onload/loadConfig";
import { rethrowSimple } from "@/utils/simple-error";

import type { paths } from "./schema";
import { type paths } from "./schema";

export { ApiResponse };
export { type ApiResponse };

const rethrowSimpleMiddleware: Middleware = async (url, init, next) => {
try {
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/tags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { components, fetcher } from "@/api/schema";
import { type components, fetcher } from "@/api/schema";

type TaggableItemClass = components["schemas"]["TaggableItemClass"];

Expand Down
2 changes: 1 addition & 1 deletion client/src/api/workflows.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { components, fetcher } from "@/api/schema";
import { type components, fetcher } from "@/api/schema";

export type StoredWorkflowDetailed = components["schemas"]["StoredWorkflowDetailed"];

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Citation/CitationItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { faExternalLinkAlt } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { computed } from "vue";
import { Citation } from ".";
import { type Citation } from ".";
library.add(faExternalLinkAlt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import localize from "@/utils/localization";
import { prependPath } from "@/utils/redirect";
import { errorMessageAsString } from "@/utils/simple-error";
import { HistoryContentBulkOperationPayload, updateHistoryItemsBulk } from "./services";
import { type HistoryContentBulkOperationPayload, updateHistoryItemsBulk } from "./services";
import ChangeDatatypeTab from "@/components/Collections/common/ChangeDatatypeTab.vue";
import DatabaseEditTab from "@/components/Collections/common/DatabaseEditTab.vue";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Common/ExportForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { BButton, BCol, BFormGroup, BFormInput, BRow } from "bootstrap-vue";
import { computed, ref } from "vue";
import { FilterFileSourcesOptions } from "@/api/remoteFiles";
import { type FilterFileSourcesOptions } from "@/api/remoteFiles";
import localize from "@/utils/localization";
import FilesInput from "@/components/FilesDialog/FilesInput.vue";
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/Common/ExportRDMForm.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getLocalVue } from "@tests/jest/helpers";
import { mount, Wrapper } from "@vue/test-utils";
import { mount, type Wrapper } from "@vue/test-utils";
import flushPromises from "flush-promises";

import { type BrowsableFilesSourcePlugin, CreatedEntry } from "@/api/remoteFiles";
import { type BrowsableFilesSourcePlugin, type CreatedEntry } from "@/api/remoteFiles";
import { mockFetcher } from "@/api/schema/__mocks__";

import ExportRDMForm from "./ExportRDMForm.vue";
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Common/ExportRDMForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { BButton, BCard, BFormGroup, BFormInput, BFormRadio, BFormRadioGroup } f
import { computed, ref } from "vue";
import {
BrowsableFilesSourcePlugin,
CreatedEntry,
type BrowsableFilesSourcePlugin,
type CreatedEntry,
createRemoteEntry,
FilterFileSourcesOptions,
type FilterFileSourcesOptions,
} from "@/api/remoteFiles";
import { useToast } from "@/composables/toast";
import localize from "@/utils/localization";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Common/ExportRecordDOILink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import axios from "axios";
import { ref, watch } from "vue";
import { BrowsableFilesSourcePlugin } from "@/api/remoteFiles";
import { type BrowsableFilesSourcePlugin } from "@/api/remoteFiles";
import { useFileSources } from "@/composables/fileSources";
import DOILink from "./DOILink.vue";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Common/ExportRecordDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { BAlert, BButton } from "bootstrap-vue";
import { computed } from "vue";
import type { ColorVariant } from ".";
import { ExportRecord } from "./models/exportRecordModel";
import { type ExportRecord } from "./models/exportRecordModel";
import Heading from "@/components/Common/Heading.vue";
import LoadingSpan from "@/components/LoadingSpan.vue";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Common/FilterMenu.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createTestingPinia } from "@pinia/testing";
import { getLocalVue } from "@tests/jest/helpers";
import { mount, Wrapper } from "@vue/test-utils";
import { mount, type Wrapper } from "@vue/test-utils";

import { HistoryFilters } from "@/components/History/HistoryFilters";
import { WorkflowFilters } from "@/components/Workflow/List/WorkflowFilters";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Common/FilterMenuDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { BButton, BDropdown, BDropdownItem, BInputGroup, BInputGroupAppend, BMod
import { capitalize } from "lodash";
import { computed, onMounted, ref, type UnwrapRef, watch } from "vue";
import { QuotaUsage } from "@/components/User/DiskUsage/Quota/model";
import { type QuotaUsage } from "@/components/User/DiskUsage/Quota/model";
import { type FilterType, type ValidFilter } from "@/utils/filtering";
import { errorMessageAsString } from "@/utils/simple-error";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Common/FilterMenuMultiTags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { BInputGroup } from "bootstrap-vue";
import { computed, ref, watch } from "vue";
import { ValidFilter } from "@/utils/filtering";
import { type ValidFilter } from "@/utils/filtering";
import StatelessTags from "@/components/TagsMultiselect/StatelessTags.vue";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Common/FilterMenuObjectStore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { computed, ref, watch } from "vue";
import { useSelectableObjectStores } from "@/composables/useObjectStores";
import { ValidFilter } from "@/utils/filtering";
import { type ValidFilter } from "@/utils/filtering";
import FilterObjectStoreLink from "./FilterObjectStoreLink.vue";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Common/FilterObjectStoreLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { faTimes } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { computed, ref } from "vue";
import { ConcreteObjectStoreModel } from "@/api";
import { type ConcreteObjectStoreModel } from "@/api";
import { useObjectStoreStore } from "@/stores/objectStoreStore";
import ObjectStoreSelect from "./ObjectStoreSelect.vue";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Common/ObjectStoreSelect.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ConcreteObjectStoreModel } from "@/api";
import { type ConcreteObjectStoreModel } from "@/api";
import ObjectStoreSelectButton from "@/components/ObjectStore/ObjectStoreSelectButton.vue";
import ObjectStoreSelectButtonDescribePopover from "@/components/ObjectStore/ObjectStoreSelectButtonDescribePopover.vue";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { shallowMount } from "@vue/test-utils";
import { type PropType, ref } from "vue";

import { TaskMonitor } from "@/composables/genericTaskMonitor";
import { type TaskMonitor } from "@/composables/genericTaskMonitor";
import {
type MonitoringData,
MonitoringRequest,
type MonitoringRequest,
usePersistentProgressTaskMonitor,
} from "@/composables/persistentProgressMonitor";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { BAlert, BLink } from "bootstrap-vue";
import { computed, watch } from "vue";
import { TaskMonitor } from "@/composables/genericTaskMonitor";
import { MonitoringRequest, usePersistentProgressTaskMonitor } from "@/composables/persistentProgressMonitor";
import { type TaskMonitor } from "@/composables/genericTaskMonitor";
import { type MonitoringRequest, usePersistentProgressTaskMonitor } from "@/composables/persistentProgressMonitor";
import { useShortTermStorage } from "@/composables/shortTermStorage";
import UtcDate from "@/components/UtcDate.vue";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Common/models/exportRecordModel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { formatDistanceToNow, parseISO } from "date-fns";

import type { components } from "@/api/schema";
import { type components } from "@/api/schema";

type ExportObjectRequestMetadata = components["schemas"]["ExportObjectRequestMetadata"];

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Common/models/testData/exportData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { components } from "@/api/schema";
import { type components } from "@/api/schema";
import { ExportRecordModel } from "@/components/Common/models/exportRecordModel";

type ObjectExportTaskResponse = components["schemas"]["ObjectExportTaskResponse"];
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ConfigTemplates/EditSecretsForm.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { TemplateSummary } from "@/api/configTemplates";
import { type TemplateSummary } from "@/api/configTemplates";
import VaultSecret from "./VaultSecret.vue";
import FormCard from "@/components/Form/FormCard.vue";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ConfigTemplates/InstanceForm.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { shallowMount } from "@vue/test-utils";
import { getLocalVue } from "tests/jest/helpers";

import { FormEntry } from "./formUtil";
import { type FormEntry } from "./formUtil";

import InstanceForm from "./InstanceForm.vue";

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ConfigTemplates/formUtil.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TemplateVariable } from "@/api/configTemplates";
import { type TemplateVariable } from "@/api/configTemplates";

import { createTemplateForm, templateVariableFormEntry, upgradeForm } from "./formUtil";
import {
Expand Down
18 changes: 9 additions & 9 deletions client/src/components/ConfigTemplates/formUtil.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type {
Instance,
PluginStatus,
SecretData,
TemplateSecret,
TemplateSummary,
TemplateVariable,
VariableData,
VariableValueType,
import {
type Instance,
type PluginStatus,
type SecretData,
type TemplateSecret,
type TemplateSummary,
type TemplateVariable,
type VariableData,
type VariableValueType,
} from "@/api/configTemplates";
import { markup } from "@/components/ObjectStore/configurationMarkdown";

Expand Down
6 changes: 3 additions & 3 deletions client/src/components/ConfigTemplates/test_fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FileSourceTemplateSummary } from "@/api/fileSources";
import type { UserConcreteObjectStore } from "@/components/ObjectStore/Instances/types";
import type { ObjectStoreTemplateSummary } from "@/components/ObjectStore/Templates/types";
import { type FileSourceTemplateSummary } from "@/api/fileSources";
import { type UserConcreteObjectStore } from "@/components/ObjectStore/Instances/types";
import { type ObjectStoreTemplateSummary } from "@/components/ObjectStore/Templates/types";

export const STANDARD_OBJECT_STORE_TEMPLATE: ObjectStoreTemplateSummary = {
type: "aws_s3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { computed } from "vue";
import type { DatasetExtraFiles } from "@/api/datasets";
import { PathDestination, useDatasetPathDestination } from "@/composables/datasetPathDestination";
import { type PathDestination, useDatasetPathDestination } from "@/composables/datasetPathDestination";
interface Props {
historyDatasetId: string;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Dataset/DatasetList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BAlert, BTable } from "bootstrap-vue";
import { storeToRefs } from "pinia";
import { computed, onMounted, ref } from "vue";
import { HDASummary } from "@/api";
import { type HDASummary } from "@/api";
import { copyDataset, getDatasets } from "@/api/datasets";
import { updateTags } from "@/api/tags";
import { useHistoryStore } from "@/stores/historyStore";
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Dataset/DatasetName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { BLink } from "bootstrap-vue";
import { computed } from "vue";
import { HDASummary } from "@/api";
import { type HDASummary } from "@/api";
library.add(faCaretDown, faCopy, faEye, faTimesCircle, faPause);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref, watch } from "vue";
import { DatasetStorageDetails } from "@/api";
import { type DatasetStorageDetails } from "@/api";
import { fetchDatasetStorage } from "@/api/datasets";
import { errorMessageAsString } from "@/utils/simple-error";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ConcreteObjectStoreModel } from "@/api";
import { type ConcreteObjectStoreModel } from "@/api";
import ObjectStoreSelectButton from "@/components/ObjectStore/ObjectStoreSelectButton.vue";
import ObjectStoreSelectButtonDescribePopover from "@/components/ObjectStore/ObjectStoreSelectButtonDescribePopover.vue";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BButton } from "bootstrap-vue";
import { storeToRefs } from "pinia";
import { computed, ref } from "vue";
import { ConcreteObjectStoreModel, DatasetStorageDetails } from "@/api";
import { type ConcreteObjectStoreModel, type DatasetStorageDetails } from "@/api";
import { updateObjectStore } from "@/api/objectStores";
import { useObjectStoreStore } from "@/stores/objectStoreStore";
Expand Down
Loading

0 comments on commit e18ba47

Please sign in to comment.