Repository navigation
Chore: lint and format the test code - #12
Merged
Merged
Conversation
About a megabyte of test code sat outside every quality gate: biome.json's globs covered api/src, ui/js, ui/widgets, scripts and e2e, and nothing else. Adding the three test directories found 27 requires that nothing used, one accumulator that was written and never read, and a shadow of the deprecated unescape global. Six rules are relaxed for those directories, because they are right for source and wrong for a test: a stub whose signature has to match a real one keeps its unused parameter, a scanner keeps its assignment-in-condition, and 'use strict' stays where a test depends on strict-mode semantics rather than being deleted as redundant. Typechecking them is left out and the reason is written down: checkJs over api/test reports 131 errors, nearly all narrowing around server.address() in harnesses, and clearing them means JSDoc casts across forty files for no behaviour change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
api/test/**/*.js,api/test-support/**/*.jsandui/test/**/*.mjstobiome.json'sfiles.includes, so lint and format cover them.overridesentry turning off six rules for those directories only:noAssignInExpressions,noRedundantUseStrict,noTemplateCurlyInString,noGlobalEval,noCommaOperatorandnoUnusedFunctionParameters. Each is correct for source and wrong for a test; the'use strict'one is load-bearing, sincewidget-settings.test.jsasserts that a frozen write throws, which only happens in strict mode.requires across 24 files, an unused response-body accumulator insession-revocation.test.js(the listener still drains the stream), an unused handler parameter inprovider-dispatch.test.js, and a local namedunescapeshadowing the deprecated global inlog.test.js.CONTRIBUTING.mdthat the test directories are linted but not typechecked, with the measured cost of changing that, and add two tests asserting the linter covers them and that the typecheck exclusion stays documented.Testing
All green: 1053 backend, 549 frontend, lint, format, both typechecks, coverage floor. Added 2 tests. Verified by re-running both suites after the reformat, not only after the edits.
Checklist