chore: upgrade TS 5.2 -> 5.7.3 & ESLint to 9.20.1 (#4032)

* chore: upgrade TS 5.2 -> 5.7.3

* vite dts fix

* lint fix

* resolutions fix

* ui comp build fix

* precommit fix?

* latest eslint version

* autoloader fix

* undo unnecessary viewer change

* eslint fixes fe2 + trying disabled type linting

* lint fixes
This commit is contained in:
Kristaps Fabians Geikins
2025-02-20 14:18:18 +02:00
committed by GitHub
parent d074aed010
commit 1d2a594f0a
148 changed files with 1840 additions and 1302 deletions
+7 -6
View File
@@ -72,12 +72,12 @@
"@datadog/datadog-ci/ws": "^7.5.10",
"@microsoft/api-extractor/semver": "^7.5.4",
"@rushstack/node-core-library/semver": "^7.5.4",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"@typescript-eslint/eslint-plugin": "^8.20.0",
"@typescript-eslint/parser": "^8.20.0",
"@types/react": "file:./packages/frontend-2/type-augmentations/stubs/types__react",
"core-js": "3.22.4",
"core-js-compat/semver": "^7.5.4",
"eslint": "^9.4.0",
"eslint": "^9.20.1",
"eslint-config-prettier": "^9.1.0",
"levelup/bl": ">=1.2.3",
"levelup/semver": ">=5.7.2",
@@ -88,9 +88,10 @@
"rollup-plugin-terser/serialize-javascript": ">=6.0.2",
"simple-update-notifier/semver": "^7.5.4",
"tslib": "^2.3.1",
"typescript": "^5.2.2",
"typescript-eslint": "^7.12.0",
"wait-on": ">=7.2.0"
"typescript": "^5.7.3",
"typescript-eslint": "^8.20.0",
"wait-on": ">=7.2.0",
"vue-tsc@npm:2.2.2/@vue/language-core": "2.2.0"
},
"config": {
"commitizen": {
+2 -2
View File
@@ -57,7 +57,7 @@ const configs = await withNuxt([
'@typescript-eslint/no-for-in-array': ['error'],
'@typescript-eslint/restrict-plus-operands': ['error'],
'@typescript-eslint/await-thenable': ['warn'],
'@typescript-eslint/ban-types': ['warn'],
'@typescript-eslint/no-restricted-types': ['warn'],
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
'no-undef': 'off',
@@ -105,7 +105,7 @@ const configs = await withNuxt([
rules: {
'no-var': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off'
'@typescript-eslint/no-restricted-types': 'off'
}
}
]).prepend([
@@ -52,7 +52,7 @@ export function useAccountsSetup(): DUIAccountsState {
try {
await acc.client.query({ query: accountTestQuery })
acc.isValid = true
} catch (error) {
} catch {
// TODO: properly dispose and kill this client. It's unclear how to do it.
acc.isValid = false
// NOTE: we do not want to delete the client, as we might want to "refresh" in
+1 -1
View File
@@ -17,7 +17,7 @@ export class GenericBridge extends BaseBridge {
try {
availableMethodNames = await this.bridge.GetBindingsMethodNames()
} catch (e) {
} catch {
console.warn(`Failed to get method names.`)
return false
}
+1 -1
View File
@@ -73,7 +73,7 @@
"tailwindcss": "^3.3.2",
"type-fest": "^3.5.1",
"typescript": "^4.8.3",
"vue-tsc": "1.3.4"
"vue-tsc": "^2.2.2"
},
"installConfig": {
"hoistingLimits": "workspaces"
+1 -1
View File
@@ -66,7 +66,7 @@ const tests = ref([
}
).sayHi('Speckle', 0) // note, invalid on purpose, it looks long because ts needs to be happy
return 'not ok'
} catch (e) {
} catch {
return 'ok'
}
},
@@ -420,7 +420,7 @@ const onDetailsSubmit = handleDetailsSubmit(async () => {
parameters: encryptedParams
}
],
triggerDefinitions: <Automate.AutomateTypes.TriggerDefinitionsSchema>{
triggerDefinitions: {
version: Automate.AutomateTypes.TRIGGER_DEFINITIONS_SCHEMA_VERSION,
definitions: [
{
@@ -428,7 +428,7 @@ const onDetailsSubmit = handleDetailsSubmit(async () => {
modelId: model.id
}
]
}
} satisfies Automate.AutomateTypes.TriggerDefinitionsSchema
}
},
{ hideSuccessToast: true }
@@ -39,7 +39,7 @@ import { useDebouncedTextInput } from '@speckle/ui-components'
import { useQueryLoading } from '@vue/apollo-composable'
import { graphql } from '~/lib/common/generated/gql'
import type { CreateAutomationSelectableFunction } from '~/lib/automate/helpers/automations'
import type { Optional } from '@speckle/shared'
import type { Nullable, Optional } from '@speckle/shared'
import { usePaginatedQuery } from '~/lib/common/composables/graphql'
const searchQuery = graphql(`
@@ -91,7 +91,8 @@ const {
query: searchQuery,
baseVariables: computed(() => ({
workspaceId: props.workspaceId ?? '',
search: search.value?.length ? search.value : ''
search: search.value?.length ? search.value : '',
cursor: null as Nullable<string>
})),
resolveKey: (vars) => [vars.search || ''],
resolveCurrentResult: (res) => res?.workspace?.automateFunctions,
@@ -26,7 +26,7 @@
</div>
</template>
<script setup lang="ts">
import { type RunsStatusSummary } from '~/lib/automate/composables/runStatus'
import type { RunsStatusSummary } from '~/lib/automate/composables/runStatus'
import { useAutomationsStatusOrderedRuns } from '~/lib/automate/composables/runs'
import { graphql } from '~/lib/common/generated/gql'
import type { AutomateViewerPanel_AutomateRunFragment } from '~~/lib/common/generated/gql/graphql'
@@ -45,7 +45,7 @@
</template>
<script lang="ts" setup>
import { type LayoutDialogButton } from '@speckle/ui-components'
import type { LayoutDialogButton } from '@speckle/ui-components'
defineProps<{
title?: string
@@ -59,7 +59,7 @@ export default defineComponent({
if (expectStyle) {
for (const [key, value] of Object.entries(expectStyle)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (el.style[key as any] !== value) {
return false
}
@@ -7,7 +7,7 @@
block
@processed="onProcessed"
/>
<ErrorPageGenericUnauthorizedBlock v-else />
<ErrorPageGenericUnauthorizedBlock v-else resource-type="project" />
</NuxtErrorBoundary>
</template>
<script setup lang="ts">
@@ -5,7 +5,7 @@
</NuxtErrorBoundary>
</template>
<script setup lang="ts">
import { type Optional } from '@speckle/shared'
import type { Optional } from '@speckle/shared'
import { useQuery } from '@vue/apollo-composable'
import { workspaceInviteQuery } from '~/lib/workspaces/graphql/queries'
@@ -63,7 +63,7 @@ const isEditing = ref(true)
const label = computed(() => props.label || props.name)
// Kinda stupid, but we have to do this because of minor vee-validate version mismatches and vue kinda messing up the types on ui-components build
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const typesafeRules = computed(() => props.rules as any)
const toggleEditor = () => (isEditing.value = !isEditing.value)
@@ -65,8 +65,6 @@
</fieldset>
</template>
<script setup lang="ts">
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { PlusIcon } from '@heroicons/vue/24/solid'
import {
type ControlElement,
@@ -13,7 +13,7 @@
/>
</template>
<script setup lang="ts">
import { type ControlElement } from '@jsonforms/core'
import type { ControlElement } from '@jsonforms/core'
import { rendererProps, useJsonFormsControl } from '@jsonforms/vue'
import { useJsonRendererBaseSetup } from '~/lib/form/composables/jsonRenderers'
@@ -17,7 +17,7 @@
/>
</template>
<script setup lang="ts">
import { type ControlElement } from '@jsonforms/core'
import type { ControlElement } from '@jsonforms/core'
import { rendererProps, useJsonFormsControl } from '@jsonforms/vue'
import { useJsonRendererBaseSetup } from '~/lib/form/composables/jsonRenderers'
@@ -17,7 +17,7 @@
/>
</template>
<script setup lang="ts">
import { type ControlElement } from '@jsonforms/core'
import type { ControlElement } from '@jsonforms/core'
import { rendererProps, useJsonFormsControl } from '@jsonforms/vue'
import { useJsonRendererBaseSetup } from '~/lib/form/composables/jsonRenderers'
@@ -56,9 +56,9 @@
</FormSelectBase>
</template>
<script setup lang="ts">
import { type ControlElement } from '@jsonforms/core'
import type { ControlElement } from '@jsonforms/core'
import { rendererProps, useJsonFormsEnumControl } from '@jsonforms/vue'
import { type Nullable } from '@speckle/shared'
import type { Nullable } from '@speckle/shared'
import { useFormSelectChildInternals } from '@speckle/ui-components'
import { useJsonRendererBaseSetup } from '~/lib/form/composables/jsonRenderers'
@@ -6,7 +6,7 @@
/>
</template>
<script setup lang="ts">
import { type ControlElement } from '@jsonforms/core'
import type { ControlElement } from '@jsonforms/core'
import { rendererProps, useJsonFormsOneOfEnumControl } from '@jsonforms/vue'
const props = defineProps({
@@ -70,7 +70,6 @@ const onChange = async (e: JsonFormsChangeEvent) => {
const getFormState = (): Optional<JsonFormsChangeEvent> =>
internalRef.value?.jsonforms.core
? ({
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
data: internalRef.value.jsonforms.core.data,
errors: internalRef.value.jsonforms.core.errors
} as JsonFormsChangeEvent)
@@ -18,7 +18,7 @@
/>
</template>
<script setup lang="ts">
import { type ControlElement } from '@jsonforms/core'
import type { ControlElement } from '@jsonforms/core'
import { rendererProps, useJsonFormsControl } from '@jsonforms/vue'
import { useJsonRendererBaseSetup } from '~/lib/form/composables/jsonRenderers'
@@ -14,7 +14,7 @@
/>
</template>
<script setup lang="ts">
import { type ControlElement } from '@jsonforms/core'
import type { ControlElement } from '@jsonforms/core'
import { rendererProps, useJsonFormsControl } from '@jsonforms/vue'
import { useJsonRendererBaseSetup } from '~/lib/form/composables/jsonRenderers'
@@ -18,7 +18,7 @@
/>
</template>
<script setup lang="ts">
import { type ControlElement } from '@jsonforms/core'
import type { ControlElement } from '@jsonforms/core'
import { rendererProps, useJsonFormsControl } from '@jsonforms/vue'
import { useJsonRendererBaseSetup } from '~/lib/form/composables/jsonRenderers'
@@ -16,7 +16,7 @@
/>
</template>
<script setup lang="ts">
import { type ControlElement } from '@jsonforms/core'
import type { ControlElement } from '@jsonforms/core'
import { rendererProps, useJsonFormsControl } from '@jsonforms/vue'
import { useJsonRendererBaseSetup } from '~/lib/form/composables/jsonRenderers'
@@ -17,7 +17,7 @@
/>
</template>
<script setup lang="ts">
import { type ControlElement } from '@jsonforms/core'
import type { ControlElement } from '@jsonforms/core'
import { rendererProps, useJsonFormsControl } from '@jsonforms/vue'
import { useJsonRendererBaseSetup } from '~/lib/form/composables/jsonRenderers'
@@ -63,11 +63,11 @@
</FormSelectBase>
</template>
<script setup lang="ts">
import { type Nullable, type Optional } from '@speckle/shared'
import type { Nullable, Optional } from '@speckle/shared'
import { FormSelectBase, useFormSelectChildInternals } from '@speckle/ui-components'
import { useApolloClient } from '@vue/apollo-composable'
import { type RuleExpression } from 'vee-validate'
import { type PropType } from 'vue'
import type { RuleExpression } from 'vee-validate'
import type { PropType } from 'vue'
import { graphql } from '~/lib/common/generated/gql'
import type { FormSelectModels_ModelFragment } from '~/lib/common/generated/gql/graphql'
import { searchModelsQuery } from '~/lib/form/graphql/queries'
@@ -81,7 +81,7 @@
</div>
</template>
<script setup lang="ts">
import { type Nullable } from '@speckle/shared'
import type { Nullable } from '@speckle/shared'
import { useElementVisibility, useResizeObserver } from '@vueuse/core'
import { usePreviewImageBlob } from '~~/lib/projects/composables/previewImage'
@@ -247,7 +247,7 @@ const onSave = async () => {
parameters
}
],
triggerDefinitions: <Automate.AutomateTypes.TriggerDefinitionsSchema>{
triggerDefinitions: {
version: Automate.AutomateTypes.TRIGGER_DEFINITIONS_SCHEMA_VERSION,
definitions: [
{
@@ -255,7 +255,7 @@ const onSave = async () => {
modelId: model.id
}
]
}
} satisfies Automate.AutomateTypes.TriggerDefinitionsSchema
}
})
if (res?.id) {
@@ -280,7 +280,7 @@ const onSave = async () => {
// Reset everything if props change
watch(
() => <const>[props.revisionFn?.release.function.id, props.revisionFn?.release.id],
() => [props.revisionFn?.release.function.id, props.revisionFn?.release.id] as const,
([newFunctionId, newFunctionRevisionId], [oldFunctionId, oldFunctionRevisionId]) => {
if (
newFunctionId === oldFunctionId &&
@@ -19,6 +19,7 @@
</div>
</template>
<script setup lang="ts">
import type { Nullable } from '@speckle/shared'
import { usePaginatedQuery } from '~/lib/common/composables/graphql'
import { graphql } from '~/lib/common/generated/gql'
import type { ProjectPageAutomationRuns_AutomationFragment } from '~/lib/common/generated/gql/graphql'
@@ -53,7 +54,8 @@ const { identifier, onInfiniteLoad } = usePaginatedQuery({
query: projectAutomationPagePaginatedRunsQuery,
baseVariables: computed(() => ({
projectId: props.projectId,
automationId: props.automation.id
automationId: props.automation.id,
cursor: null as Nullable<string>
})),
resolveKey: (vars) => [vars.projectId, vars.automationId],
resolveCurrentResult: (res) => res?.project?.automation?.runs,
@@ -60,7 +60,7 @@
import { CubeIcon, ExclamationTriangleIcon } from '@heroicons/vue/24/outline'
import { isNonNullable } from '@speckle/shared'
import { graphql } from '~/lib/common/generated/gql'
import { type ProjectPageAutomationsRow_AutomationFragment } from '~/lib/common/generated/gql/graphql'
import type { ProjectPageAutomationsRow_AutomationFragment } from '~/lib/common/generated/gql/graphql'
import { projectAutomationRoute } from '~/lib/common/helpers/route'
import { useViewerRouteBuilder } from '~/lib/projects/composables/models'
@@ -60,7 +60,7 @@ import {
} from '~/lib/projects/graphql/queries'
import type { CreateAutomationSelectableFunction } from '~/lib/automate/helpers/automations'
import { usePaginatedQuery } from '~/lib/common/composables/graphql'
import { Roles } from '@speckle/shared'
import { Roles, type Nullable } from '@speckle/shared'
import type { AutomateOnboardingAction } from '~/components/project/page/automations/EmptyState.vue'
const route = useRoute()
@@ -146,7 +146,8 @@ const {
query: projectAutomationsTabAutomationsPaginationQuery,
baseVariables: computed(() => ({
projectId: projectId.value,
search: search.value?.length ? search.value : null
search: search.value?.length ? search.value : null,
cursor: null as Nullable<string>
})),
options: () => ({
enabled: isAutomateEnabled.value
@@ -20,6 +20,7 @@ import type { ProjectDiscussionsPageResults_ProjectFragment } from '~~/lib/commo
import { GridListToggleValue } from '~~/lib/layout/helpers/components'
import { latestCommentThreadsQuery } from '~~/lib/projects/graphql/queries'
import { usePaginatedQuery } from '~/lib/common/composables/graphql'
import type { Nullable } from '@speckle/shared'
graphql(`
fragment ProjectDiscussionsPageResults_Project on Project {
@@ -41,7 +42,8 @@ const {
query: latestCommentThreadsQuery,
baseVariables: computed(() => ({
projectId: props.project.id,
filter: { includeArchived: !!props.includeArchived }
filter: { includeArchived: !!props.includeArchived },
cursor: null as Nullable<string>
})),
resolveKey: (vars) => {
return { projectId: vars.projectId, ...vars.filter }
@@ -142,7 +142,6 @@ const onCollaboratorRoleChange = async (
// @ts-expect-error: for some reason the type is just a Reference, doesn't know about the user
!t.user ||
// @ts-expect-error: for some reason the type is just a Reference, doesn't know about the user
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
t.user.__ref !== getObjectReference('LimitedUser', collaborator.id).__ref
)
}
@@ -64,7 +64,7 @@ import type {
ProjectsMoveToWorkspaceDialog_ProjectFragment
} from '~~/lib/common/generated/gql/graphql'
import { useMutationLoading, useQuery } from '@vue/apollo-composable'
import { type LayoutDialogButton } from '@speckle/ui-components'
import type { LayoutDialogButton } from '@speckle/ui-components'
import { useMoveProjectToWorkspace } from '~/lib/projects/composables/projectManagement'
import { Roles } from '@speckle/shared'
import { workspacesRoute } from '~/lib/common/helpers/route'
@@ -139,7 +139,8 @@ const {
query: getUsersQuery,
baseVariables: computed(() => ({
query: search.value?.length ? search.value : null,
limit: 50
limit: 50,
cursor: null as Nullable<string>
})),
resolveKey: (vars) => [vars.query || ''],
resolveCurrentResult: (res) => res?.admin.userList,
@@ -95,6 +95,7 @@ import { usePaginatedQuery } from '~/lib/common/composables/graphql'
import { getInvitesQuery } from '~~/lib/server-management/graphql/queries'
import { HorizontalDirection } from '~~/lib/common/composables/window'
import type { LayoutMenuItem } from '~~/lib/layout/helpers/components'
import type { Nullable } from '@speckle/shared'
const { triggerNotification } = useGlobalToast()
const { mutate: resendInvitationMutation } = useMutation(adminResendInviteMutation)
@@ -114,7 +115,8 @@ const {
query: getInvitesQuery,
baseVariables: computed(() => ({
query: search.value?.length ? search.value : null,
limit: 50
limit: 50,
cursor: null as Nullable<string>
})),
resolveKey: (vars) => [vars.query || ''],
resolveCurrentResult: (res) => res?.admin.inviteList,
@@ -99,7 +99,7 @@
</template>
<script setup lang="ts">
import { type PricingPlan } from '@/lib/billing/helpers/types'
import type { PricingPlan } from '@/lib/billing/helpers/types'
import { Roles } from '@speckle/shared'
import {
type WorkspacePlan,
@@ -112,6 +112,7 @@ import { startCase } from 'lodash'
import { pricingPlansConfig } from '~/lib/billing/helpers/constants'
import type { PlanFeaturesList } from '~/lib/billing/helpers/types'
import { XMarkIcon } from '@heroicons/vue/24/outline'
import type { SetupContext } from 'vue'
const emit = defineEmits<{
(e: 'onYearlyIntervalSelected', value: boolean): void
@@ -129,7 +130,7 @@ const props = defineProps<{
activeBillingInterval?: BillingInterval
}>()
const slots = useSlots()
const slots: SetupContext['slots'] = useSlots()
const features = ref(pricingPlansConfig.features)
const isUpgradeDialogOpen = ref(false)
@@ -45,7 +45,7 @@
</template>
<script setup lang="ts">
import { type MaybeNullOrUndefined } from '@speckle/shared'
import type { MaybeNullOrUndefined } from '@speckle/shared'
import type {
SettingsWorkspacesMembersRequestsTable_WorkspaceFragment,
WorkspaceJoinRequestApproveDialog_WorkspaceJoinRequestFragment
@@ -17,7 +17,7 @@
import type { LayoutDialogButton } from '@speckle/ui-components'
import { useApolloClient } from '@vue/apollo-composable'
import { graphql } from '~/lib/common/generated/gql'
import { type SettingsWorkspacesSecurityDomainRemoveDialog_WorkspaceDomainFragment } from '~/lib/common/generated/gql/graphql'
import type { SettingsWorkspacesSecurityDomainRemoveDialog_WorkspaceDomainFragment } from '~/lib/common/generated/gql/graphql'
import {
getCacheId,
getFirstErrorMessage,
@@ -81,13 +81,15 @@
<ViewerViewModesMenu
:open="viewModesOpen"
@force-close-others="activeControl = 'none'"
@update:open="(value: boolean) => toggleActiveControl(value ? 'viewModes' : 'none')"
@update:open="
(value) => toggleActiveControl(value ? 'viewModes' : 'none')
"
/>
<!-- Views -->
<ViewerViewsMenu
:open="viewsOpen"
@force-close-others="activeControl = 'none'"
@update:open="(value: boolean) => toggleActiveControl(value ? 'views' : 'none')"
@update:open="(value) => toggleActiveControl(value ? 'views' : 'none')"
/>
<!-- Zoom extents -->
<ViewerControlsButtonToggle
@@ -101,7 +103,7 @@
<!-- Sun and lights -->
<ViewerSunMenu
:open="activeControl === 'sun'"
@update:open="(value: boolean) => toggleActiveControl(value ? 'sun' : 'none')"
@update:open="(value) => toggleActiveControl(value ? 'sun' : 'none')"
/>
</ViewerControlsButtonGroup>
<ViewerControlsButtonGroup>
@@ -133,7 +135,7 @@
<ViewerExplodeMenu
:open="explodeOpen"
@force-close-others="activeControl = 'none'"
@update:open="(value: boolean) => toggleActiveControl(value ? 'explode' : 'none')"
@update:open="(value) => toggleActiveControl(value ? 'explode' : 'none')"
/>
<!-- Settings -->
<ViewerSettingsMenu />
@@ -106,7 +106,7 @@ const { onKeyDownHandler, updateIsTyping, pauseAutomaticUpdates } =
const { closeAllThreads, open } = useThreadUtilities()
const editor = ref(null as Nullable<{ openFilePicker: () => void }>)
const commentValue = ref(<CommentEditorValue>{ doc: undefined, attachments: undefined })
const commentValue = ref<CommentEditorValue>({ doc: undefined, attachments: undefined })
const threadContainer = ref(null as Nullable<HTMLElement>)
const isPostingNewThread = ref(false)
@@ -466,7 +466,7 @@ onKeyDown('Escape', () => {
})
watch(
() => <const>[isExpanded.value, isViewed.value],
() => [isExpanded.value, isViewed.value] as const,
(newVals, oldVals) => {
const [newIsExpanded, newIsViewed] = newVals
const [oldIsExpanded] = oldVals || [false]
@@ -59,7 +59,7 @@ const { projectId } = useInjectedViewerState()
const loading = ref(false)
const editor = ref(null as Nullable<{ openFilePicker: () => void }>)
const commentValue = ref(<CommentEditorValue>{ doc: undefined, attachments: undefined })
const commentValue = ref<CommentEditorValue>({ doc: undefined, attachments: undefined })
const threadId = computed(() => props.modelValue.id)
const mp = useMixpanel()
@@ -63,7 +63,6 @@
</ViewerLayoutPanel>
</template>
<script setup lang="ts">
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { ChevronLeftIcon } from '@heroicons/vue/24/solid'
import { VisualDiffMode } from '@speckle/viewer'
import { useInjectedViewerState } from '~~/lib/viewer/composables/setup'
@@ -115,6 +115,7 @@ useViewerEventListener(ViewerEvent.Busy, (isBusy: boolean) => {
})
const rootNodes = computed(() => {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
refhack.value
if (!worldTree.value) return []
@@ -132,7 +132,6 @@
</div>
</template>
<script setup lang="ts">
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { ChevronDownIcon } from '@heroicons/vue/24/solid'
import { ClipboardDocumentIcon } from '@heroicons/vue/24/outline'
import type { SpeckleObject } from '~~/lib/viewer/helpers/sceneExplorer'
@@ -83,7 +83,7 @@ import {
type WorkspaceHeader_WorkspaceFragment
} from '~~/lib/common/generated/gql/graphql'
import { Cog8ToothIcon } from '@heroicons/vue/24/outline'
import { type AlertAction } from '@speckle/ui-components'
import type { AlertAction } from '@speckle/ui-components'
import { Roles } from '@speckle/shared'
import { settingsWorkspaceRoutes } from '~/lib/common/helpers/route'
@@ -12,7 +12,7 @@
import { useMutation } from '@vue/apollo-composable'
import { useSynchronizedCookie } from '~/lib/common/composables/reactiveCookie'
import { graphql } from '~/lib/common/generated/gql'
import { type WorkspaceInviteDiscoverableWorkspaceBanner_LimitedWorkspaceFragment } from '~/lib/common/generated/gql/graphql'
import type { WorkspaceInviteDiscoverableWorkspaceBanner_LimitedWorkspaceFragment } from '~/lib/common/generated/gql/graphql'
import { CookieKeys } from '~/lib/common/helpers/constants'
import { useMixpanel } from '~~/lib/core/composables/mp'
import { dashboardRequestToJoinWorkspaceMutation } from '~~/lib/dashboard/graphql/mutations'
+1 -1
View File
@@ -20,7 +20,7 @@ export const useStrictLogger = async (
let nuxtApp: Optional<NuxtApp> = undefined
try {
nuxtApp = useNuxtApp()
} catch (e) {
} catch {
// suppress 'nuxt is not available'
}
+27 -23
View File
@@ -1,8 +1,10 @@
import { omit } from 'lodash-es'
import { baseConfigs, globals, getESMDirname } from '../../eslint.config.mjs'
import { baseConfigs, globals } from '../../eslint.config.mjs'
import withNuxt from './.nuxt/eslint.config.mjs'
import pluginVueA11y from 'eslint-plugin-vuejs-accessibility'
// const configs = withNuxt()
const configs = withNuxt([
{
rules: {
@@ -20,14 +22,15 @@ const configs = withNuxt([
}
},
{
files: ['**/*.{ts,vue}'],
languageOptions: {
parserOptions: {
project: ['./tsconfig.eslint.json'],
extraFileExtensions: ['.vue'],
tsconfigRootDir: getESMDirname(import.meta.url)
}
}
files: ['**/*.{ts,vue}']
// TYPE-AWARE RULES DISABLED DUE TO PERFORMANCE IMPACT
// languageOptions: {
// parserOptions: {
// project: ['./tsconfig.eslint.json'],
// extraFileExtensions: ['.vue'],
// tsconfigRootDir: getESMDirname(import.meta.url)
// }
// }
},
{
files: ['**/*.test.{ts,js}'],
@@ -48,24 +51,25 @@ const configs = withNuxt([
{
files: ['**/*.{ts,tsx,vue}'],
rules: {
'@typescript-eslint/no-explicit-any': ['error'],
'@typescript-eslint/no-unsafe-argument': ['error'],
'@typescript-eslint/no-unsafe-assignment': 'error',
'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-return': 'error',
'@typescript-eslint/no-for-in-array': ['error'],
'@typescript-eslint/restrict-plus-operands': ['error'],
'@typescript-eslint/await-thenable': ['warn'],
'@typescript-eslint/ban-types': ['warn'],
// TYPE-AWARE RULES DISABLED DUE TO PERFORMANCE IMPACT
// '@typescript-eslint/no-explicit-any': ['error'],
// '@typescript-eslint/no-unsafe-argument': ['error'],
// '@typescript-eslint/no-unsafe-assignment': 'error',
// '@typescript-eslint/no-unsafe-call': 'error',
// '@typescript-eslint/no-unsafe-member-access': 'error',
// '@typescript-eslint/no-unsafe-return': 'error',
// '@typescript-eslint/no-for-in-array': ['error'],
// '@typescript-eslint/restrict-plus-operands': ['error'],
// '@typescript-eslint/await-thenable': ['warn'],
// '@typescript-eslint/no-restricted-types': ['warn'],
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
// '@typescript-eslint/require-await': 'error',
'no-undef': 'off',
'@typescript-eslint/unified-signatures': 'off', // DX sucks in vue event definitions
'@typescript-eslint/no-dynamic-delete': 'off', // too restrictive
'@typescript-eslint/restrict-template-expressions': 'off', // too restrictive
'@typescript-eslint/no-invalid-void-type': 'off' // too restrictive
'@typescript-eslint/no-invalid-void-type': 'off', // too restrictive
'@typescript-eslint/no-empty-object-type': 'off' // too restrictive
}
},
...pluginVueA11y.configs['flat/recommended'].map((c) => ({
@@ -107,7 +111,7 @@ const configs = withNuxt([
rules: {
'no-var': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off'
'@typescript-eslint/no-restricted-types': 'off'
}
}
]).prepend([
@@ -13,7 +13,6 @@ export const useJsonFormsChangeHandler = (params: {
const event = ref<JsonFormsChangeEvent>()
const value = computed(() =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
formatJsonFormSchemaInputs(event.value?.data, unref(schema))
)
const hasErrors = computed(() =>
@@ -1,4 +1,4 @@
import { type Optional } from '@speckle/shared'
import type { Optional } from '@speckle/shared'
type EncryptionUtilsModule = typeof import('~/lib/common/utils/tweetnacl')
type EncryptionUtilsModulePromise = Promise<EncryptionUtilsModule>
@@ -12,7 +12,7 @@ import { useQuery } from '@vue/apollo-composable'
import { convertThrowIntoFetchResult } from '~/lib/common/helpers/graphql'
import type { InfiniteLoaderState } from '@speckle/ui-components'
import { isUndefined } from 'lodash-es'
import { type MaybeNullOrUndefined, type Optional } from '@speckle/shared'
import type { MaybeNullOrUndefined, Optional } from '@speckle/shared'
import { useScopedState } from '~/lib/common/composables/scopedState'
export const useApolloClientIfAvailable = () => {
@@ -1,5 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import type { CookieOptions } from 'nuxt/dist/app/composables/cookie'
import dayjs from 'dayjs'
import { useScopedState } from '~~/lib/common/composables/scopedState'
@@ -8,7 +8,7 @@ export const parseGithubRepoUrl = (
let repoUrl: URL
try {
repoUrl = new URL(url)
} catch (e) {
} catch {
return null
}
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { isNullOrUndefined, isUndefinedOrVoid } from '@speckle/shared'
import type { MaybeNullOrUndefined, Optional } from '@speckle/shared'
import { ApolloError, defaultDataIdFromObject } from '@apollo/client/core'
@@ -11,7 +11,7 @@ import { TailwindBreakpoints } from '@speckle/ui-components'
export function markClassesUsed(classes: string[]) {
// this doesn't do anything, we just need PurgeCSS to be able to read
// invocations of this function
// eslint-disable-next-line no-constant-binary-expression
// eslint-disable-next-line no-constant-binary-expression, @typescript-eslint/no-unused-expressions
false && classes
}
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { ApolloLink, InMemoryCache, split, from } from '@apollo/client/core'
import { setContext } from '@apollo/client/link/context'
import { SubscriptionClient } from 'subscriptions-transport-ws'
@@ -395,9 +393,12 @@ function createLink(params: {
errorMessage: errMsg,
graphql: true
}
shouldLogAsWarn
? logger.warn(logContext, 'Apollo Client error: {errorMessage}')
: logger.error(logContext, 'Apollo Client error: {errorMessage}')
if (shouldLogAsWarn) {
logger.warn(logContext, 'Apollo Client error: {errorMessage}')
} else {
logger.error(logContext, 'Apollo Client error: {errorMessage}')
}
}
const { networkError } = res
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
import type { Optional } from '@speckle/shared'
import type { FieldMergeFunction } from '@apollo/client/core'
@@ -1,9 +1,7 @@
/* eslint-disable no-console */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
import { type Optional } from '@speckle/shared'
import type { Optional } from '@speckle/shared'
import type * as Observability from '@speckle/shared/dist/esm/observability/index'
import {
upperFirst,
@@ -1,4 +1,4 @@
import { type LayoutDialogButton } from '@speckle/ui-components'
import type { LayoutDialogButton } from '@speckle/ui-components'
export type TutorialItem = {
title: string
@@ -2,7 +2,7 @@
import type { useJsonFormsArrayControl, useJsonFormsControl } from '@jsonforms/vue'
import { useVanillaArrayControl } from '@jsonforms/vue-vanilla'
import { cloneDeep, merge } from 'lodash-es'
import { type RuleExpression } from 'vee-validate'
import type { RuleExpression } from 'vee-validate'
export function useJsonRendererBaseSetup<
I extends ReturnType<typeof useJsonFormsControl>
@@ -83,7 +83,6 @@ export const arrayListRenderer: JsonFormsRendererRegistryEntry = {
}
export const renderers: JsonFormsRendererRegistryEntry[] = markRaw([
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
...vanillaRenderers,
stringControlRenderer,
booleanControlRenderer,
@@ -907,8 +907,6 @@ function useDisableZoomOnEmbed() {
watch(
() => embedOptions.noScroll.value,
(newNoScrollValue) => {
newNoScrollValue
viewer
const cameraController: CameraController =
viewer.instance.getExtension(CameraController)
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { MeasurementType } from '@speckle/viewer'
import type { SpeckleObject } from '~/lib/viewer/helpers/sceneExplorer'
import { useMixpanel } from '~~/lib/core/composables/mp'
@@ -53,7 +53,7 @@ export class PassReader extends Extension {
protected hasFramebuffer(pass: GPass) {
const renderer = this.viewer.getRenderer().renderer
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return renderer.properties.get(pass.outputTarget).__webglFramebuffer !== undefined
}
@@ -1,10 +1,10 @@
import type { MaybeNullOrUndefined } from '@speckle/shared'
import {
type NumericPropertyInfo,
type PropertyInfo,
type SpeckleObject,
type SpeckleReference,
type StringPropertyInfo
import type {
NumericPropertyInfo,
PropertyInfo,
SpeckleObject,
SpeckleReference,
StringPropertyInfo
} from '@speckle/viewer'
import type { Raw } from 'vue'
@@ -61,7 +61,7 @@ export class SnowFallPass extends BaseGPass {
public setSize(width: number, height: number) {
super.setSize(width, height)
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
this.snowfallMaterial.uniforms['iResolution'].value.set(width, height)
this.snowfallMaterial.needsUpdate = true
}
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { SpeckleStandardMaterial, type SpeckleWebGLRenderer } from '@speckle/viewer'
import {
type MeshStandardMaterialParameters,
@@ -1,4 +1,4 @@
import { type Optional } from '@speckle/shared'
import type { Optional } from '@speckle/shared'
import { omit } from 'lodash-es'
import { activeUserQuery } from '~/lib/auth/composables/activeUser'
import { useApolloClientFromNuxt } from '~/lib/common/composables/graphql'
+2 -2
View File
@@ -95,7 +95,7 @@
"@graphql-codegen/typescript": "^4.1.1",
"@graphql-codegen/visitor-plugin-common": "5.5.0",
"@nuxt/devtools": "^1.7.0",
"@nuxt/eslint": "^0.3.13",
"@nuxt/eslint": "^1.1.0",
"@nuxt/image": "^1.8.1",
"@nuxtjs/tailwindcss": "^6.12.2",
"@parcel/watcher": "^2.4.1",
@@ -142,7 +142,7 @@
"tailwindcss": "^3.4.1",
"type-fest": "^4.24.0",
"typescript": "^4.8.3",
"vue-tsc": "2.0.10",
"vue-tsc": "^2.2.2",
"wait-on": "^6.0.1",
"znv": "^0.4.0",
"zod": "^3.22.4"
@@ -157,7 +157,7 @@ const modelCount = computed(() => project.value?.modelCount.totalCount)
const commentCount = computed(() => project.value?.commentThreadCount.totalCount)
const hasRole = computed(() => project.value?.role)
const canEdit = computed(() => (project.value ? canEditProject(project.value) : false))
const teamUsers = computed(() => project.value?.team.map((t) => t.user))
const teamUsers = computed(() => project.value?.team.map((t) => t.user) || [])
const actionsItems = computed<LayoutMenuItem[][]>(() => {
const items: LayoutMenuItem[][] = [
[
@@ -18,6 +18,7 @@ import { ref } from 'vue'
import { getProjectsQuery } from '~~/lib/server-management/graphql/queries'
import { usePaginatedQuery } from '~/lib/common/composables/graphql'
import { graphql } from '~/lib/common/generated/gql'
import type { Nullable } from '@speckle/shared'
graphql(`
fragment SettingsServerProjects_ProjectCollection on ProjectCollection {
@@ -46,7 +47,8 @@ const {
query: getProjectsQuery,
baseVariables: computed(() => ({
query: search.value?.length ? search.value : null,
limit: 50
limit: 50,
cursor: null as Nullable<string>
})),
resolveKey: (vars) => [vars.query || ''],
resolveCurrentResult: (res) => res?.admin.projectList,
@@ -30,6 +30,7 @@ import { settingsWorkspacesProjectsQuery } from '~~/lib/settings/graphql/queries
import { usePaginatedQuery } from '~/lib/common/composables/graphql'
import { graphql } from '~/lib/common/generated/gql'
import { useWorkspaceProjectsUpdatedTracking } from '~/lib/workspaces/composables/projectUpdates'
import type { Nullable } from '@speckle/shared'
graphql(`
fragment SettingsWorkspacesProjects_ProjectCollection on ProjectCollection {
@@ -63,7 +64,8 @@ const {
baseVariables: computed(() => ({
limit: 50,
filter: { search: search.value?.length ? search.value : null },
slug: slug.value
slug: slug.value,
cursor: null as Nullable<string>
})),
resolveKey: (vars) => [vars.slug, vars.filter?.search || ''],
resolveCurrentResult: (res) => res?.workspaceBySlug.projects,
-2
View File
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/require-await */
import type { Optional } from '@speckle/shared'
import { has as objectHas } from 'lodash-es'
import type { Redis } from 'ioredis'
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-unsafe-return */
import * as Observability from '@speckle/shared/dist/esm/observability/index.js'
import type { IncomingMessage } from 'node:http'
import { get } from 'lodash-es'
@@ -19,7 +19,7 @@ export default defineEventHandler((event) => {
if (isValidTempCookieValue(parsedVal)) {
tempCookieVal = parsedVal
}
} catch (e) {
} catch {
deleteCookie(event, key)
continue
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
// https://v3.nuxtjs.org/concepts/typescript
"extends": "./tsconfig.json",
"exclude": ["./lib/core/nuxt-modules/**/templates/*.js"],
"exclude": ["./lib/core/nuxt-modules/**/templates/*.js", "node_modules"],
"include": ["./.nuxt/nuxt.d.ts", "**/*", ".storybook/**/*", ".*.js"]
}
+1
View File
@@ -3,6 +3,7 @@
"extends": "./.nuxt/tsconfig.json",
"include": ["./.nuxt/nuxt.d.ts", "**/*", ".storybook/**/*"],
"exclude": [
"**/node_modules",
"./lib/core/nuxt-modules/**/templates/*.js",
"./type-augmentations/eslint-only/*.d.ts"
]
@@ -205,6 +205,7 @@ export class Serializer implements IDisposable {
return res.traversed
}
// eslint-disable-next-line @typescript-eslint/no-base-to-string
throw new Error(`Unsupported type '${typeof value}': ${value}.`)
}
+2 -2
View File
@@ -256,7 +256,7 @@ export function buildApolloSubscriptionServer(
if (!token) {
throw new BadRequestError("Couldn't resolve token from auth header")
}
} catch (e) {
} catch {
throw new ForbiddenError('You need a token to subscribe')
}
@@ -279,7 +279,7 @@ export function buildApolloSubscriptionServer(
'Websocket connected and subscription context built.'
)
return buildCtx
} catch (e) {
} catch {
throw new ForbiddenError('Subscription context build failed')
}
},
+8
View File
@@ -53,6 +53,8 @@ const configs = [
'@typescript-eslint/no-unsafe-enum-comparison': 'off', // too restrictive
'@typescript-eslint/unbound-method': 'off', // too many false positives
'@typescript-eslint/no-unnecessary-type-assertion': 'off', // false positives - sometimes they are actually necessary
'@typescript-eslint/no-empty-object-type': 'off', // too restrictive
'@typescript-eslint/only-throw-error': ['error', { allow: ['AssertionError'] }],
// TODO: Enable these
'@typescript-eslint/require-await': 'off', // can be turned on, but there's a lot of fixing to do
@@ -88,6 +90,12 @@ const configs = [
'@typescript-eslint/no-non-null-assertion': 'off'
}
},
{
files: ['**/*.spec.ts', '**/tests/**/*.{js,ts}', 'test/**/*.{js,ts}'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off'
}
},
prettierConfig
]
+1 -1
View File
@@ -7,7 +7,7 @@ export const getMachineId = () => {
try {
const deviceId = machineIdSync()
return deviceId
} catch (error) {
} catch {
const deviceId = uuidv4()
return deviceId
}
@@ -65,7 +65,7 @@ const getApiUrl = (
if (isNullOrUndefined(val)) return
try {
url.searchParams.append(key, val.toString())
} catch (e) {
} catch {
console.log({ val })
}
})
@@ -149,7 +149,7 @@ const invokeRequest = async (params: {
let errorResponse: unknown
try {
errorResponse = await response.json()
} catch (e) {
} catch {
throw new ExecutionEngineBadResponseBodyError(errorReq)
}
@@ -8,7 +8,7 @@ const AUTOMATION_REVISION_ID = 'automationRevisionId'
export async function up(knex: Knex): Promise<void> {
await knex.schema.createTable(AUTOMATIONS_TABLE_NAME, (table) => {
table.string(AUTOMATION_ID).notNullable
table.string(AUTOMATION_ID).notNullable()
table.string(AUTOMATION_REVISION_ID).notNullable()
table.string('automationName').notNullable()
table.string('projectId').notNullable().references('id').inTable('streams')
@@ -60,7 +60,7 @@ export const validateContextView = (contextView: string) => {
// Try parsing URL
try {
new URL(contextView, 'https://unimportant.com')
} catch (e) {
} catch {
throw new FunctionRunReportStatusError('Invalid relative URL')
}
}
@@ -352,7 +352,7 @@ const createAppToken = createAppTokenFactory({
},
source: RunTriggerSource.Manual
})
throw 'this should have thrown'
throw new Error('this should have thrown')
} catch (error) {
if (!(error instanceof Error)) throw error
expect(error.message).contains(
@@ -449,7 +449,7 @@ const createAppToken = createAppTokenFactory({
})
const storedRun = await getFullAutomationRunById(automationRunId)
if (!storedRun) throw 'cant fint the stored run'
if (!storedRun) throw new Error('cant fint the stored run')
const expectedStatus = 'exception'
@@ -562,7 +562,7 @@ const createAppToken = createAppTokenFactory({
})
const storedRun = await getFullAutomationRunById(automationRunId)
if (!storedRun) throw 'cant fint the stored run'
if (!storedRun) throw new Error('cant fint the stored run')
const expectedStatus = 'pending'
@@ -589,7 +589,7 @@ const createAppToken = createAppTokenFactory({
versionId: cryptoRandomString({ length: 10 })
}
})
throw 'this should have thrown'
throw new Error('this should have thrown')
} catch (error) {
if (!(error instanceof Error)) throw error
expect(error.message).contains(
@@ -632,7 +632,7 @@ const createAppToken = createAppTokenFactory({
versionId: cryptoRandomString({ length: 10 })
}
})
throw 'this should have thrown'
throw new Error('this should have thrown')
} catch (error) {
if (!(error instanceof Error)) throw error
expect(error.message).contains(
@@ -675,7 +675,7 @@ const createAppToken = createAppTokenFactory({
versionId: cryptoRandomString({ length: 10 })
}
})
throw 'this should have thrown'
throw new Error('this should have thrown')
} catch (error) {
if (!(error instanceof Error)) throw error
expect(error.message).contains(
@@ -718,7 +718,7 @@ const createAppToken = createAppTokenFactory({
versionId: cryptoRandomString({ length: 10 })
}
})
throw 'this should have thrown'
throw new Error('this should have thrown')
} catch (error) {
if (!(error instanceof Error)) throw error
expect(error.message).contains(
@@ -769,7 +769,7 @@ const createAppToken = createAppTokenFactory({
revisionId: cryptoRandomString({ length: 10 }),
manifest
})
throw 'this should have thrown'
throw new Error('this should have thrown')
} catch (error) {
if (!(error instanceof Error)) throw error
expect(error.message).contains('Only model version triggers are supported')
@@ -819,7 +819,7 @@ const createAppToken = createAppTokenFactory({
revisionId: cryptoRandomString({ length: 10 }),
manifest
})
throw 'this should have thrown'
throw new Error('this should have thrown')
} catch (error) {
if (!(error instanceof Error)) throw error
expect(error.message).contains('The triggering version is not found')
@@ -881,7 +881,7 @@ const createAppToken = createAppTokenFactory({
revisionId: cryptoRandomString({ length: 10 }),
manifest
})
throw 'this should have thrown'
throw new Error('this should have thrown')
} catch (error) {
if (!(error instanceof Error)) throw error
expect(error.message).contains(
@@ -944,7 +944,7 @@ const createAppToken = createAppTokenFactory({
revisionId: cryptoRandomString({ length: 10 }),
manifest
})
throw 'this should have thrown'
throw new Error('this should have thrown')
} catch (error) {
if (!(error instanceof Error)) throw error
expect(error.message).contains('Cannot find a token for the automation')
@@ -1005,7 +1005,7 @@ const createAppToken = createAppTokenFactory({
revisionId: cryptoRandomString({ length: 10 }),
manifest
})
throw 'this should have thrown'
throw new Error('this should have thrown')
} catch (error) {
if (!(error instanceof Error)) throw error
expect(error.message).contains('This is a test automation')
@@ -299,7 +299,7 @@ export type IsStreamCollaborator = (
export type ValidateStreamAccess = (
userId: MaybeNullOrUndefined<string>,
streamId: string,
expectedRole?: string | undefined,
expectedRole?: string,
userResourceAccessLimits?: MaybeNullOrUndefined<TokenResourceIdentifier[]>
) => Promise<boolean>
@@ -12,8 +12,8 @@ export class RateLimitError extends BaseError {
constructor(
rateLimitBreached: RateLimitBreached,
message?: string | undefined,
options?: Options | Error | undefined
message?: string,
options?: Options | Error
) {
super(message || RateLimitError.defaultMessage, options)
this.rateLimitBreached = rateLimitBreached
@@ -8,7 +8,7 @@ export class UserInputError<I extends Info = Info> extends BaseError<I> {
}
export class PasswordTooShortError extends UserInputError {
constructor(minPasswordLength: number, options?: Options | Error | undefined) {
constructor(minPasswordLength: number, options?: Options | Error) {
super(
`Password too short; needs to be ${minPasswordLength} characters or longer.`,
options
@@ -97,7 +97,6 @@ export const loggingPluginFactory: (deps: {
logger.error({ err: e, transaction }, 'Error while defining action name')
}
ctx.request.http
ctx.request.transaction = transaction
ctx.contextValue.log = logger
},
@@ -6,10 +6,12 @@ import { Knex } from 'knex'
export async function up(knex: Knex): Promise<void> {
// do nothing
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
knex.VERSION
}
export async function down(knex: Knex): Promise<void> {
// do nothing
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
knex.VERSION
}
+3 -1
View File
@@ -125,7 +125,9 @@ export default (app: Router, { executeHooks }: { executeHooks: ExecuteHooks }) =
requestDropped = true
}
const gunzippedBuffer = zlib.gunzipSync(gzippedBuffer).toString()
const gunzippedBuffer = zlib
.gunzipSync(new Uint8Array(gzippedBuffer))
.toString()
const gunzippedBufferMegabyteSize =
estimateStringMegabyteSize(gunzippedBuffer)
if (gunzippedBufferMegabyteSize > MAX_FILE_SIZE) {
@@ -45,7 +45,7 @@ export function isSerializedTextEditorValueSchema(schemaJson: string) {
if (deserializedJson && isTextEditorValueSchema(deserializedJson)) {
deserializedSchema = deserializedJson
}
} catch (e) {
} catch {
// Suppressing serialization errors
}
@@ -202,6 +202,7 @@ describe('Objects streaming REST @core', () => {
objsIds.push(row[0])
})
stream.on('end', () => resolve({ manyObjs, objsIds }))
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
stream.on('error', (error: unknown) => reject(error))
})
}
@@ -61,7 +61,7 @@ describe('Scheduled tasks @core', () => {
100,
async () => {
callbackExecuted = true
throw 'catch this'
throw new Error('catch this')
},
// fake lock aquire, always returning an invalid lock
async () => ({ taskName, lockExpiresAt: new Date() }),
@@ -7,7 +7,7 @@ type InsertionObject = Pick<InsertableSpeckleObject, 'data'>
export class ArgumentError extends BaseError {
static defaultMessage = 'Invalid argument value provided'
constructor(message?: string | undefined, options?: Options | Error | undefined) {
constructor(message?: string, options?: Options | Error) {
super(message, options)
}
static statusCode = 400
+1 -1
View File
@@ -119,7 +119,7 @@ export const init: SpeckleModule['init'] = async (app, isInitial) => {
}
)
req.pipe(pipedReq)
req.pipe(pipedReq as unknown as NodeJS.WritableStream)
}
)
@@ -39,12 +39,7 @@ type WorkspaceInfoDetails = {
description: MaybeNullOrUndefined<string>
}
const info: WorkspaceInfoDetails = {
name: null,
description: null
}
type WorkspaceInfo = Record<keyof typeof info, MaybeNullOrUndefined<string>>
type WorkspaceInfo = Record<keyof WorkspaceInfoDetails, MaybeNullOrUndefined<string>>
type Limits = 'uploadSize' | 'automateMinutes'

Some files were not shown because too many files have changed in this diff Show More