Skip to content

chore(lint): autofix eslint rules in packages/drivers#26791

Merged
ChumpChief merged 9 commits intomicrosoft:mainfrom
ChumpChief-bot:lint/phase2-autofix-drivers
Mar 27, 2026
Merged

chore(lint): autofix eslint rules in packages/drivers#26791
ChumpChief merged 9 commits intomicrosoft:mainfrom
ChumpChief-bot:lint/phase2-autofix-drivers

Conversation

@ChumpChief-bot
Copy link
Copy Markdown
Contributor

@ChumpChief-bot ChumpChief-bot commented Mar 20, 2026

Summary

  • Applies eslint --fix auto-fixes across all 9 driver packages, removing now-unnecessary rule disablements from each eslint config
  • Most of the cleaned-up disablements were added in chore(lint): upgrade all minimalDeprecated packages to recommended eslint config #26772; two additional preexisting disablements were cleaned up as extra credit:
    • @typescript-eslint/promise-function-async in driver-web-cache
    • no-case-declarations in routerlicious-driver

Manual fixes

  • debugger/src/fluidDebuggerController.ts: removed unnecessary async from a callback that never awaits (fixes @typescript-eslint/no-misused-promises)
  • debugger/src/fluidDebuggerUi.ts: changed == null to === null (fixes eqeqeq)
  • routerlicious-driver/src/test/mapWithExpiration.spec.ts: restored thisArg argument incorrectly removed by eslint auto-fix
  • routerlicious-driver/src/socketModule.ts: restored separate import/re-export pattern (required for side-effects) that was converted to a direct re-export by auto-fix; added inline unicorn/prefer-export-from disable
  • Consolidated duplicate import statements from the same module introduced by the consistent-type-imports auto-fix in local-driver, replay-driver, and routerlicious-driver

Per-package summary

Package Rules fixed Rules remaining
driver-base 6 6
debugger 12 14
driver-web-cache 6 10
file-driver 3 9
local-driver 8 13
odsp-driver-definitions 2 3
replay-driver 3 4
routerlicious-driver 11 17
routerlicious-urlResolver 6 7

Test plan

  • Verify pnpm build passes
  • Spot-check auto-fixed files for correctness

🤖 Generated with Claude Code

ChumpChief-bot and others added 4 commits March 19, 2026 08:06
Applies eslint --fix auto-fixes across 8 driver packages, removing
now-unnecessary rule disablements from each eslint config.

Rules auto-fixed per package:
- driver-base: 6 rules fixed, 6 remain
- driver-web-cache: 6 rules fixed, 10 remain
- file-driver: 3 rules fixed, 9 remain
- local-driver: 8 rules fixed, 13 remain
- odsp-driver-definitions: 2 rules fixed, 3 remain
- replay-driver: 3 rules fixed, 4 remain
- routerlicious-driver: 11 rules fixed, 17 remain
- routerlicious-urlResolver: 6 rules fixed, 7 remain

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Applies eslint --fix auto-fixes, removing 12 now-unnecessary rule
disablements from the eslint config. 14 disablements remain.

Two manual fixes were made to avoid adding new disablements:
- fluidDebuggerController.ts: removed unnecessary `async` from a
  callback that never awaits (fixes @typescript-eslint/no-misused-promises)
- fluidDebuggerUi.ts: changed `== undefined` to `=== null`
  (fixes eqeqeq)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Consolidates duplicate import statements from the same module that
were introduced by eslint's consistent-type-imports auto-fix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ofix

The eslint auto-fixer incorrectly removed the thisArg argument from
a forEach call in mapWithExpiration.spec.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ChumpChief ChumpChief marked this pull request as ready for review March 20, 2026 00:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR applies eslint --fix-driven changes across the drivers packages to remove now-unnecessary rule disablements and align code with the recommended lint rules (notably consistent type-only imports/exports and various unicorn preferences).

Changes:

  • Removes multiple per-package ESLint rule disablements after auto-fixing the underlying issues.
  • Refactors many imports/exports to use import type / export type where appropriate and updates common patterns (e.g., Date.now(), slice(), Set#has, for..of).
  • Includes a few manual correctness-preserving cleanups (e.g., DOM event listener usage, regex .test, removing redundant promise wrappers).

Reviewed changes

Copilot reviewed 93 out of 93 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/drivers/routerlicious-urlResolver/src/urlResolver.ts Switches to type-only imports; uses Set#has and modern string APIs.
packages/drivers/routerlicious-urlResolver/src/test/routerlicious-urlResolver.spec.ts Simplifies async token callback in tests.
packages/drivers/routerlicious-urlResolver/src/nconf.cts Simplifies re-export (export { Provider } from ...).
packages/drivers/routerlicious-urlResolver/src/index.ts Uses export { type ... } for type-only exports.
packages/drivers/routerlicious-urlResolver/eslint.config.mts Removes disables now handled by code fixes.
packages/drivers/routerlicious-driver/src/wholeSummaryUploadManager.ts Splits type vs value imports for consistent-type-imports.
packages/drivers/routerlicious-driver/src/wholeSummaryDocumentStorageService.ts Type-only imports; small boolean/iteration refactors.
packages/drivers/routerlicious-driver/src/urlUtils.ts Type-only imports; prefers spread/join pattern.
packages/drivers/routerlicious-driver/src/treeUtils.ts Separates type/value imports for enums and interfaces.
packages/drivers/routerlicious-driver/src/tokens.ts Converts to type-only import.
packages/drivers/routerlicious-driver/src/test/wholeSummaryDocumentStorageService.spec.ts Switches to node:assert.
packages/drivers/routerlicious-driver/src/test/urlUtils.spec.ts Switches to node:assert.
packages/drivers/routerlicious-driver/src/test/sessionInfoManager.spec.ts Switches to node:assert; replaces forEach with for..of.
packages/drivers/routerlicious-driver/src/test/restWrapper.spec.ts Switches to node:assert.
packages/drivers/routerlicious-driver/src/test/r11sSocketTests.spec.ts Switches to node:assert; replaces forEach with for..of.
packages/drivers/routerlicious-driver/src/test/mapWithExpiration.spec.ts Switches to node:assert; replaces forEach with for..of.
packages/drivers/routerlicious-driver/src/test/errorUtils.spec.ts Switches to node:assert; replaces forEach with for..of.
packages/drivers/routerlicious-driver/src/test/documentService.spec.ts Switches to node:assert.
packages/drivers/routerlicious-driver/src/test/cache.spec.ts Switches to node:assert.
packages/drivers/routerlicious-driver/src/summaryTreeUploadManager.ts Type-only imports; uses new Error; adds braces for switch cases.
packages/drivers/routerlicious-driver/src/storageContracts.ts Type-only imports for interface-only usage.
packages/drivers/routerlicious-driver/src/socketModule.ts Re-exports io directly as SocketIOClientStatic.
packages/drivers/routerlicious-driver/src/shreddedSummaryDocumentStorageService.ts Type-only imports; reorganizes telemetry imports.
packages/drivers/routerlicious-driver/src/sessionInfoManager.ts Type-only imports and import cleanup.
packages/drivers/routerlicious-driver/src/retriableGitManager.ts Type-only imports cleanup.
packages/drivers/routerlicious-driver/src/restWrapperBase.ts Converts import to type-only.
packages/drivers/routerlicious-driver/src/restWrapper.ts Type-only imports cleanup; replaces forEach with for..of; minor ternary refactors.
packages/drivers/routerlicious-driver/src/r11sSnapshotParser.ts Type-only imports; replaces forEach with for..of.
packages/drivers/routerlicious-driver/src/nullBlobStorageService.ts Type-only imports cleanup.
packages/drivers/routerlicious-driver/src/mapWithExpiration.ts Uses Date.now() instead of new Date().valueOf().
packages/drivers/routerlicious-driver/src/index.ts Uses export type for type-only exports.
packages/drivers/routerlicious-driver/src/historian.ts Type-only imports; minor ternary refactor.
packages/drivers/routerlicious-driver/src/gitManager.ts Type-only imports cleanup.
packages/drivers/routerlicious-driver/src/errorUtils.ts Separates type vs value imports; adds braces for switch cases; minor ternary refactor.
packages/drivers/routerlicious-driver/src/documentStorageService.ts Separates type vs value imports (e.g., LoaderCachingPolicy).
packages/drivers/routerlicious-driver/src/documentServiceFactory.ts Separates type vs value imports; consolidates server-services-client imports.
packages/drivers/routerlicious-driver/src/documentService.ts Type-only imports cleanup; reorders token fetcher import.
packages/drivers/routerlicious-driver/src/documentDeltaConnection.ts Type-only import changes in driver-specific delta connection wrapper.
packages/drivers/routerlicious-driver/src/deltaStorageService.ts Type-only imports; replaces length !== 0 with length > 0.
packages/drivers/routerlicious-driver/src/definitions.ts Type-only imports cleanup.
packages/drivers/routerlicious-driver/src/defaultTokenProvider.ts Type-only imports cleanup.
packages/drivers/routerlicious-driver/src/createNewUtils.ts Separates type vs value imports.
packages/drivers/routerlicious-driver/src/contracts.ts Type-only imports cleanup.
packages/drivers/routerlicious-driver/src/cache.ts Minor ternary refactor in constructor.
packages/drivers/routerlicious-driver/eslint.config.mts Removes multiple disables after auto-fixes.
packages/drivers/replay-driver/src/storageImplementations.ts Type-only imports cleanup.
packages/drivers/replay-driver/src/replayDocumentServiceFactory.ts Type-only imports cleanup; marks ReplayController import as type-only.
packages/drivers/replay-driver/src/replayDocumentService.ts Type-only imports cleanup.
packages/drivers/replay-driver/src/replayDocumentDeltaConnection.ts Type-only import cleanup; uses Date.now().
packages/drivers/replay-driver/src/replayController.ts Type-only imports cleanup.
packages/drivers/replay-driver/src/index.ts Uses type modifier in re-exports.
packages/drivers/replay-driver/src/emptyDeltaStorageService.ts Type-only imports cleanup.
packages/drivers/replay-driver/eslint.config.mts Removes disables after auto-fixes.
packages/drivers/odsp-driver-definitions/src/sessionProvider.ts Type-only import cleanup.
packages/drivers/odsp-driver-definitions/src/resolvedUrl.ts Type-only import cleanup.
packages/drivers/odsp-driver-definitions/src/odspCache.ts Type-only import cleanup.
packages/drivers/odsp-driver-definitions/src/index.ts Uses export type / type modifiers for type-only exports.
packages/drivers/odsp-driver-definitions/src/errors.ts Separates type vs value imports (DriverErrorTypes).
packages/drivers/odsp-driver-definitions/eslint.config.mts Removes disables after auto-fixes.
packages/drivers/local-driver/src/localSessionStorageDb.ts Type-only imports; replaces forEach with for..of; minor control-flow refactors.
packages/drivers/local-driver/src/localResolver.ts Type-only imports; uses slice(); adjusts path parsing.
packages/drivers/local-driver/src/localDocumentStorageService.ts Type-only imports; import consolidation; minor predicate simplification.
packages/drivers/local-driver/src/localDocumentServiceFactory.ts Type-only imports cleanup; marks local delta connection import as type-only.
packages/drivers/local-driver/src/localDocumentService.ts Type-only imports cleanup.
packages/drivers/local-driver/src/localDocumentDeltaConnection.ts Type-only imports cleanup; separates value vs type imports.
packages/drivers/local-driver/src/localDeltaStorageService.ts Type-only imports cleanup.
packages/drivers/local-driver/src/localCreateDocument.ts Type-only imports cleanup.
packages/drivers/local-driver/src/auth.ts Type-only imports; uses Date.now(); minor ternary refactor.
packages/drivers/local-driver/eslint.config.mts Removes disables after auto-fixes.
packages/drivers/file-driver/src/index.ts Uses type modifier in re-exports.
packages/drivers/file-driver/src/fileDocumentStorageService.ts Type-only imports cleanup; splits value imports (FileMode, TreeEntry).
packages/drivers/file-driver/src/fileDocumentServiceFactory.ts Type-only imports cleanup; marks delta storage service import as type-only.
packages/drivers/file-driver/src/fileDocumentService.ts Type-only imports cleanup.
packages/drivers/file-driver/src/fileDocumentDeltaConnection.ts Type-only imports cleanup; uses Date.now(); splits ScopeType as value import.
packages/drivers/file-driver/src/fileDeltaStorageService.ts Type-only imports cleanup.
packages/drivers/file-driver/eslint.config.mts Removes disables after auto-fixes.
packages/drivers/driver-web-cache/src/test/FluidCacheIndexedDb.test.ts Uses Number.parseInt.
packages/drivers/driver-web-cache/src/test/FluidCache.test.ts Replaces forEach with for..of at top-level test parametrization.
packages/drivers/driver-web-cache/src/index.ts Uses type modifier in re-export.
packages/drivers/driver-web-cache/src/FluidCacheIndexedDb.ts Splits type/value imports from idb; makes functions async.
packages/drivers/driver-web-cache/src/FluidCache.ts Type-only imports cleanup; uses Date.now(); adjusts Promise.all mapping.
packages/drivers/driver-web-cache/eslint.config.mts Removes disables after auto-fixes.
packages/drivers/driver-base/src/driverUtils.ts Type-only imports; replaces forEach with for..of; uses length > 0.
packages/drivers/driver-base/src/documentDeltaConnection.ts Type-only imports cleanup; minor boolean/ternary refactors; optional catch binding.
packages/drivers/driver-base/eslint.config.mts Removes disables after auto-fixes.
packages/drivers/debugger/src/sanitizer.ts Type-only imports; catch (error); replaces forEach with for..of; modern string APIs.
packages/drivers/debugger/src/sanitize.ts Type-only imports cleanup.
packages/drivers/debugger/src/messageSchema.ts Type-only import (Schema).
packages/drivers/debugger/src/index.ts Uses type modifier in exports.
packages/drivers/debugger/src/fluidDebuggerUi.ts Type-only imports; === null; prefers querySelector and addEventListener; DOM append/remove adjustments.
packages/drivers/debugger/src/fluidDebuggerController.ts Type-only imports cleanup; prefers regex .test; uses addEventListener.
packages/drivers/debugger/src/fluidDebugger.ts Type-only imports cleanup.
packages/drivers/debugger/eslint.config.mts Removes disables after auto-fixes.

ChumpChief-bot and others added 2 commits March 20, 2026 16:55
The eslint auto-fixer converted the import+re-export to a direct
re-export, but the separate import is required for side-effects.
Restores the original pattern with an inline eslint disable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - protocol-definitions, Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid

@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - protocol-definitions, Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid

@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - protocol-definitions, Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious

@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid

@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - protocol-definitions, Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious

1 similar comment
@steffenloesch
Copy link
Copy Markdown
Contributor

/azp run Build - protocol-definitions, Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious

@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - protocol-definitions, Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid

@ChumpChief
Copy link
Copy Markdown
Contributor

/azp run Build - protocol-definitions, Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ChumpChief ChumpChief merged commit 15a93b0 into microsoft:main Mar 27, 2026
30 checks passed
getCircularReplacer,
isFluidError,
normalizeError,
type IFluidErrorBase,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might need run some more. There is a lonely type Foo import now that didn't make it to the import type block.
Seems to be the same for lines 10-26. Things got messier. :/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah sorry about that, somehow I missed this one. I'll do another cleanup pass and open another PR.

brrichards pushed a commit to brrichards/FluidFramework that referenced this pull request Mar 31, 2026
Applies `eslint --fix` auto-fixes across all 9 driver packages, removing now-unnecessary rule disablements from each eslint config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Matt Rakow <ChumpChief@users.noreply.github.com>
Co-authored-by: Matt Rakow <marakow@microsoft.com>
agarwal-navin pushed a commit to agarwal-navin/FluidFramework that referenced this pull request Apr 13, 2026
Applies `eslint --fix` auto-fixes across all 9 driver packages, removing now-unnecessary rule disablements from each eslint config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Matt Rakow <ChumpChief@users.noreply.github.com>
Co-authored-by: Matt Rakow <marakow@microsoft.com>
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.

6 participants