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

Commit

Permalink
update comments in mobile to support error codes
Browse files Browse the repository at this point in the history
Summary:
This updates `html/js/mobile` suppressions to use error codes.

This diff was generated by running
```
~/fbsource/fbcode/flow/tool update-suppressions ~/www/html/js/mobile --bin ~/fbsource/fbcode/flow/facebook/flowd
hg status -n --rev master | xargs grep -P -l '@(partially-)?generated' | xargs hg revert -r master
hg status -n --rev master | xargs grep -P -l 'lightSyntaxTransform' | xargs hg revert -r master
~/fbsource/fbcode/flow/tool add-comments ~/www/html/js/mobile
~/fbsource/fbcode/flow/tool add-comments ~/www
```
on top of D22399626

bypass-lint
allow_many_files
drop-conflicts

Reviewed By: jbrown215

Differential Revision: D22400003

fbshipit-source-id: 879530c4f37a8c4d1159fce1d7a36bdde27996d7
  • Loading branch information
Daniel Sainati authored and facebook-github-bot committed Jul 7, 2020
1 parent d949433 commit fb728fd
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 39 deletions.
18 changes: 9 additions & 9 deletions src/component/base/DraftEditor.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
accessibilityID: this._placeholderAccessibilityID,
};

/* $FlowFixMe(>=0.112.0 site=www,mobile) This comment suppresses an error
* found when Flow v0.112 was deployed. To see the error delete this
* comment and run Flow. */
/* $FlowFixMe[incompatible-type] (>=0.112.0 site=www,mobile) This comment
* suppresses an error found when Flow v0.112 was deployed. To see the
* error delete this comment and run Flow. */
return <DraftEditorPlaceholder {...placeHolderProps} />;
}
return null;
Expand Down Expand Up @@ -363,9 +363,9 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {

// The aria-expanded and aria-haspopup properties should only be rendered
// for a combobox.
/* $FlowFixMe(>=0.68.0 site=www,mobile) This comment suppresses an error
* found when Flow v0.68 was deployed. To see the error delete this comment
* and run Flow. */
/* $FlowFixMe[prop-missing] (>=0.68.0 site=www,mobile) This comment
* suppresses an error found when Flow v0.68 was deployed. To see the error
* delete this comment and run Flow. */
const ariaRole = this.props.role || 'textbox';
const ariaExpanded =
ariaRole === 'combobox' ? !!this.props.ariaExpanded : null;
Expand Down Expand Up @@ -558,9 +558,9 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
const editHandler = {...handlerMap.edit};

if (onPaste) {
/* $FlowFixMe(>=0.117.0 site=www,mobile) This comment suppresses an error found
* when Flow v0.117 was deployed. To see the error delete this comment
* and run Flow. */
/* $FlowFixMe[incompatible-type] (>=0.117.0 site=www,mobile) This comment
* suppresses an error found when Flow v0.117 was deployed. To see the
* error delete this comment and run Flow. */
editHandler.onPaste = onPaste;
}

Expand Down
6 changes: 3 additions & 3 deletions src/component/contents/DraftEditorContents-core.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ class DraftEditorContents extends React.Component<Props> {
const child = React.createElement(
Element,
childProps,
/* $FlowFixMe(>=0.112.0 site=www,mobile) This comment suppresses an
* error found when Flow v0.112 was deployed. To see the error delete
* this comment and run Flow. */
/* $FlowFixMe[incompatible-type] (>=0.112.0 site=www,mobile) This
* comment suppresses an error found when Flow v0.112 was deployed. To
* see the error delete this comment and run Flow. */
<Component {...componentProps} key={key} />,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ class DraftEditorContentsExperimental extends React.Component<Props> {
blockRenderMap.get('unstyled');
const wrapperTemplate = configForType.wrapper;
processedBlocks.push({
/* $FlowFixMe(>=0.112.0 site=www,mobile) This comment suppresses an
* error found when Flow v0.112 was deployed. To see the error delete
* this comment and run Flow. */
/* $FlowFixMe[incompatible-type] (>=0.112.0 site=www,mobile) This
* comment suppresses an error found when Flow v0.112 was deployed. To
* see the error delete this comment and run Flow. */
block: <DraftEditorBlockNode key={blockKey} {...blockProps} />,
wrapperTemplate,
key: blockKey,
Expand Down
8 changes: 4 additions & 4 deletions src/component/handlers/composition/DOMObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class DOMObserver {
if (this.observer) {
this.observer.observe(this.container, DOM_OBSERVER_OPTIONS);
} else {
/* $FlowFixMe(>=0.68.0 site=www,mobile) This event type is not defined
* by Flow's standard library */
/* $FlowFixMe[incompatible-call] (>=0.68.0 site=www,mobile) This event
* type is not defined by Flow's standard library */
this.container.addEventListener(
'DOMCharacterDataModified',
this.onCharData,
Expand All @@ -88,8 +88,8 @@ class DOMObserver {
this.registerMutations(observer.takeRecords());
observer.disconnect();
} else {
/* $FlowFixMe(>=0.68.0 site=www,mobile) This event type is not defined
* by Flow's standard library */
/* $FlowFixMe[incompatible-call] (>=0.68.0 site=www,mobile) This event
* type is not defined by Flow's standard library */
this.container.removeEventListener(
'DOMCharacterDataModified',
this.onCharData,
Expand Down
18 changes: 9 additions & 9 deletions src/component/handlers/drag/DraftEditorDragHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ function getSelectionForEvent(
let offset: ?number = null;

const eventTargetDocument = getCorrectDocumentFromNode(event.currentTarget);
/* $FlowFixMe(>=0.68.0 site=www,mobile) This comment suppresses an error
* found when Flow v0.68 was deployed. To see the error delete this comment
* and run Flow. */
/* $FlowFixMe[prop-missing] (>=0.68.0 site=www,mobile) This comment
* suppresses an error found when Flow v0.68 was deployed. To see the error
* delete this comment and run Flow. */
if (typeof eventTargetDocument.caretRangeFromPoint === 'function') {
/* $FlowFixMe(>=0.68.0 site=www,mobile) This comment suppresses an error
* found when Flow v0.68 was deployed. To see the error delete this comment
* and run Flow. */
/* $FlowFixMe[incompatible-use] (>=0.68.0 site=www,mobile) This comment
* suppresses an error found when Flow v0.68 was deployed. To see the error
* delete this comment and run Flow. */
const dropRange = eventTargetDocument.caretRangeFromPoint(event.x, event.y);
node = dropRange.startContainer;
offset = dropRange.startOffset;
Expand Down Expand Up @@ -105,9 +105,9 @@ const DraftEditorDragHandler = {
return;
}
/* $FlowFixMe This comment suppresses an error found DataTransfer was
* typed. getFiles() returns an array of <Files extends Blob>, not Blob
*/
/* $FlowFixMe[incompatible-call] This comment suppresses an error found
* DataTransfer was typed. getFiles() returns an array of <Files extends
* Blob>, not Blob */
getTextContentFromFiles(files, fileText => {
fileText &&
editor.update(
Expand Down
5 changes: 3 additions & 2 deletions src/component/handlers/edit/editOnInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ function editOnInput(editor: DraftEditor, e: SyntheticInputEvent<>): void {
// Newest versions of Android support the dom-inputevent-inputtype
// and we can use the `inputType` to properly apply the state changes.

/* $FlowFixMe inputType is only defined on a draft of a standard.
* https://w3c.github.io/input-events/#dom-inputevent-inputtype */
/* $FlowFixMe[prop-missing] inputType is only defined on a draft of a
* standard. https://w3c.github.io/input-events/#dom-inputevent-inputtype
*/
const {inputType} = e.nativeEvent;
if (inputType) {
const newEditorState = onInputType(inputType, editorState);
Expand Down
6 changes: 3 additions & 3 deletions src/component/handlers/edit/editOnPaste.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ function editOnPaste(editor: DraftEditor, e: SyntheticClipboardEvent<>): void {
return;
}
/* $FlowFixMe This comment suppresses an error found DataTransfer was
* typed. getFiles() returns an array of <Files extends Blob>, not Blob
*/
/* $FlowFixMe[incompatible-call] This comment suppresses an error found
* DataTransfer was typed. getFiles() returns an array of <Files extends
* Blob>, not Blob */
getTextContentFromFiles(files, (/*string*/ fileText) => {
fileText = fileText || defaultFileText;
if (!fileText) {
Expand Down
6 changes: 3 additions & 3 deletions src/model/immutable/ContentState.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ const defaultRecord: ContentStateRecordType = {

const ContentStateRecord = (Record(defaultRecord): any);

/* $FlowFixMe Supressing a `signature-verification-failure` error here.
* TODO: T65949050 Clean up the branch for this GK
*/
/* $FlowFixMe[signature-verification-failure] Supressing a `signature-
* verification-failure` error here. TODO: T65949050 Clean up the branch for
* this GK */
const ContentBlockNodeRecord = gkx('draft_tree_data_support')
? ContentBlockNode
: ContentBlock;
Expand Down
6 changes: 3 additions & 3 deletions src/model/immutable/SelectionState.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ const defaultRecord: {
hasFocus: false,
};

/* $FlowFixMe This comment suppresses an error found when automatically adding
* a type annotation with the codemod Komodo/Annotate_exports. To see the error
* delete this comment and run Flow. */
/* $FlowFixMe[unclear-type] This comment suppresses an error found when
* automatically adding a type annotation with the codemod Komodo/Annotate_
* exports. To see the error delete this comment and run Flow. */
const SelectionStateRecord = (Record(defaultRecord): any);

class SelectionState extends SelectionStateRecord {
Expand Down

0 comments on commit fb728fd

Please sign in to comment.