chore(frontend): fix ESLint, add Pint+ESLint pre-commit hook, centralize v-html

Fix the broken ESLint setup: add vue-eslint-parser and @typescript-eslint/parser
and wire the TS parser into eslint.config.mjs so .ts and <script lang=ts> parse
(was failing outright). Clear the resulting backlog to a clean 0/0 baseline —
fix genuine issues, relax two intentional-pattern rules (multi-word-component-names,
no-required-prop-with-default).

Add a committed .githooks/pre-commit (enabled via core.hooksPath, auto-set by the
prepare script) that runs Pint on staged PHP and ESLint --max-warnings 0 on staged
resources/scripts JS/TS/Vue, blocking on failure. Add composer/npm lint scripts and
document the gate in CLAUDE.md.

Replace every scattered v-html with a single audited BaseSanitizedHtml component
that DOMPurify-sanitizes its input (new utils/markdown.ts sanitizeHtml), so
server/registry-provided HTML is actually sanitized and vue/no-v-html stays enabled
everywhere but one reviewed sink.
This commit is contained in:
Darko Gjorgjijoski
2026-06-11 11:00:25 +02:00
committed by Darko Gjorgjijoski
parent 1e8b113cc9
commit f3ab0f22fc
31 changed files with 155 additions and 47 deletions

View File

@@ -285,7 +285,7 @@
<div class="flex items-center mt-2">
<BaseRating :rating="review.rating" />
</div>
<div class="mt-2 prose prose-sm max-w-none text-muted" v-html="review.comment" />
<BaseSanitizedHtml class="mt-2 prose prose-sm max-w-none text-muted" :html="review.comment" />
</div>
</div>
</div>
@@ -302,7 +302,7 @@
<!-- License -->
<div v-if="activeTab === 'license'" class="py-6">
<div class="prose prose-sm max-w-none text-muted" v-html="moduleData.license" />
<BaseSanitizedHtml class="prose prose-sm max-w-none text-muted" :html="moduleData.license" />
</div>
</div>