Skip to content

fix(lint): enable ESLint v9 rules and fix existing lint issues - #8101

Merged
vitormattos merged 54 commits into
LibreSign:mainfrom
lfals:fix/eslint-v9-migration-8051
Aug 28, 2026
Merged

fix(lint): enable ESLint v9 rules and fix existing lint issues#8101
vitormattos merged 54 commits into
LibreSign:mainfrom
lfals:fix/eslint-v9-migration-8051

Conversation

@lfals

@lfals lfals commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Resolves: #8051

📝 Summary

Migrates LibreSign to @nextcloud/eslint-config v9 / ESLint 10 (building on #7876) and enables as many new lint rules as reasonably possible without risky or oversized changes.

This PR:

  • Switches to flat config with import { recommended } from '@nextcloud/eslint-config'
  • Fixes flat-config pitfalls (Vue plugin scoping, removal of obsolete eslint-plugin-import overrides)
  • Adds libresign/disabled-during-migration as the source of truth for deferred rules (Talk-style)
  • Enables 41 ESLint rules in separate commits (fix(lint): enable <rule>), with manual review of autofixes
  • Documents 54 remaining disabled rules with inline reasons for follow-up work
  • Removes stale eslint-disable comments for rules that no longer exist

Deferred rules include large formatting/import-sorting churn, translation-sensitive l10n rules, Vue event/slot naming, JSDoc debt, and semantic cleanups that need focused follow-up PRs.

Incorporating #8067 (@masterlouis)

Reviewed the four commits from #8067 (fix/lint-migration). Three were already covered by this branch (baseline flat config, obsolete eslint-disable cleanup, and the temporary disabled-during-migration block). The unique contribution — fix(lint): enable no-console — was cherry-picked as 2a1d705ff:

  • Replaces raw console.error / console.warn with the existing src/logger.js wrapper (@nextcloud/logger) across app code
  • Enables no-console from the recommended config
  • Adds libresign/tests-console-override for test files that intentionally intercept console.* (src/tests/setup.js, src/tests/store/filters.spec.ts)

Co-authored-by: Luigi (@masterlouis) — thank you for the no-console / logger migration work in #8067. This PR supersedes #8067; that PR can be closed once this lands.

🧪 How to test

  1. Check out this branch
  2. Install dependencies: npm ci
  3. Run lint: npm run lint (should exit 0)
  4. Run type check: npm run ts:check
  5. Run unit tests: npm test
  6. Optionally run focused frontend tests for touched areas, e.g.:
    • npx vitest run src/tests/components/Request/RequestPicker.spec.ts
    • npx vitest run src/tests/views/Settings/PolicyWorkbench/settings/signature-text/
  7. Review eslint.config.mjslibresign/disabled-during-migration for remaining deferred rules and their documented reasons

🎨 UI / Front‑end changes

  • ESLint v9 migration baseline and incremental rule fixes across Vue/TS/JS frontend code

  • Minor Vue/template cleanups from enabled rules (e.g. curly, vue/attributes-order, vue/no-boolean-default, unused refs)

  • Replaced deprecated OC.getCurrentUser() with @nextcloud/auth where flagged

  • Replaced raw console.* calls with @nextcloud/logger via src/logger.js (no-console)

  • Screenshots before/after (not applicable — no intentional UI redesign)

  • Tested in multiple browsers (Chrome, Firefox, Safari) – optional but appreciated

  • Components, Unit (with vitest) and/or e2e (with Playwright) tests updated where lint fixes touched test code

  • Accessibility verified (contrast, keyboard navigation, screen reader friendly) – if applicable

  • Design review approved – optional, link to feedback if available

  • Documentation updated (if applicable) – docs repository

🚧 Tasks

✅ Checklist

🤖 AI (if applicable)

  • The content of this PR was partially or fully generated using AI

dependabot Bot and others added 30 commits August 18, 2026 20:33
Bumps [@nextcloud/eslint-config](https://github.com/nextcloud-libraries/eslint-config) from 8.4.2 to 9.0.1.
- [Release notes](https://github.com/nextcloud-libraries/eslint-config/releases)
- [Changelog](https://github.com/nextcloud-libraries/eslint-config/blob/main/CHANGELOG.md)
- [Commits](nextcloud-libraries/eslint-config@v8.4.2...v9.0.1)

---
updated-dependencies:
- dependency-name: "@nextcloud/eslint-config"
  dependency-version: 9.0.1
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
https://eslint.org/docs/latest/use/configure/migration-guide#ignore-files

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Scope Vue overrides to *.vue, drop obsolete eslint-plugin-import
rules, remove stale eslint-disable comments, and temporarily disable
failing rules in libresign/disabled-during-migration (LibreSign#8051).

Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
lfals added 4 commits August 25, 2026 15:03
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Resolve package.json conflict by keeping ESLint v9 engines and
@nextcloud/eslint-config while taking upstream vue-tsc bump.

Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
@github-project-automation github-project-automation Bot moved this to 0. Backlog in Roadmap Aug 28, 2026
@lfals
lfals marked this pull request as draft August 28, 2026 17:57
lfals added 3 commits August 28, 2026 14:59
The switch is already hidden when allowOverrideMutable is false, so
vue-tsc flagged the inner comparison as impossible (TS2367).

Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Vue coerces omitted boolean props to false, so removing default: true
for vue/no-boolean-default broke default-true behavior. Use explicit
default: undefined for those props instead.

Also restore the policy precedence hint spacer without tripping
vue/no-useless-mustaches or vue/html-self-closing.

Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Playwright requires `async ({}, use)` for fixtures without dependencies.
Reverting the no-empty-pattern workaround and disabling that rule for
playwright/**/*.ts instead.

Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
@codecov-commenter

codecov-commenter commented Aug 28, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 58.13953% with 90 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/views/CrlManagement/CrlManagement.vue 0.00% 4 Missing and 3 partials ⚠️
src/views/Validation.vue 0.00% 7 Missing ⚠️
src/components/validation/SigningProgress.vue 45.45% 3 Missing and 3 partials ⚠️
...icyWorkbench/Catalog/components/PolicyRuleCard.vue 0.00% 6 Missing ⚠️
.../views/Settings/PolicyWorkbench/PolicyRuleCard.vue 0.00% 6 Missing ⚠️
src/components/validation/SignerDetails.vue 44.44% 4 Missing and 1 partial ⚠️
...rc/components/RightSidebar/RequestSignatureTab.vue 42.85% 4 Missing ⚠️
src/views/Documents/IdDocsValidation.vue 0.00% 2 Missing and 2 partials ⚠️
...ettings/signature-text/SignatureTextRuleEditor.vue 71.42% 3 Missing and 1 partial ⚠️
src/views/UploadCertificate.vue 42.85% 2 Missing and 2 partials ⚠️
... and 24 more
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Files with missing lines Coverage Δ
src/App.vue 84.61% <ø> (+1.28%) ⬆️
src/actions/openInLibreSignAction.js 90.47% <ø> (ø)
src/actions/showStatusInlineAction.js 100.00% <100.00%> (ø)
src/components/Draw/Editor.vue 81.48% <100.00%> (+1.23%) ⬆️
src/components/MarkdownEditor.vue 32.70% <100.00%> (-2.83%) ⬇️
src/components/PdfEditor/PdfEditor.vue 77.01% <100.00%> (ø)
src/components/PdfEditor/SignatureBox.vue 100.00% <ø> (ø)
src/components/PdfEditor/SignerMenu.vue 100.00% <100.00%> (ø)
...c/components/PreviewSignature/PreviewSignature.vue 100.00% <100.00%> (+2.70%) ⬆️
src/components/Request/IdentifySigner.vue 84.07% <100.00%> (+0.73%) ⬆️
... and 111 more

... and 100 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lfals
lfals marked this pull request as ready for review August 28, 2026 18:47
@vitormattos

This comment was marked as resolved.

Replace raw console calls with the @nextcloud/logger wrapper and scope
no-console off for test files that intentionally intercept console output.

Cherry-picked from masterlouis LibreSign#8067 (775cadb).

Co-authored-by: Luigi <gigi.mastro.wolf@gmail.com>
Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Comment thread src/components/Request/RequestPicker.vue Outdated
Comment thread eslint.config.mjs Outdated
Comment thread src/components/Request/RequestPicker.vue Outdated
Comment thread src/components/validation/SigningProgress.vue Outdated
Comment thread src/tests/views/FilesList/FileEntry.spec.ts Outdated
Comment thread src/views/Account/partials/ManagePassword.vue Outdated
lfals added 2 commits August 28, 2026 16:51
Replace empty catch blocks with .catch(() => null), drop the
tests-console eslint override, and use file-local no-console disables
for test harness files.

Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
Avoid TypeError when test mocks return undefined instead of a promise.

Signed-off-by: Luis Amorim <luisfelipeamorim@hotmail.com>
@lfals
lfals requested a review from vitormattos August 28, 2026 20:24
@vitormattos

Copy link
Copy Markdown
Member

/backport to stable35

@vitormattos
vitormattos merged commit a23e99a into LibreSign:main Aug 28, 2026
64 checks passed
@github-project-automation github-project-automation Bot moved this from 1. to do to 4. to release in Roadmap Aug 28, 2026
@backportbot-libresign

Copy link
Copy Markdown

The backport to stable35 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable35
git pull origin stable35

# Create the new backport branch
git checkout -b backport/8101/stable35

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 7557c1ca c335dc16 2314c68d 09048d22 54eb70f8 139b376d 9436ed23 0c84f50c 99f461ea bb2975d5 518f8a55 ffbee5a5 defcdb74 1b472891 5b394397 cbd935a1 6ccbb9bd 8cada416 9b56b468 f935eda2 23a94d75 858bdbc4 0ea2072d eaffd72f 468e0823 4f52f6e1 f76a95ad dc09db52 d9d2de8c b7ea557c cb767dea a3285e8c 123f2b8b d4aaf0b0 197a6c8d d54a108c 1c35f6bd 3b25b1f5 44f36131 7bb48ba2 f310c81d 2d1ba826 49c26789 aee3f8c3 57fa095e d4c2bbb0 1a268773 6f637556 2a1d705f d9b4b3b4 0e4b4569

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/8101/stable35

Error: Failed to push branch backport/8101/stable35: remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/LibreSign/libresign.git/'


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

Enable ESLint v9 rules and fix existing lint issues

4 participants