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

Commit 8457ebb

Browse files
Daniel Sainatifacebook-github-bot
authored andcommitted
add codes to suppressions in www
Summary: This updates `www` suppressions to use error codes. This diff was generated by running ``` ~/fbsource/fbcode/flow/tool update-suppressions ~/www --bin ~/fbsource/fbcode/flow/facebook/flowd hg status -n --rev master | xargs -P 20 -n 1000 prettier --write --require-pragma 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 flow --json | jq -r '.errors[] | .message[] | .loc.source' | sort -u | xargs hg revert -r master arc rebuild hg st -n | xargs -n 500 hg commit -m "[Flow][Codemod] add codes to suppressions in www" ``` on top of D22399626 bypass-lint allow_many_files drop-conflicts Reviewed By: pieterv Differential Revision: D22462377 fbshipit-source-id: 5c1d51e5b000a734c770d7a3e6b70fdf209cf154
1 parent fb728fd commit 8457ebb

File tree

6 files changed

+41
-32
lines changed

6 files changed

+41
-32
lines changed

src/component/base/__tests__/DraftEditor.react-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const DraftEditor = require('DraftEditor.react');
1717
const EditorState = require('EditorState');
1818
const React = require('React');
1919

20-
// $FlowFixMe
20+
// $FlowFixMe[cannot-resolve-module]
2121
const ReactShallowRenderer = require('react-test-renderer/shallow');
2222

2323
let shallow;

src/component/contents/__tests__/DraftEditorTextNode-test.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ const renderIntoContainer = element => {
3434
};
3535

3636
const initializeAsIE = () => {
37-
/* $FlowFixMe(>=0.99.0 site=www) This comment suppresses an error found when
38-
* Flow v0.47 was deployed. To see the error delete this comment and run
39-
* Flow. */
37+
/* $FlowFixMe[prop-missing] (>=0.99.0 site=www) This comment suppresses an
38+
* error found when Flow v0.47 was deployed. To see the error delete this
39+
* comment and run Flow. */
4040
UserAgent.isBrowser.mockImplementation(() => true);
4141
};
4242

4343
const initializeAsNonIE = () => {
44-
/* $FlowFixMe(>=0.99.0 site=www) This comment suppresses an error found when
45-
* Flow v0.47 was deployed. To see the error delete this comment and run
46-
* Flow. */
44+
/* $FlowFixMe[prop-missing] (>=0.99.0 site=www) This comment suppresses an
45+
* error found when Flow v0.47 was deployed. To see the error delete this
46+
* comment and run Flow. */
4747
UserAgent.isBrowser.mockImplementation(() => false);
4848
};
4949

5050
const expectPopulatedSpan = (stub, testString) => {
51-
// $FlowExpectedError node could be null
51+
// $FlowExpectedError[incompatible-type] node could be null
5252
const node: Element = ReactDOM.findDOMNode(stub);
5353
expect(node.tagName).toBe('SPAN');
5454
expect(node.childNodes.length).toBe(1);
@@ -60,7 +60,8 @@ test('must initialize correctly with an empty string, non-IE', function() {
6060
const stub = renderIntoContainer(
6161
<DraftEditorTextNode>{''}</DraftEditorTextNode>,
6262
);
63-
// $FlowExpectedError we know node is an Element
63+
// $FlowExpectedError[incompatible-use] we know node is an Element
64+
// $FlowExpectedError[prop-missing] we know node is an Element
6465
expect(ReactDOM.findDOMNode(stub).tagName).toBe('BR');
6566
});
6667

@@ -149,13 +150,13 @@ test('must skip updates if text already matches DOM, non-IE', function() {
149150

150151
renderIntoContainer(<DraftEditorTextNode>{TEST_A}</DraftEditorTextNode>);
151152

152-
// $FlowExpectedError property render is missing in HTMLDivElement
153+
// $FlowExpectedError[prop-missing] property render is missing in HTMLDivElement
153154
expect(stub.render.mock.calls.length).toBe(0);
154155

155156
// Sanity check that updating is performed when appropriate.
156157
renderIntoContainer(<DraftEditorTextNode>{TEST_B}</DraftEditorTextNode>);
157158

158-
// $FlowExpectedError property render is missing in HTMLDivElement
159+
// $FlowExpectedError[prop-missing] property render is missing in HTMLDivElement
159160
expect(stub.render.mock.calls.length).toBe(1);
160161
});
161162

@@ -169,13 +170,13 @@ test('must skip updates if text already matches DOM, IE', function() {
169170

170171
renderIntoContainer(<DraftEditorTextNode>{TEST_A}</DraftEditorTextNode>);
171172

172-
// $FlowExpectedError property render is missing in HTMLDivElement
173+
// $FlowExpectedError[prop-missing] property render is missing in HTMLDivElement
173174
expect(stub.render.mock.calls.length).toBe(0);
174175

175176
// Sanity check that updating is performed when appropriate.
176177
renderIntoContainer(<DraftEditorTextNode>{TEST_B}</DraftEditorTextNode>);
177178

178-
// $FlowExpectedError property render is missing in HTMLDivElement
179+
// $FlowExpectedError[prop-missing] property render is missing in HTMLDivElement
179180
expect(stub.render.mock.calls.length).toBe(1);
180181
});
181182

@@ -187,7 +188,8 @@ test('must update from non-empty to empty, non-IE', function() {
187188

188189
renderIntoContainer(<DraftEditorTextNode>{''}</DraftEditorTextNode>);
189190

190-
// $FlowExpectedError we know node is an Element
191+
// $FlowExpectedError[incompatible-use] we know node is an Element
192+
// $FlowExpectedError[prop-missing] we know node is an Element
191193
expect(ReactDOM.findDOMNode(stub).tagName).toBe('BR');
192194
});
193195

@@ -217,11 +219,11 @@ test('must force unchanged text back into the DOM', function() {
217219
<DraftEditorTextNode>{TEST_A}</DraftEditorTextNode>,
218220
);
219221

220-
// $FlowExpectedError we know node is not null
222+
// $FlowExpectedError[incompatible-use] we know node is not null
221223
ReactDOM.findDOMNode(stub).textContent = TEST_B;
222224

223225
renderIntoContainer(<DraftEditorTextNode>{TEST_A}</DraftEditorTextNode>);
224226

225-
// $FlowExpectedError we know node is not null
227+
// $FlowExpectedError[incompatible-use] we know node is not null
226228
expect(ReactDOM.findDOMNode(stub).textContent).toBe(TEST_A);
227229
});

src/component/handlers/composition/__tests__/DraftEditorCompostionHandler-test.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@ beforeEach(() => {
103103
test('isInCompositionMode is properly updated on composition events', () => {
104104
// `inCompositionMode` is updated inside editOnCompositionStart,
105105
// which is why we can't just call compositionHandler.onCompositionStart.
106-
// $FlowExpectedError
106+
// $FlowExpectedError[incompatible-call]
107107
editOnCompositionStart(editor, {});
108108
expect(editor.setMode).toHaveBeenLastCalledWith('composite');
109109
expect(editor._latestEditorState.isInCompositionMode()).toBe(true);
110-
// $FlowExpectedError
110+
// $FlowExpectedError[incompatible-use]
111+
// $FlowExpectedError[incompatible-call]
111112
compositionHandler.onCompositionEnd(editor);
112113
jest.runAllTimers();
113114
expect(editor._latestEditorState.isInCompositionMode()).toBe(false);
@@ -121,9 +122,11 @@ test('Can handle a single mutation', () => {
121122
require('DOMObserver').prototype.stopAndFlushMutations.mockReturnValue(
122123
mutations,
123124
);
124-
// $FlowExpectedError
125+
// $FlowExpectedError[incompatible-use]
126+
// $FlowExpectedError[incompatible-call]
125127
compositionHandler.onCompositionStart(editor);
126-
// $FlowExpectedError
128+
// $FlowExpectedError[incompatible-use]
129+
// $FlowExpectedError[incompatible-call]
127130
compositionHandler.onCompositionEnd(editor);
128131
jest.runAllTimers();
129132

@@ -144,9 +147,11 @@ test('Can handle mutations in multiple blocks', () => {
144147
require('DOMObserver').prototype.stopAndFlushMutations.mockReturnValue(
145148
mutations,
146149
);
147-
// $FlowExpectedError
150+
// $FlowExpectedError[incompatible-use]
151+
// $FlowExpectedError[incompatible-call]
148152
compositionHandler.onCompositionStart(editor);
149-
// $FlowExpectedError
153+
// $FlowExpectedError[incompatible-use]
154+
// $FlowExpectedError[incompatible-call]
150155
compositionHandler.onCompositionEnd(editor);
151156
jest.runAllTimers();
152157

@@ -172,9 +177,11 @@ test('Can handle mutations in the same block in multiple leaf nodes', () => {
172177
require('DOMObserver').prototype.stopAndFlushMutations.mockReturnValue(
173178
mutations,
174179
);
175-
// $FlowExpectedError
180+
// $FlowExpectedError[incompatible-use]
181+
// $FlowExpectedError[incompatible-call]
176182
compositionHandler.onCompositionStart(editor);
177-
// $FlowExpectedError
183+
// $FlowExpectedError[incompatible-use]
184+
// $FlowExpectedError[incompatible-call]
178185
compositionHandler.onCompositionEnd(editor);
179186
jest.runAllTimers();
180187

src/component/handlers/edit/__tests__/editOnBlur-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ test('editor removes selection on blur (default behaviour)', () => {
6767
editor: editorNode,
6868
};
6969

70-
// $FlowExpectedError
70+
// $FlowExpectedError[incompatible-call]
7171
onBlur(editor, getBlurEvent(editorNode));
7272

7373
expect(globalSelection.removeAllRanges).toHaveBeenCalledTimes(1);
@@ -97,7 +97,7 @@ test('editor preserves selection on blur', () => {
9797
editor: editorNode,
9898
};
9999

100-
// $FlowExpectedError
100+
// $FlowExpectedError[incompatible-call]
101101
onBlur(editor, getBlurEvent(editorNode));
102102

103103
expect(globalSelection.removeAllRanges).toHaveBeenCalledTimes(0);

src/component/handlers/edit/__tests__/editOnInput-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test('restoreEditorDOM and keyCommandPlainBackspace are NOT called when the `inp
6262
currentTarget: editorNode,
6363
};
6464

65-
// $FlowExpectedError
65+
// $FlowExpectedError[incompatible-call]
6666
onInput(editor, inputEvent);
6767

6868
expect(require('keyCommandPlainBackspace')).toHaveBeenCalledTimes(0);
@@ -94,10 +94,10 @@ test('restoreEditorDOM and keyCommandPlainBackspace are called when backspace is
9494
currentTarget: editorNode,
9595
};
9696

97-
// $FlowExpectedError
97+
// $FlowExpectedError[incompatible-call]
9898
onInput(editor, inputEvent);
9999

100-
// $FlowExpectedError
100+
// $FlowExpectedError[prop-missing]
101101
const newEditorState = require('keyCommandPlainBackspace').mock.results[0]
102102
.value;
103103
expect(require('keyCommandPlainBackspace')).toHaveBeenCalledWith(

src/model/encoding/__tests__/convertFromHTMLToContentBlocks-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ beforeEach(() => {
7676
});
7777

7878
const convertFromHTML = (html_string, config) => {
79-
/* $FlowFixMe(>=0.122.0 site=www) This comment suppresses an error found when
80-
* Flow v0.122.0 was deployed. To see the error, delete this comment and run
81-
* Flow. */
79+
/* $FlowFixMe[cannot-spread-inexact] (>=0.122.0 site=www) This comment
80+
* suppresses an error found when Flow v0.122.0 was deployed. To see the
81+
* error, delete this comment and run Flow. */
8282
const options = {
8383
...DEFAULT_CONFIG,
8484
...config,

0 commit comments

Comments
 (0)