Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
remove (this: any) casts from the codebase
Browse files Browse the repository at this point in the history
Summary:
it's silly to hide errors by just casting to `any` and forgetting about it.
replace them with suppressions.

Reviewed By: pieterv

Differential Revision: D37478365

fbshipit-source-id: 5ea56890fba9fa78e9b47a8b7e868c7e8d862b1a
  • Loading branch information
bradzacher authored and facebook-github-bot committed Jun 29, 2022
1 parent 86c009d commit 8417079
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/model/immutable/ContentState.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,18 @@ class ContentState extends ContentStateRecord {
}

getBlockMap(): BlockMap {
return (this: any).get('blockMap');
// $FlowFixMe[prop-missing] found when removing casts of this to any
return this.get('blockMap');
}

getSelectionBefore(): SelectionState {
return (this: any).get('selectionBefore');
// $FlowFixMe[prop-missing] found when removing casts of this to any
return this.get('selectionBefore');
}

getSelectionAfter(): SelectionState {
return (this: any).get('selectionAfter');
// $FlowFixMe[prop-missing] found when removing casts of this to any
return this.get('selectionAfter');
}

getBlockForKey(key: string): BlockNodeRecord {
Expand Down Expand Up @@ -227,15 +230,18 @@ class ContentState extends ContentStateRecord {
}

setSelectionBefore(selection: SelectionState): ContentState {
return (this: any).set('selectionBefore', selection);
// $FlowFixMe[prop-missing] found when removing casts of this to any
return this.set('selectionBefore', selection);
}

setSelectionAfter(selection: SelectionState): ContentState {
return (this: any).set('selectionAfter', selection);
// $FlowFixMe[prop-missing] found when removing casts of this to any
return this.set('selectionAfter', selection);
}

setBlockMap(blockMap: BlockMap): ContentState {
return (this: any).set('blockMap', blockMap);
// $FlowFixMe[prop-missing] found when removing casts of this to any
return this.set('blockMap', blockMap);
}

static createFromBlockArray(
Expand Down

0 comments on commit 8417079

Please sign in to comment.