Repository navigation
middleware: fix lint and formatting, remove dead code - #64
Merged
Merged
Conversation
This was referenced Nov 22, 2026
This was referenced Nov 22, 2026
Bring middleware/ to a clean `deno fmt` and `deno lint` state without changing the published API. - Format logger, static, csrf, the tests and the example with deno fmt. - main.test.ts: use the import-map `@std/assert` specifier and prefix unused parameters with an underscore. - main.ts: fix the module doc comment so its example renders as a code block. - aiblock: drop the empty Options interface and unused parameter, and ignore blank lines in the fetched blocklist, since an empty entry would match every user agent. - session: remove the unused ulid import, TTL constant, kvKey and the commented-out legacy implementation, drop the unused `url` and `key` options, and export rotateSession as its JSDoc describes. - auth: remove the unused `only` and `except` options, honor `signin` (default unchanged) and document that the cookie check is not real authentication. session, auth and csrf are not part of the package exports and are not imported elsewhere in the repo. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
carlrafting
force-pushed
the
claude/middleware-cleanup
branch
from
November 23, 2026 08:30
2cd1f45 to
134fe75
Compare
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
Brings
middleware/to a cleandeno fmtanddeno lintstate (it had 15 lint errors and 8 unformatted files) without changing the published API.deno fmtonlogger.ts,static.ts,csrf.ts, both test files andexample/serve.ts. The only change incsrf.tsis indentation.main.test.ts: use the import-map@std/assertspecifier instead of an unversionedjsr:import; prefix unused params with_.main.ts: fix the module doc comment so its example renders as a code block.aiblock: drop the emptyOptionsinterface and the unused parameter (aiblock()takes no arguments; nothing in the repo passed one). Blank lines in the fetched blocklist are now ignored, since an empty entry would match every user agent and block all requests. The upstream list has no blank lines today, so behavior is unchanged.session: remove the unusedulidimport, TTL constant andkvKey, plus about 55 lines of commented-out legacy code. Drop the unusedurlandkeyoptions. ExportrotateSession, which its JSDoc already documents as usable.auth: remove the unusedonlyandexceptoptions and honorsignin(default/signin, as before). Document that the cookie check is not real authentication.session,authandcsrfare not in the package exports and nothing else in the repo imports them, so none of this changes published API.Not in this PR
session,authandcsrfare not finished or redesigned.authstill trusts anyauthenticatedcookie.deno doc --lintstill reports 17 errors, mostly missing JSDoc on exports.compose.Test plan
deno fmt --check,deno lint,deno checkanddeno task testpass inmiddleware/(3 tests)deno checkand theroutestests passtestlegs andtype checkblocking;formatandlintshould now pass formiddleware/(other packages may still report problems)🤖 Generated with Claude Code