Conversation
aa75092 to
f72c9b7
Compare
|
Grrrr, type checking didn't type check (error was introduced and uncaught) |
Gold856
left a comment
There was a problem hiding this comment.
Too much use of as. Try using https://vuejs.org/api/sfc-script-setup.html#generics to fix most of the instances where you need as. We need to ensure the types are actually correct, not just promise that it's correct.
c839cfe to
97a298a
Compare
photon-client/src/components/cameras/CameraCalibrationInfoCard.vue
Outdated
Show resolved
Hide resolved
05925d7 to
473ea67
Compare
d42f4ae to
46f6355
Compare
| export interface SelectItem<TValue extends string | number = string | number> { | ||
| name: string | number; | ||
| value: string | number; | ||
| value: TValue; | ||
| disabled?: boolean; | ||
| } | ||
| const value = defineModel<string | number | undefined>({ required: true }); | ||
| </script> | ||
|
|
||
| <script setup lang="ts" generic="T extends string | number = string | number"> | ||
| import { computed } from "vue"; | ||
| import TooltippedLabel from "@/components/common/pv-tooltipped-label.vue"; | ||
|
|
||
| type PrimitiveItem = string | number; | ||
| type SelectItems = ReadonlyArray<SelectItem> | ReadonlyArray<PrimitiveItem>; |
There was a problem hiding this comment.
Not sure if you're finished with this, but this whole thing feels weird. There shouldn't need to be a second script tag.
As a precursor to #2394, add a bunch of linting rules to try and catch more mistakes/potential code errors/unnecessary code. Add a bunch of rules from https://eslint.vuejs.org/rules/ in the "uncategorized" section that seem useful to have.
|
So floating promises got fixed, but I did it by just spamming In the case of |
| v-for="(tabGroupData, tabGroupIndex) in tabGroups" | ||
| :key="tabGroupIndex" | ||
| :cols="tabGroupIndex === 1 && useCameraSettingsStore().currentPipelineSettings.doMultiTarget ? 7 : ''" | ||
| :cols="tabGroupIndex === 1 && (useCameraSettingsStore().currentPipelineSettings as any).doMultiTarget ? 7 : ''" |
There was a problem hiding this comment.
I don't love having to use any here, but I don't think there's a better alternative that doesn't significantly complicate it.
Description
We recently had an error that would've been caught by type checking in the frontend (see #2393). This PR implements type checking, in the hope that prior errors will be caught.
Meta
Merge checklist: