Skip to content

fix: clear 23 template lint errors in the Vue components - #934

Merged
ngm merged 2 commits into
TheRestartProject:developfrom
marekl11:fix/clear-template-lint-errors
Oct 19, 2026
Merged

ngm merged 2 commits into
TheRestartProject:developfrom
marekl11:fix/clear-template-lint-errors

Conversation

@marekl11

Copy link
Copy Markdown
Contributor

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/js reports on develop (35 down to 12). Two commits.

Template attributes that do nothing. Four v-else directives carried a condition that Vue ignores, the AlertBanner template tag had an xmlns attribute, EventPage was missing a space between two attributes, and the host list in EventDetails had no :key. The eslint config also gets ResizeObserver and global (used by the jest tests), which were the remaining no-undef errors.

Bindings the compiler throws away. v-bind spreads on the scoped-slot <template> tags in GroupEventScrollTable, an empty @select="" handler in DeviceCategorySelect, and the bound :allow-empty="false" in the two filter components. That last one was a duplicate: the plain allow-empty further down already won, so the multiselects behave the same. GroupMapAndList used the Vue 3 v-model:ready syntax, which Vue 2 turns into a value prop that GroupMap never reads, so it now listens to update:ready directly. Nothing reads mapready yet, so there is no visible change from that.

One visible change: AlertBanner had both :variant="alert.variant" and a static variant="secondary". The static one won, so every alert showed grey whatever variant alert:create stored. 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-compiler on 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) and vue/no-side-effects-in-computed-properties (1). Those need a decision on how the components should work, so I left them alone.

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.
@sonarqubecloud

Copy link
Copy Markdown

@marekl11

Copy link
Copy Markdown
Contributor Author

The red CircleCI run died in the "Setup application" step (vendor/autoload.php missing inside the container, before any test ran), and the same base passes on develop, so it looks like a one-off in the container setup rather than this change. I can't re-run it from the fork, so if you get a chance to retrigger it that would be great.

@ngm
ngm requested a review from edwh October 16, 2026 13:44
@ngm

ngm commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Thanks @marekl11 , I've triggered a rebuild.

@edwh Perhaps you could review the changes themselves when you get a mo? Thanks!

@edwh edwh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 plain allow-empty below the bound one, so removing :allow-empty="false" changes nothing.
  • GroupMapAndList: GroupMap emits update:ready (GroupMap.vue:359), so @update:ready is the right Vue 2 listener.
  • AlertBanner: this is a real fix. The customisable_banners migration added the variant field on purpose, and alert:create takes a variant that defaults to secondary. The static variant="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-else conditions, xmlns, the missing space, the v-bind on 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

@ngm
ngm merged commit f70199a into TheRestartProject:develop Oct 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants