Skip to content

fix(frontend): make the unit suite and stylelint able to run at all - #426

Merged
rubenvdlinde merged 4 commits into
developmentfrom
fix/frontend-checks-can-run
Aug 30, 2026
Merged

fix(frontend): make the unit suite and stylelint able to run at all#426
rubenvdlinde merged 4 commits into
developmentfrom
fix/frontend-checks-can-run

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Supersedes #424 and #425, which deadlocked: each failed exactly the check the other fixes, so neither could ever go green alone.

#424 (hoist @vue/server-renderer)  ->  fails  Vue Quality (stylelint)
#425 (stylelint config)            ->  fails  Frontend Tests (unit)

They are two independent defects that happen to hide each other, so they have to land together.

1. The unit suite could not run at all

All 63 test files failed with zero tests executed:

Error: Cannot find package '@vue/server-renderer' imported from
       node_modules/@vue/test-utils/dist/vue-test-utils.cjs.js

Nothing was missing from the lockfile — it was installed nested at node_modules/vue/node_modules/@vue/server-renderer. @vue/test-utils declares it as a peer, and a peer resolves upward from the importing package's directory, so it looked for node_modules/@vue/server-renderer and found nothing. Declaring it directly pins it at the top level, which is where a peer has to be.

2. stylelint could not run at all

Exit 78 — a configuration failure, not a lint finding:

Could not find "stylelint-config-recommended".

stylelint.config.js extended stylelint-config-recommended-vue, which was never declared in package.json; the config it extends was not installed at all. launchpad already declares @nextcloud/stylelint-config, which is what openregister, opencatalogi, dossiq and shillinq extend — so this points it at the package the app declares and the fleet uses.

That made stylelint run, exposing 44 real violations it had been hiding. 42 were auto-fixable. The last two were a genuine CSS bug:

background-color: #ffffff !important;
background-image: none    !important;
background:       #ffffff !important;   /* silently discards both */

Keeping only the shorthand preserves the computed result exactly — keeping the longhands would not have, since the shorthand also resets the other background sub-properties.

3. …and then the two fixers fought

stylelint's indentation rule wanted 0 tabs on six wrapped selector lines; Prettier wanted them indented. Running either fixer broke the other's check. Both indentation and string-quotes are deprecated in stylelint 15 precisely because formatters do this better, so they are off and Prettier owns whitespace — leaving stylelint to judge what only it can judge.

Verification (all three together, on this branch)

stylelint   exit 0
prettier    exit 0
vitest      63 files passed, 682 tests passed

Conduction Release Bot added 4 commits August 30, 2026 12:23
Every one of the 63 frontend test files failed, with no tests executed
at all:

  Error: Cannot find package '@vue/server-renderer' imported from
  node_modules/@vue/test-utils/dist/vue-test-utils.cjs.js

The package was installed, but NESTED at
node_modules/vue/node_modules/@vue/server-renderer rather than hoisted.
@vue/test-utils declares it as a PEER dependency ('3.x'), and a peer is
resolved upward from the importing package's own directory -- so
@vue/test-utils looked for node_modules/@vue/server-renderer, which did
not exist. Nothing was missing from the lockfile; it was in the wrong
place.

Declaring it directly pins it at the top level, which is where a peer
has to be. Version tracks vue itself (^3.5.42).

Verified locally: reproduced the failure first (1 file, 'no tests'),
then after the change the full suite runs -- 63 files passed, 682 tests
passed, 0 failed.
stylelint exited 78 -- a CONFIGURATION failure, not a lint finding:

  Could not find "stylelint-config-recommended".

stylelint.config.js extended 'stylelint-config-recommended-vue', which
was never declared in package.json. It was present only transitively,
and the config it in turn extends, stylelint-config-recommended, was not
installed at all.

launchpad already declares @nextcloud/stylelint-config ^2.4.0, and that
is what openregister, opencatalogi, dossiq and shillinq all extend. This
points the config at the package the app declares and the fleet uses,
rather than adding two more dependencies to prop up an outlier.

That made stylelint RUN, which surfaced 44 real violations the
configuration error had been hiding. 42 were auto-fixable
(rule-empty-line-before, plus a few over-indented selector continuation
lines) and were fixed with --fix; the diff outside css/ is whitespace
only.

The last two were a genuine CSS bug in css/header-override.css:

  background-color: #ffffff !important;
  background-image: none !important;
  background:       #ffffff !important;   <- discards both of the above

The shorthand alone already sets the colour and resets background-image
to none, so keeping only it preserves the computed result EXACTLY.
Keeping the longhands instead would not have, because the shorthand also
resets the other background sub-properties.

Verified: stylelint now exits 0.
The previous commit made stylelint run, and it and Prettier then
disagreed about the same six lines. Prettier indents a wrapped selector
list; stylelint's `indentation` rule demanded 0 tabs there. Running
either fixer broke the other check:

  npm run stylelint:fix  ->  Frontend Check (format) fails
  npm run format:fix     ->  Vue Quality (stylelint) fails

Both `indentation` and `string-quotes` are DEPRECATED in stylelint 15 --
it prints a deprecation warning for each on every run -- precisely
because formatters do this better. Turning them off resolves the conflict
in favour of the tool that owns formatting and leaves stylelint judging
what only it can judge: CSS semantics.

The three files are re-formatted to Prettier's shape.

Verified: stylelint exit 0 AND prettier exit 0 together, with the two
deprecation warnings gone.
…ed-config' into fix/frontend-checks-can-run
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/launchpad @ 92c3af0

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
check-manifest
format
check-schema-l10n
composer ✅ 104/104
npm ✅ 544/544
app:check-code ⏭️
info.xml
REUSE
PHPUnit
Newman
Playwright 🚨 NO VERDICT — enabled but never ran
Hydra gates

Quality workflow — 2026-08-30 10:44 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde
rubenvdlinde merged commit 4d3819d into development Aug 30, 2026
43 checks passed
@rubenvdlinde
rubenvdlinde deleted the fix/frontend-checks-can-run branch August 30, 2026 10:45
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.

1 participant