-
Notifications
You must be signed in to change notification settings - Fork 535
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
eslint(telemetry-utils): Prefix telemetry-utils before enabling no-unchecked-record-access #23428
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ import { | |
type ITelemetryBaseEvent, | ||
type ITelemetryBaseLogger, | ||
LogLevel, | ||
type Tagged, | ||
} from "@fluidframework/core-interfaces"; | ||
import { assert } from "@fluidframework/core-utils/internal"; | ||
|
||
|
@@ -15,6 +16,7 @@ import type { | |
ITelemetryEventExt, | ||
ITelemetryLoggerExt, | ||
ITelemetryPropertiesExt, | ||
TelemetryEventPropertyTypeExt, | ||
} from "./telemetryTypes.js"; | ||
|
||
/** | ||
|
@@ -334,7 +336,10 @@ function matchObjects( | |
expected: ITelemetryPropertiesExt, | ||
): boolean { | ||
for (const [expectedKey, expectedValue] of Object.entries(expected)) { | ||
const actualValue = actual[expectedKey]; | ||
const actualValue: | ||
| TelemetryEventPropertyTypeExt | ||
| Tagged<TelemetryEventPropertyTypeExt> | ||
| undefined = actual[expectedKey]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Woah is this really what the formatter wants? I am not a fan of how the RHS of the |
||
if ( | ||
!Array.isArray(expectedValue) && | ||
expectedValue !== null && | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,8 @@ const getMockStore = (settings: Record<string, string>): Storage => { | |
return { | ||
getItem: (key: string): string | null => { | ||
ops.push(key); | ||
return settings[key]; | ||
// eslint-disable-next-line unicorn/no-null | ||
return settings[key] ?? null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the rationale here? Is the calling code prepared to handle There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, getItem is typed to string | null, but returning |
||
}, | ||
getOps: (): Readonly<string[]> => ops, | ||
length: Object.keys(settings).length, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RishhiB, this file change should be redone.
T | undefined
pattern doesn't work as intended. Other changes are okay.