Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update eslint config in packages/runtime/runtime-utils to extend "recommended" base config #23956

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

RishhiB
Copy link
Contributor

@RishhiB RishhiB commented Feb 28, 2025

The package currently uses our "minimal" config. This PR updates it to use "recommended" and fix the resulting linter violations.

AB#3022

@Copilot Copilot bot review requested due to automatic review settings February 28, 2025 20:08
@github-actions github-actions bot added area: loader Loader related issues area: runtime Runtime related issues base: main PRs targeted against main branch and removed area: runtime Runtime related issues area: loader Loader related issues labels Feb 28, 2025
@github-actions github-actions bot added area: loader Loader related issues area: runtime Runtime related issues labels Feb 28, 2025

Choose a reason for hiding this comment

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

PR Overview

This PR updates the ESLint configuration in packages/runtime/runtime-utils to extend the "recommended" base config and adjusts several files for improved type safety and consistency. Key changes include updating lint rules, standardizing UTF encoding strings from "utf-8" to "utf8", and adding explicit return types as well as minor refactoring throughout the codebase.

Reviewed Changes

File Description
packages/runtime/runtime-utils/.eslintrc.cjs Changed ESLint config from a deprecated minimal config to the recommended configuration.
packages/runtime/runtime-utils/src/dataStoreHelpers.ts Updated type definitions and error handling logic for improved type safety.
packages/runtime/runtime-utils/src/handles.ts Refactored type checking for serialized handles using unknown type.
packages/runtime/runtime-utils/src/unpackUsedRoutes.ts Minor refactoring of conditional logic in accumulating child routes.
packages/common/driver-definitions/src/protocol/storage.ts Standardized encoding strings from "utf-8" to "utf8".
packages/runtime/runtime-utils/src/summaryUtils.ts Added new functions with explicit return types and updated UTF‑8 byte length calculation logic.
packages/runtime/runtime-utils/src/requestParser.ts Refactored URL path extraction and added explicit return types.
packages/runtime/runtime-utils/src/runtimeFactoryHelper.ts Improved type annotations for factory helper class.
packages/runtime/runtime-utils/src/objectstorageutils.ts Updated string slicing and adjusted condition for path existence checking.
packages/loader/driver-utils/src/blob.ts Standardized encoding strings in blob constructor.
packages/loader/driver-utils/src/treeConversions.ts Standardized encoding strings and minor adjustments in tree conversion.
Various test files Updated import paths and added explicit typing for better clarity and Node.js compatibility.
packages/runtime/runtime-utils/src/utils.ts Added explicit return type and replaced fromCharCode with fromCodePoint for compact ID encoding.

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

packages/runtime/runtime-utils/src/summaryUtils.ts:71

  • Verify that the iteration and index decrement logic correctly handles multi-code-unit characters after switching from charCodeAt to codePointAt to ensure the accurate calculation of UTF-8 byte length.
const code = str.codePointAt(i);
@RishhiB RishhiB requested a review from a team as a code owner February 28, 2025 20:42
@github-actions github-actions bot added area: driver Driver related issues public api change Changes to a public API labels Feb 28, 2025
Copy link
Contributor

🔗 Found some broken links! 💔

Run a link check locally to find them. See
https://github.com/microsoft/FluidFramework/wiki/Checking-for-broken-links-in-the-documentation for more information.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

http://localhost:3000/docs/data-structures/tree
- (36:97) 'the Shar..' => http://localhost:3000/docs/api/tree (HTTP 404)

http://localhost:3000/docs/data-structures/tree/
- (36:97) 'the Shar..' => http://localhost:3000/docs/api/tree (HTTP 404)

http://localhost:3000/docs/data-structures/tree/schema-definition
- (30:128) 'SharedTr..' => http://localhost:3000/docs/api/tree (HTTP 404)

http://localhost:3000/docs/start/tree-start
- (44:4) 'the API ..' => http://localhost:3000/docs/api/tree/schemafactory-class (HTTP 404)
- (61:7) 'the API' => http://localhost:3000/docs/api/tree/treechangeevents-interface (HTTP 404)


Stats:
  158264 links
    1304 destination URLs
    1535 URLs ignored
       0 warnings
       3 errors

 ELIFECYCLE  Command failed with exit code 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: driver Driver related issues area: loader Loader related issues area: runtime Runtime related issues base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant