Skip to content

style: enable remaining stylistic rules (part 1) - #9630

Open
matheusa1 wants to merge 5 commits into
LibreSign:mainfrom
matheusa1:chore/9498-stylistic-pr1
Open

matheusa1 wants to merge 5 commits into
LibreSign:mainfrom
matheusa1:chore/9498-stylistic-pr1

Conversation

@matheusa1

@matheusa1 matheusa1 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Resolves: #9498

📝 Summary

First of two PRs for #9498, as discussed in the issue. It enables three @stylistic rules that were set to 'off' in the libresign/disabled-during-migration block of eslint.config.mjs. There is one DCO-signed commit per rule, with no behavior change:

  • @stylistic/arrow-parens
  • @stylistic/exp-list-style
  • @stylistic/implicit-arrow-linebreak

Only the 'off' override of each rule was removed, so the options inherited from @nextcloud/eslint-config apply. The fixes were applied with eslint --fix --fix-type layout limited to the lint scope, not with a repository-wide lint:fix. I reviewed the whole diff and every change is parentheses, argument-list layout or line breaks. The second PR will cover function-paren-newline, member-delimiter-style, max-statements-per-line and semi.

Violations measured on the current main, with the rule enabled:

Rule Total src playwright
arrow-parens 234 219 (65 files) 15 (8 files)
exp-list-style 76 60 (23 files) 16 (12 files)
implicit-arrow-linebreak 59 44 (30 files) 15 (11 files)

The full npm run lint also reported 7 extra arrow-parens hits in scripts/ and tests/, which are fixed in the same commit. The totals are higher than the historical estimates in the issue (~168, ~34, ~39), which the issue itself describes as old measurements.

One case needed a manual fix: formatAllowOverride in src/views/Settings/PolicyWorkbench/settings/mail-sender-strategy/realDefinition.ts. eslint --fix does not touch an arrow function that has a comment between the arrow and its body, so it now uses a block body. The translator comment is kept, and npm run lint:translator-hints still passes.

🧪 How to test

git diff --check
npm run lint
npm run ts:check
npm test
npm run build

To check one rule on its own, check out its commit and run npx eslint with no extra flags. Each commit leaves lint without errors.

Validation evidence

  • Focused regression/acceptance test: no new behavior, the existing suite covers the touched files (npm test: 286 files, 3731 tests passed)
  • Relevant lint/type/static-analysis checks: npm run lint (0 errors, 21 warnings that already existed), npm run lint:translator-hints, npm run ts:check
  • Broader suite required by the changed surface: npm run build finished without errors
  • CI reviewed

🎨 UI / Front-end changes

  • Formatting-only changes in frontend source, tests and Playwright specs; no user-visible change, so no screenshots
  • Component/unit (Vitest) and/or E2E (Playwright) tests added or updated: only formatting touched in existing tests, no assertion changed

🚧 Tasks

  • Part 2: function-paren-newline, member-delimiter-style, max-statements-per-line, semi

✅ Checklist

  • I have read and followed the contribution guide.
  • The diff does not contain unrelated refactors or generated changes.
  • Commits follow Conventional Commits where applicable.
  • All commits include the required DCO sign-off.

🤖 AI (if applicable)

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

Summary by CodeRabbit

  • Chores
    • Standardized formatting across application code, end-to-end tests, unit tests, and test utilities.
    • Updated linting configuration to align with the formatting changes.
    • No user-facing behavior or test expectations changed.

A regra estava desligada no bloco de migração do eslint. Ao ligá-la,
os parâmetros únicos das arrow functions passam a ter parênteses, sem
alterar o comportamento.

Signed-off-by: Matheus Andrade <2002matheus@gmail.com>
@matheusa1
matheusa1 requested a review from a team as a code owner November 22, 2026 14:07

@vitormattos vitormattos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review the indentation in some of the files, not just the ones I commented on.

Comment on lines +196 to +202
NcActions: true,
NcActionButton: true,
NcButton: true,
NcDialog: true,
NcLoadingIcon: true,
NcNoteCard: true,
NcTextField: true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that have indent issue here.

Comment on lines +86 to +89
signal: new AbortController().signal,
onUpdate: vi.fn(),
intervalMs: 0,
maxChecks: 2,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look this and other points at this file.

A regra estava desligada no bloco de migração do eslint. Ao ligá-la,
a posição do parêntese de fechamento e da vírgula final nas listas de
argumentos segue o padrão, sem alterar o comportamento.

Signed-off-by: Matheus Andrade <2002matheus@gmail.com>
…ow-linebreak

A regra estava desligada no bloco de migração do eslint. Ao ligá-la,
o corpo das arrow functions fica na mesma linha da seta. Um caso com
comentário antes do corpo virou bloco manualmente, sem mudar o retorno.

Signed-off-by: Matheus Andrade <2002matheus@gmail.com>
…c-pr1

Signed-off-by: Matheus Andrade <2002matheus@gmail.com>
@matheusa1
matheusa1 force-pushed the chore/9498-stylistic-pr1 branch from 91c3ced to 570d65b Compare November 23, 2026 23:05
@matheusa1

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @vitormattos. You were right: @stylistic/indent is still off in this PR, so the autofix of the three new rules rewrote some lines without re-indenting them.

I fixed the stub objects in RequestPicker.spec.ts and the signal/onUpdate/intervalMs/maxChecks options in notificationDeliveryStatus.spec.ts. I also reviewed the indentation of every line added by this PR in all touched files, checking with @stylistic/indent enabled locally only (not committed). The same problem existed in a few more specs and in tests/sdk-generation, and I fixed it. Each fix is squashed into the commit of the rule that caused it, so there is still one commit per rule.

I also rebased onto the current main and resolved the conflicts in eslint.config.mjs. git diff --check, lint, ts:check, the unit tests and the build all pass. One pre-existing mis-indented line in SignPDF.vue is untouched, since it was already like that on main.

…c-pr1

Signed-off-by: Matheus Andrade <2002matheus@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Formatting rule cleanup

Layer / File(s) Summary
Enable formatting rules and update application code
eslint.config.mjs, src/App.vue, src/actions/*, src/components/*, src/helpers/*, src/services/*, src/store/*, src/utils/*, src/views/*
Removes three disabled ESLint formatting rules and updates application-code formatting. VisibleElements gains explicit parameter types, and the current-user signer lookup uses optional chaining.
Update application unit tests
src/tests/**
Reformats callbacks and fixtures. The described test logic, assertions, and fixture values remain unchanged.
Update browser and SDK-related tests
playwright/**, scripts/check-translator-hints.mjs, tests/sdk-generation/*
Reformats callbacks and fixtures in Playwright, translator-hint, and SDK-generation code. The described matching conditions and behavior remain unchanged.

Change: Other

Merge Risk: Minimal · up to 87bca

This change enables three formatting lint rules and reformats code to comply. Runtime behavior is not intended to change, and no concrete risk was found, so it is ready to merge.

Security architecture risk: Minimal · up to 87bca

The PR restores three formatting rules. The checked signing and policy code keeps the same behavior, and no design-level risk was identified.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

playwright/e2e/confetti-after-signing-policy.spec.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

playwright/e2e/direct-sign-frontend.spec.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

playwright/e2e/id-docs-visual.spec.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

  • 107 others
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d4432224-4b45-4645-b115-a05e4f137878
Commits

Reviewing files that changed from the base of the PR and between 18ba62c and 87bca46.

Files selected for processing: 111

  • eslint.config.mjs
  • playwright/e2e/confetti-after-signing-policy.spec.ts
  • playwright/e2e/direct-sign-frontend.spec.ts
  • playwright/e2e/id-docs-visual.spec.ts
  • playwright/e2e/multi-signer-sequential.spec.ts
  • playwright/e2e/observer-participant-flow.spec.ts
  • playwright/e2e/sign-email-token-authenticated.spec.ts
  • playwright/e2e/sign-email-token-unauthenticated.spec.ts
  • playwright/e2e/sign-envelope-unauthenticated-visible-signature.spec.ts
  • playwright/e2e/sign-herself-updates-files-list-with-native-engine.spec.ts
  • playwright/e2e/sign-herself-with-click-to-sign.spec.ts
  • playwright/e2e/sign-herself-with-drawn-signature.spec.ts
  • playwright/e2e/sign-herself-with-pkcs12-certificate.spec.ts
  • playwright/e2e/signer-geolocation-request-sign-validation.spec.ts
  • playwright/e2e/visible-element-persistence.spec.ts
  • playwright/support/mailpit.ts
  • playwright/support/nc-login.ts
  • scripts/check-translator-hints.mjs
  • src/App.vue
  • src/actions/openInLibreSignAction.js
  • src/actions/showStatusInlineAction.js
  • src/components/Draw/FileUpload.vue
  • src/components/FileStatusList.vue
  • src/components/FooterTemplateEditor.vue
  • src/components/PdfEditor/pdfEditorModel.ts
  • src/components/Request/RequestPicker.vue
  • src/components/Request/VisibleElements.vue
  • src/components/RightSidebar/EnvelopeFilesList.vue
  • src/components/RightSidebar/RequestSignatureTab.vue
  • src/components/Signers/Signer.vue
  • src/components/validation/DeviceReportedLocation.vue
  • src/components/validation/IpBasedApproximateLocation.vue
  • src/components/validation/SignerTimestamp.vue
  • src/components/validation/SigningProgress.vue
  • src/helpers/certification.ts
  • src/services/SigningRequirementValidator.ts
  • src/services/directSigning.ts
  • src/services/longPolling.ts
  • src/services/notificationDeliveryStatus.ts
  • src/services/selfSigning.ts
  • src/services/signSubmit.ts
  • src/services/signingDocumentAdapter.ts
  • src/services/validationDocument.ts
  • src/services/visibleElementsService.ts
  • src/store/files.js
  • src/store/filters.js
  • src/store/sign.js
  • src/store/signMethods.js
  • src/store/signatureElements.js
  • src/tests/components/PdfEditor/PdfEditor.spec.ts
  • src/tests/components/Request/RequestPicker.spec.ts
  • src/tests/components/RightSidebar/EnvelopeFilesList.spec.ts
  • src/tests/components/RightSidebar/RequestSignatureTab.spec.ts
  • src/tests/components/Settings/Settings.spec.ts
  • src/tests/components/Signing/DirectSignDialog.spec.ts
  • src/tests/components/validation/DocumentValidationDetails.spec.ts
  • src/tests/components/validation/EnvelopeValidation.spec.ts
  • src/tests/components/validation/SignerDetails.spec.ts
  • src/tests/router/router.spec.ts
  • src/tests/services/notificationDeliveryStatus.spec.ts
  • src/tests/store/files.spec.ts
  • src/tests/store/sign.spec.ts
  • src/tests/testHelpers/jsdomMocks.js
  • src/tests/utils/dialogs.spec.ts
  • src/tests/utils/signerStatusPresentation.spec.ts
  • src/tests/utils/timePresets.spec.ts
  • src/tests/views/DocumentValidationLogic.spec.ts
  • src/tests/views/Documents/IdDocsValidation.spec.ts
  • src/tests/views/FilesList/FileListFilter/FileListFilterStatus.spec.ts
  • src/tests/views/FilesList/FilesList.spec.ts
  • src/tests/views/FilesList/FilesListTableHeader.spec.ts
  • src/tests/views/Settings/PolicyWorkbench/settings/signature-rejection/model.spec.ts
  • src/tests/views/Settings/PolicyWorkbench/settings/tsa/TsaRuleEditor.spec.ts
  • src/tests/views/SignPDF/Sign.spec.ts
  • src/tests/views/SignPDF/_partials/ModalVerificationCode.spec.ts
  • src/tests/views/SigningRequestLogic.spec.ts
  • src/tests/views/Validation.spec.ts
  • src/utils/signRequestUuid.ts
  • src/utils/timePresets.js
  • src/views/CrlManagement/CrlManagement.vue
  • src/views/Documents/IdDocsValidation.vue
  • src/views/FilesList/FileEntry/FileEntryActions.vue
  • src/views/FilesList/FilesListTableHeaderActions.vue
  • src/views/ReadCertificate/CertificateContent.vue
  • src/views/Settings/CertificateCustonOptions.vue
  • src/views/Settings/CertificateEngine.vue
  • src/views/Settings/PolicyWorkbench/Catalog/composables/useCatalogState.ts
  • src/views/Settings/PolicyWorkbench/settings/docmdp/realDefinition.ts
  • src/views/Settings/PolicyWorkbench/settings/expiration-rules/realDefinitions.ts
  • src/views/Settings/PolicyWorkbench/settings/mail-sender-strategy/realDefinition.ts
  • src/views/Settings/PolicyWorkbench/settings/signature-flow/realDefinition.ts
  • src/views/Settings/PolicyWorkbench/settings/signature-footer/model.ts
  • src/views/Settings/PolicyWorkbench/settings/signature-footer/realDefinition.ts
  • src/views/Settings/PolicyWorkbench/settings/signature-hash-algorithm/realDefinition.ts
  • src/views/Settings/PolicyWorkbench/settings/signature-rejection/realDefinition.ts
  • src/views/Settings/PolicyWorkbench/settings/signature-text/realDefinition.ts
  • src/views/Settings/PolicyWorkbench/settings/signer-geolocation/realDefinition.ts
  • src/views/Settings/PolicyWorkbench/settings/signer-ip-geolocation/realDefinition.ts
  • src/views/Settings/PolicyWorkbench/settings/signing-mode/realDefinitions.ts
  • src/views/Settings/PolicyWorkbench/settings/tsa/TsaRuleEditor.vue
  • src/views/Settings/PolicyWorkbench/settings/validation-access/realDefinition.ts
  • src/views/SignPDF/SignPDF.vue
  • src/views/SignPDF/_partials/Sign.vue
  • src/views/Validation.vue
  • tests/sdk-generation/generate.test.cjs
  • tests/sdk-generation/inventory.cjs
  • tests/sdk-generation/live.test.ts
  • tests/sdk-generation/live.ts
  • tests/sdk-generation/nextcloud-axios.test.ts
  • tests/sdk-generation/transport.ts
  • tests/sdk-generation/types.ts
Files with no reviewable changes: 1

  • eslint.config.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
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.

Enable remaining JavaScript and TypeScript formatting rules

2 participants