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

Enable no-unchecked-record-access rule for map #23711

Closed
wants to merge 2 commits into from

Conversation

RishhiB
Copy link
Contributor

@RishhiB RishhiB commented Jan 31, 2025

ESLint Configuration Changes:

  • Changed the rule for @fluid-internal/fluid/no-unchecked-record-access from "warn" to "error" in the .eslintrc.cjs file by removing the line

Needs Review:

  • Updated test assertions in directory.spec.ts to use optional chaining:
    • Changed value[0] to value?.[0] and value[1] to value?.[1] in multiple test cases for both fooSubDir and fooSubDir2 iterator results
  • Modified serialize function to use optional chaining when accessing tree properties:
    • Changed header.type to header?.type
    • Changed header.content to header?.content

@RishhiB RishhiB self-assigned this Jan 31, 2025
@Copilot Copilot bot review requested due to automatic review settings January 31, 2025 16:38
@github-actions github-actions bot added area: dds Issues related to distributed data structures base: main PRs targeted against main branch labels Jan 31, 2025
@RishhiB RishhiB changed the title feat(map): Add no-unchecked-record-access rule Enable no-unchecked-record-access rule for map Jan 31, 2025

Choose a reason for hiding this comment

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

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

@RishhiB RishhiB requested review from jason-ha and a team January 31, 2025 17:26
const content = summaryTree.tree.header.content as string;
const content = summaryTree.tree.header?.content as string;
Copy link
Contributor

Choose a reason for hiding this comment

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

? doesn't make a difference to type checking. Should probably also remove the ? allowance in the linter rule (like removing T | undefined).
? is permissible to use in test code (in simple equality assertion checks).
To fix this ! could be used.
For packages that only have issues in test code, could move the warning to test only.

@RishhiB RishhiB closed this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds Issues related to distributed data structures base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants