Flow: enable unsafe-addition error (#25242)
This commit is contained in:
parent
ba7b6f4183
commit
6aa38e74c7
|
@ -681,6 +681,7 @@ export default class Store extends EventEmitter<{
|
|||
let depth = 0;
|
||||
while (parentID > 0) {
|
||||
if (parentID === ownerID || unsortedIDs.has(parentID)) {
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
depth = depthMap.get(parentID) + 1;
|
||||
depthMap.set(id, depth);
|
||||
break;
|
||||
|
|
|
@ -505,6 +505,7 @@ function reduceSearchState(store: Store, state: State, action: Action): State {
|
|||
if (numPrevSearchResults > 0) {
|
||||
didRequestSearch = true;
|
||||
searchIndex =
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
searchIndex + 1 < numPrevSearchResults ? searchIndex + 1 : 0;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -126,7 +126,10 @@ export default function SnapshotSelector(_: Props) {
|
|||
type="text"
|
||||
inputMode="numeric"
|
||||
pattern="[0-9]*"
|
||||
value={selectedFilteredCommitIndex + 1}
|
||||
value={
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
selectedFilteredCommitIndex + 1
|
||||
}
|
||||
size={`${numFilteredCommits}`.length}
|
||||
onChange={handleCommitInputChange}
|
||||
onClick={handleClick}
|
||||
|
|
|
@ -662,8 +662,10 @@ function bubbleProperties(completedWork: Fiber) {
|
|||
// this value will reflect the amount of time spent working on a previous
|
||||
// render. In that case it should not bubble. We determine whether it was
|
||||
// cloned by comparing the child pointer.
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
actualDuration += child.actualDuration;
|
||||
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
treeBaseDuration += child.treeBaseDuration;
|
||||
child = child.sibling;
|
||||
}
|
||||
|
@ -712,6 +714,7 @@ function bubbleProperties(completedWork: Fiber) {
|
|||
subtreeFlags |= child.subtreeFlags & StaticMask;
|
||||
subtreeFlags |= child.flags & StaticMask;
|
||||
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
treeBaseDuration += child.treeBaseDuration;
|
||||
child = child.sibling;
|
||||
}
|
||||
|
|
|
@ -662,8 +662,10 @@ function bubbleProperties(completedWork: Fiber) {
|
|||
// this value will reflect the amount of time spent working on a previous
|
||||
// render. In that case it should not bubble. We determine whether it was
|
||||
// cloned by comparing the child pointer.
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
actualDuration += child.actualDuration;
|
||||
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
treeBaseDuration += child.treeBaseDuration;
|
||||
child = child.sibling;
|
||||
}
|
||||
|
@ -712,6 +714,7 @@ function bubbleProperties(completedWork: Fiber) {
|
|||
subtreeFlags |= child.subtreeFlags & StaticMask;
|
||||
subtreeFlags |= child.flags & StaticMask;
|
||||
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
treeBaseDuration += child.treeBaseDuration;
|
||||
child = child.sibling;
|
||||
}
|
||||
|
|
|
@ -2217,6 +2217,7 @@ function completeUnitOfWork(unitOfWork: Fiber): void {
|
|||
let actualDuration = completedWork.actualDuration;
|
||||
let child = completedWork.child;
|
||||
while (child !== null) {
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
actualDuration += child.actualDuration;
|
||||
child = child.sibling;
|
||||
}
|
||||
|
|
|
@ -2217,6 +2217,7 @@ function completeUnitOfWork(unitOfWork: Fiber): void {
|
|||
let actualDuration = completedWork.actualDuration;
|
||||
let child = completedWork.child;
|
||||
while (child !== null) {
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
actualDuration += child.actualDuration;
|
||||
child = child.sibling;
|
||||
}
|
||||
|
|
|
@ -122,6 +122,7 @@ function stopProfilerTimerIfRunningAndRecordDelta(
|
|||
|
||||
if (profilerStartTime >= 0) {
|
||||
const elapsedTime = now() - profilerStartTime;
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
fiber.actualDuration += elapsedTime;
|
||||
if (overrideBaseTime) {
|
||||
fiber.selfBaseDuration = elapsedTime;
|
||||
|
@ -215,6 +216,7 @@ function transferActualDuration(fiber: Fiber): void {
|
|||
// where we should count the work of multiple passes.
|
||||
let child = fiber.child;
|
||||
while (child) {
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
fiber.actualDuration += child.actualDuration;
|
||||
child = child.sibling;
|
||||
}
|
||||
|
|
|
@ -122,6 +122,7 @@ function stopProfilerTimerIfRunningAndRecordDelta(
|
|||
|
||||
if (profilerStartTime >= 0) {
|
||||
const elapsedTime = now() - profilerStartTime;
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
fiber.actualDuration += elapsedTime;
|
||||
if (overrideBaseTime) {
|
||||
fiber.selfBaseDuration = elapsedTime;
|
||||
|
@ -215,6 +216,7 @@ function transferActualDuration(fiber: Fiber): void {
|
|||
// where we should count the work of multiple passes.
|
||||
let child = fiber.child;
|
||||
while (child) {
|
||||
// $FlowFixMe[unsafe-addition] addition with possible null/undefined value
|
||||
fiber.actualDuration += child.actualDuration;
|
||||
child = child.sibling;
|
||||
}
|
||||
|
|
|
@ -38,10 +38,6 @@
|
|||
[lints]
|
||||
untyped-type-import=error
|
||||
|
||||
# TODO: We might want to enable this this as a error (the default), it
|
||||
# disallows adding undefined and numbers.
|
||||
unsafe-addition=off
|
||||
|
||||
[options]
|
||||
server.max_workers=4
|
||||
esproposal.class_static_fields=enable
|
||||
|
|
Loading…
Reference in New Issue