Skip to content

Commit 11011a6

Browse files
fix(website): clear the real ESLint findings in apps/website (#15301)
*PR Created by the Glary-Bot Agent* --- ## Summary Running the repo's full ESLint ruleset over `apps/website` reports 181 errors. 169 are auto-fixable Tailwind class ordering (handled in the next PR); this PR clears the 12 that are not. > Stacked on #15300. Base is `glary/website-strict-tsconfig`, so review only the top commit. ## Changes - **What**: - `components/product/api/HeroSection.vue` — `stampAmt` and `conveyorEject` were initialised to `0` and then unconditionally reassigned by **both** branches of the following `if`/`else`, so the initialiser never survived. Declared without an initialiser; TypeScript's definite-assignment analysis covers both paths. - `eslint.config.ts` — the other 10 findings are `vue/no-unused-properties` false positives on the reka-ui wrappers under `components/ui/`, which re-declare a component's props and forward them wholesale via `useForwardPropsEmits` / `reactiveOmit` + `v-bind`. The rule only tracks props referenced by name, so it cannot see the forwarding. The rule is now off for the six wrapper directories. - **Breaking**: none. ## Review Focus **Why a config exception rather than deleting the props.** Deleting them would remove each component's public API — `Sheet.vue` declares `DialogRootProps` purely to forward them. That the codebase already agrees is visible in the tree: **eight of these wrappers carry file-local `/* eslint-disable vue/no-unused-properties -- props forwarded via ... */` comments today**, in `accordion/` and `dialog/`. The `sheet/` ones had simply been missed, which is why they showed up as errors. This moves that existing, hand-maintained exception into config so new wrappers cannot drift the same way. (The now-redundant inline disables are removed by the autofix in the next PR.) **Scope is deliberately narrow.** An earlier revision disabled the rule for all of `components/ui/**`, which would have silently dropped the check on the ten bespoke directories there. It is now limited to the six directories that actually use forwarding helpers. Verified with `eslint --print-config`: | file | `vue/no-unused-properties` | |---|---| | `copyable-field/CopyableField.vue` | `[2]` — active | | `scroll-carousel/ScrollCarousel.vue` | `[2]` — active | | `badge/Badge.vue` | `[2]` — active | | `toggle/Toggle.vue` | `[2]` — active | | `sheet/Sheet.vue` | `[0]` — exempt | | `dialog/Dialog.vue` | `[0]` — exempt | ## Verification ESLint on `apps/website` drops from 181 errors to 169 — all remaining are the auto-fixable Tailwind rules. `astro check` 0 errors · 422 unit tests passing (1 pre-existing `minimaxMusic3` failure, also on `main`) · production build 595 pages. `HeroSection` drives a `<canvas>` animation from those two variables, so I checked it in a production build rather than trusting the type-checker: sampling the full canvas across 6 frames gives 6 distinct checksums, i.e. still animating. (An initial sample of only the top-left 300×300 showed no change — that region is the uniform `fillRect` background, not a regression.) Co-authored-by: Glary-Bot <glary-bot@users.noreply.github.com>
1 parent 7f68e89 commit 11011a6

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

apps/website/src/components/product/api/HeroSection.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ onMounted(() => {
109109
const time = Date.now() / 1000
110110
const cycle = time % 1.0
111111
112-
let stampAmt = 0
113-
let conveyorEject = 0
112+
let stampAmt: number
113+
let conveyorEject: number
114114
115115
if (cycle < 0.35) {
116116
const p = cycle / 0.35
@@ -224,13 +224,13 @@ onUnmounted(() => {
224224
<ProductHeroBadge text="API" />
225225

226226
<h1
227-
class="text-primary-comfy-canvas mt-6 text-3xl/tight font-light md:text-4xl/tight lg:max-w-2xl lg:text-5xl/tight xl:whitespace-pre-line"
227+
class="mt-6 text-3xl/tight font-light text-primary-comfy-canvas md:text-4xl/tight lg:max-w-2xl lg:text-5xl/tight xl:whitespace-pre-line"
228228
>
229229
{{ t('api.hero.heading', locale) }}
230230
</h1>
231231

232232
<p
233-
class="text-primary-comfy-canvas mt-6 max-w-md text-sm lg:mt-6 lg:text-base"
233+
class="mt-6 max-w-md text-sm text-primary-comfy-canvas lg:mt-6 lg:text-base"
234234
>
235235
{{ t('api.hero.subtitle', locale) }}
236236
</p>

eslint.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,24 @@ export default defineConfig([
488488
'import-x/no-unresolved': ['error', { ignore: ['^astro:'] }]
489489
}
490490
},
491+
// These wrappers forward reka-ui props wholesale via
492+
// useForwardPropsEmits/reactiveOmit + v-bind, which the rule cannot trace,
493+
// so it reports every forwarded prop as unused. Deleting them would drop
494+
// the component's public API. Scoped to the wrapper directories so the
495+
// bespoke components under ui/ keep the rule.
496+
{
497+
files: [
498+
'apps/website/src/components/ui/accordion/*.vue',
499+
'apps/website/src/components/ui/dialog/*.vue',
500+
'apps/website/src/components/ui/navigation-menu/*.vue',
501+
'apps/website/src/components/ui/sheet/*.vue',
502+
'apps/website/src/components/ui/slider/*.vue',
503+
'apps/website/src/components/ui/toggle-group/*.vue'
504+
],
505+
rules: {
506+
'vue/no-unused-properties': 'off'
507+
}
508+
},
491509
// i18n import enforcement
492510
// Vue components must use the useI18n() composable, not the global t/d/st/te
493511
{

0 commit comments

Comments
 (0)