Skip to content

Commit

Permalink
Pre-suppress errors ahead of 0.197.0 release
Browse files Browse the repository at this point in the history
Summary: Changelog: [internal]

Reviewed By: mroch

Differential Revision: D42558696

fbshipit-source-id: 3367fb1233c9630bd31b0ae9950f7b2f13438057
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Jan 18, 2023
1 parent 5c6897e commit bdeff42
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/metro-cache/src/__tests__/Cache-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ describe('Cache', () => {

describe('disabled cache', () => {
it('returns null for reads', async () => {
// $FlowFixMe[missing-empty-array-annot]
const cache = new Cache([]);

const result = await cache.get(Buffer.from('foo'));
Expand All @@ -225,6 +226,7 @@ describe('Cache', () => {
});

it('ignores writes', async () => {
// $FlowFixMe[missing-empty-array-annot]
const cache = new Cache([]);

await cache.set(Buffer.from('foo'), 'value');
Expand All @@ -234,6 +236,7 @@ describe('Cache', () => {
});

it('logs nothing', async () => {
// $FlowFixMe[missing-empty-array-annot]
const cache = new Cache([]);

await cache.set(Buffer.from('foo'), 'value');
Expand Down
1 change: 1 addition & 0 deletions packages/metro-config/src/__tests__/loadConfig-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ describe('loadConfig', () => {
const config = {
reporter: null,
maxWorkers: 2,
// $FlowFixMe[missing-empty-array-annot]
cacheStores: jest.fn(() => []),
transformerPath: '',
resolver: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ describe('ChromeHeapSnapshotProcessor', () => {
edges: [],
locations: [],
nodes: [],
// $FlowFixMe[missing-empty-array-annot]
samples: [],
strings: [],
trace_function_infos: [],
Expand Down Expand Up @@ -211,6 +212,7 @@ describe('ChromeHeapSnapshotProcessor', () => {
/* type (element) */ 1, /* name_or_index */ 1,
/* to_node (Node #1) */ 7,
],
// $FlowFixMe[missing-empty-array-annot]
samples: [],
strings: [
'Node #0',
Expand Down Expand Up @@ -594,6 +596,7 @@ describe('ChromeHeapSnapshotProcessor', () => {
/* type (synthetic) */ 9, /* name */ 0, /* id */ 1, /* self_size */ 0,
/* edge_count */ 0, /* trace_node_id */ 0, /* detachedness */ 0,
],
// $FlowFixMe[missing-empty-array-annot]
samples: [],
strings: ['Node #0'],
trace_function_infos: [
Expand Down Expand Up @@ -792,6 +795,7 @@ describe('ChromeHeapSnapshotProcessor', () => {
/* self_size */ 4320, /* edge_count */ 0, /* trace_node_id */ 0,
/* detachedness */ 0,
],
// $FlowFixMe[missing-empty-array-annot]
samples: [],
strings: [],
trace_function_infos: [],
Expand Down Expand Up @@ -823,6 +827,7 @@ describe('ChromeHeapSnapshotProcessor', () => {
/* type */ -1, /* name */ 0, /* id */ 43, /* self_size */ 4320,
/* edge_count */ 0, /* trace_node_id */ 0, /* detachedness */ 0,
],
// $FlowFixMe[missing-empty-array-annot]
samples: [],
strings: [''],
trace_function_infos: [],
Expand Down Expand Up @@ -858,6 +863,7 @@ describe('ChromeHeapSnapshotProcessor', () => {
/* trace_node_id */
/* detachedness */
],
// $FlowFixMe[missing-empty-array-annot]
samples: [],
strings: [''],
trace_function_infos: [],
Expand All @@ -884,6 +890,7 @@ describe('ChromeHeapSnapshotProcessor', () => {
/* self_size */ 4320, /* edge_count */ 0, /* trace_node_id */ 0,
/* detachedness */ 0,
],
// $FlowFixMe[missing-empty-array-annot]
samples: [],
strings: [''],
trace_function_infos: ([]: Array<number>),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ beforeEach(() => {
'bar',
{
absolutePath: '/bar',
// $FlowFixMe[missing-empty-array-annot]
data: {data: {asyncType: null, locs: [], key: 'bar'}, name: 'bar'},
},
],
[
'baz',
{
absolutePath: '/baz',
// $FlowFixMe[missing-empty-array-annot]
data: {data: {asyncType: null, locs: [], key: 'baz'}, name: 'baz'},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ beforeEach(() => {
'bar',
{
absolutePath: '/bar.js',
// $FlowFixMe[missing-empty-array-annot]
data: {data: {asyncType: null, locs: [], key: 'bar'}, name: 'bar'},
},
],
[
'baz',
{
absolutePath: '/baz.js',
// $FlowFixMe[missing-empty-array-annot]
data: {data: {asyncType: null, locs: [], key: 'baz'}, name: 'baz'},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ describe('DeltaCalculator + require.context', () => {
absolutePath: '/ctx?ctx=xxx',
data: {
name: 'ctx',
// $FlowFixMe[missing-empty-array-annot]
data: {key: 'ctx?ctx=xxx', asyncType: null, locs: []},
},
},
Expand All @@ -108,6 +109,7 @@ describe('DeltaCalculator + require.context', () => {
absolutePath: '/ctx/foo',
data: {
name: 'foo',
// $FlowFixMe[missing-empty-array-annot]
data: {key: 'foo', asyncType: null, locs: []},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ describe('DeltaCalculator', () => {
absolutePath: '/foo',
data: {
name: 'foo',
// $FlowFixMe[missing-empty-array-annot]
data: {key: 'foo', asyncType: null, locs: []},
},
},
Expand All @@ -85,6 +86,7 @@ describe('DeltaCalculator', () => {
absolutePath: '/bar',
data: {
name: 'bar',
// $FlowFixMe[missing-empty-array-annot]
data: {key: 'bar', asyncType: null, locs: []},
},
},
Expand All @@ -95,6 +97,7 @@ describe('DeltaCalculator', () => {
absolutePath: '/baz',
data: {
name: 'baz',
// $FlowFixMe[missing-empty-array-annot]
data: {key: 'baz', asyncType: null, locs: []},
},
},
Expand All @@ -113,6 +116,7 @@ describe('DeltaCalculator', () => {
absolutePath: '/qux',
data: {
name: 'qux',
// $FlowFixMe[missing-empty-array-annot]
data: {key: 'qux', asyncType: null, locs: []},
},
},
Expand Down
3 changes: 3 additions & 0 deletions packages/metro/src/DeltaBundler/__tests__/Graph-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ class TestGraph extends Graph<> {
}
}

// $FlowFixMe[missing-local-annot]
function getMatchingContextModules<T>(graph: Graph<T>, filePath: string) {
const contextPaths = new Set<string>();
graph.markModifiedContextModules(filePath, contextPaths);
Expand All @@ -301,6 +302,7 @@ beforeEach(async () => {
name: dep.name,
data: {
asyncType: null,
// $FlowFixMe[missing-empty-array-annot]
locs: [],
key: dep.data.key,
...dep.data,
Expand All @@ -313,6 +315,7 @@ beforeEach(async () => {
data: {
code: '// code' + (context ? ' (context)' : ''),
lineCount: 1,
// $FlowFixMe[missing-empty-array-annot]
map: [],
},
type: 'js/module',
Expand Down
3 changes: 3 additions & 0 deletions packages/metro/src/lib/formatBundlingError.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,21 @@ function formatBundlingError(error: CustomError): FormattedError {
} else if (error instanceof ResourceNotFoundError) {
return {
type: 'ResourceNotFoundError',
// $FlowFixMe[missing-empty-array-annot]
errors: [],
message: error.message,
};
} else if (error instanceof GraphNotFoundError) {
return {
type: 'GraphNotFoundError',
// $FlowFixMe[missing-empty-array-annot]
errors: [],
message: error.message,
};
} else if (error instanceof RevisionNotFoundError) {
return {
type: 'RevisionNotFoundError',
// $FlowFixMe[missing-empty-array-annot]
errors: [],
message: error.message,
};
Expand Down
3 changes: 3 additions & 0 deletions packages/metro/src/lib/getAppendScripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function getAppendScripts<T: number | string>(
data: {
code,
lineCount: countLines(code),
// $FlowFixMe[missing-empty-array-annot]
map: [],
},
},
Expand Down Expand Up @@ -89,6 +90,7 @@ function getAppendScripts<T: number | string>(
data: {
code,
lineCount: countLines(code),
// $FlowFixMe[missing-empty-array-annot]
map: [],
},
},
Expand All @@ -109,6 +111,7 @@ function getAppendScripts<T: number | string>(
data: {
code,
lineCount: countLines(code),
// $FlowFixMe[missing-empty-array-annot]
map: [],
},
},
Expand Down
1 change: 1 addition & 0 deletions packages/metro/src/lib/getPrependedScripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ function _getPrelude({
data: {
code,
lineCount: countLines(code),
// $FlowFixMe[missing-empty-array-annot]
map: [],
},
},
Expand Down

0 comments on commit bdeff42

Please sign in to comment.