Skip to content

eslint 10: four autofixes withheld fleet-wide — each needs its own migration #455

Description

@rubenvdlinde

The fleet is now on eslint 10 + @nextcloud/eslint-config@9 (18 repos, all merged). Four rules had their autofix withheld during that migration because their fixes change meaning, not layout. Each is still enabled at its configured severity and every violation is recorded in eslint-suppressions.json, so the debt is counted and any new occurrence fails the run.

Each needs its own migration PR per app. They are listed here in the order they are safe to do.

1. @nextcloud/l10n-enforce-ellipsis — rewrites a translation KEY

Turns 'Loading...' into 'Loading…' inside a translatable string. The string is the key, so the fix orphans every l10n/*.json entry for it. On openconnector one such string appears in 38 locale files; applying the fix in source alone turned test:l10n red while it was green on development.

Migration: move the source string and all locale files in one commit. ~470 occurrences fleet-wide (openregister 128, procest 91, opencatalogi 43, pipelinq 38, scholiq 25, shillinq 19, docudesk 12, openbuild 8, decidesk 6, doriath 6, openconnector 2).

2. @nextcloud/l10n-non-breaking-space — same problem, invisibly

Replaces the ordinary space before with U+00A0 inside translatable strings. Same key-orphaning effect, but you cannot see it in a diff.

🔑 Worth knowing: the l10n checker reported identical totals on both branches — same file count, same distinct-key count, same en.json size — and still disagreed on pass/fail. The only difference was two bytes inside one key, found by comparing the line as hex. A count that matches is not content that matches.

3. @nextcloud/no-deprecated-library-props — changes rendered DOM

@nextcloud/vue v9 repurposed NcButton's type as the native button type and moved the visual style to variant. The autofix rewrites type="primary"variant="primary", which is correct — but it changes the rendered markup, and tests assert on it: openbuild lost 10 tests on button[data-nc-button-type="primary"] returning undefined (1375/1375 pass on development).

Migration: rename plus the test updates, together. ~820 occurrences (procest 318, openbuild 164, hermiq 155, openconnector 104, launchpad 79, openregister/shillinq 1 each).

4. vue/prefer-define-options — breaks the build outright

Rewrites export default {…} in a plain <script> block into defineOptions({…}) inside <script setup>, carrying props/data/computed/methods across the block boundary. @vue/compiler-sfc then rejects the result:

[@vue/compiler-sfc] defineOptions() cannot be used to declare props. Use defineProps() instead.

It hit 20 components in softwarecatalog and 15 in docudesk — the two apps that pair <script setup> with a second <script> block. This is a semantic refactor, not a lint fix.

Migration: per component, split defineOptions({ name, props }) into defineOptions({ name }) + defineProps({…}). 29 components already carry the invalid shape today (zaakafhandelapp 13, softwarecatalog 10, docudesk 6) — those break on any fresh install that resolves vue ≥ 3.5.41, independent of linting, so this one is the most urgent.

How to reproduce the withhold

npx eslint src --fix --rule '{"@nextcloud/l10n-enforce-ellipsis":"off","@nextcloud/l10n-non-breaking-space":"off","@nextcloud/no-deprecated-library-props":"off","vue/prefer-define-options":"off"}'

Burning debt down

npx eslint src --prune-suppressions after fixing a class removes its entries, so the counts in eslint-suppressions.json are the burn-down tracker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions