Open
Conversation
aa75092 to
f72c9b7
Compare
Member
Author
|
Grrrr, type checking didn't type check (error was introduced and uncaught) |
Gold856
suggested changes
Mar 11, 2026
Contributor
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
Gold856
suggested changes
Mar 23, 2026
photon-client/src/components/cameras/CameraCalibrationInfoCard.vue
Outdated
Show resolved
Hide resolved
05925d7 to
473ea67
Compare
d42f4ae to
46f6355
Compare
Gold856
suggested changes
Mar 23, 2026
Gold856
added a commit
that referenced
this pull request
Mar 23, 2026
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.
277324b to
ede1ca7
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 42 out of 44 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- photon-client/pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
photon-client/src/components/common/pv-select.vue:60
SelectItemincludes an optionaldisabledfield, and some call sites populate it (e.g. to disable rotations for CSI cameras). Howeverpv-selectdoesn't pass item-level disabled state through tov-select, so those options can still be selected. WireSelectItem.disabledinto Vuetify's item props (e.g. viaitem-props/item-disabledsupport) so disabled items are actually non-selectable.
export interface SelectItem<TValue extends string | number> {
name: string | number;
value: TValue;
disabled?: boolean;
}
type SelectItems = SelectItem<T>[] | ReadonlyArray<T>;
const value = defineModel<T>({ required: true });
const props = withDefaults(
defineProps<{
label?: string;
tooltip?: string;
selectCols?: number;
disabled?: boolean;
items: SelectItems;
}>(),
{
selectCols: 9,
disabled: false
}
);
const areSelectItems = (items: SelectItems): items is SelectItem<T>[] => typeof items[0] === "object";
// Computed in case items changes
const items = computed<SelectItem<T>[]>(() => {
// Trivial case for empty list; we have no data
if (!props.items.length) {
return [];
}
if (areSelectItems(props.items)) {
return props.items;
}
return props.items.map((item) => ({ name: item, value: item }));
});
</script>
<template>
<div class="d-flex">
<v-col :cols="12 - selectCols" class="d-flex align-center pl-0 pt-10px pb-10px">
<tooltipped-label :tooltip="tooltip" :label="label" />
</v-col>
<v-col :cols="selectCols" class="d-flex align-center pr-0 pt-10px pb-10px">
<v-select
v-model="value"
:items="items"
item-title="name"
item-value="value"
:disabled="disabled"
hide-details="auto"
variant="underlined"
density="compact"
/>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SpeedSlicer
pushed a commit
to SpeedSlicer/photonvision
that referenced
this pull request
Mar 30, 2026
As a precursor to PhotonVision#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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
We recently had an error that would've been caught by type checking in the frontend (see #2393). This PR implements type checking so that future errors will be caught.
Additionally, this PR contains miscellaneous frontend cleanup that's tangentially related to type-checking.
Meta
Merge checklist: