Repository navigation
fix: clear 23 template lint errors in the Vue components - #934
Conversation
Remove the ignored value on four v-else directives, an invalid xmlns on a template tag and a missing space between attributes in EventPage, key the host list in EventDetails, and declare ResizeObserver and global in the eslint config. Templates compile to the same render code.
Remove v-bind spreads on scoped-slot templates and an empty @select handler, which the compiler drops anyway, and the first of two allow-empty attributes (the second one already won). Listen for update:ready on GroupMap instead of the Vue 3 v-model:ready syntax. AlertBanner had both :variant and a static variant="secondary", so every alert rendered grey. Fall back to secondary only when there is no variant.
|
|
The red CircleCI run died in the "Setup application" step ( |
edwh
left a comment
There was a problem hiding this comment.
This review was done by AI (Claude Code) and has not been checked line by line by a person.
Approving. I checked these claims against develop:
allow-empty: both filter components already have a plainallow-emptybelow the bound one, so removing:allow-empty="false"changes nothing.GroupMapAndList:GroupMapemitsupdate:ready(GroupMap.vue:359), so@update:readyis the right Vue 2 listener.AlertBanner: this is a real fix. Thecustomisable_bannersmigration added the variant field on purpose, andalert:createtakes a variant that defaults tosecondary. The staticvariant="secondary"was overriding it. Any live alert created with a different variant will change colour once this ships, which is the intended behaviour.- The rest (
v-elseconditions,xmlns, the missing space, thev-bindon slot templates, the empty@select, the eslint globals) is inert at runtime, as described.
One nit that doesn't block: EventDetails keys hosts by position (:key="index"). A stable id such as the volunteer id would be more robust, but for a static display list it doesn't matter.
Thanks @marekl11.
🤖 Generated with Claude Code



Explanation up front, as asked on #906: this comes from a small project where a local model scans open-source repos for hygiene fixes, Claude re-checks each candidate, and I review the diff before opening a PR.
This clears 23 of the 35 errors that
npx eslint resources/jsreports on develop (35 down to 12). Two commits.Template attributes that do nothing. Four
v-elsedirectives carried a condition that Vue ignores, theAlertBannertemplate tag had anxmlnsattribute,EventPagewas missing a space between two attributes, and the host list inEventDetailshad no:key. The eslint config also getsResizeObserverandglobal(used by the jest tests), which were the remainingno-undeferrors.Bindings the compiler throws away.
v-bindspreads on the scoped-slot<template>tags inGroupEventScrollTable, an empty@select=""handler inDeviceCategorySelect, and the bound:allow-empty="false"in the two filter components. That last one was a duplicate: the plainallow-emptyfurther down already won, so the multiselects behave the same.GroupMapAndListused the Vue 3v-model:readysyntax, which Vue 2 turns into avalueprop thatGroupMapnever reads, so it now listens toupdate:readydirectly. Nothing readsmapreadyyet, so there is no visible change from that.One visible change:
AlertBannerhad both:variant="alert.variant"and a staticvariant="secondary". The static one won, so every alert showed grey whatever variantalert:createstored. It is now:variant="alert.variant || 'secondary'". If grey everywhere was intended, I'm happy to drop that hunk.To check the rest is really inert, I compiled each changed template with the repo's
vue-template-compileron develop and on this branch. DeviceModel, DeviceNotes, DeviceProblem, EventPage and GroupEventScrollTable compile to identical render code, and the other differences are exactly the ones described above.The 12 errors left are
vue/no-mutating-props(6),vue/return-in-computed-property(3),vue/multi-word-component-names(2) andvue/no-side-effects-in-computed-properties(1). Those need a decision on how the components should work, so I left them alone.