Skip to content

Commit 3a96f2b

Browse files
marcoww6meta-codesync[bot]
authored andcommitted
Manually fix a 5 more files 11/n
Summary: We are transforming the following utility types to be more consistent with typescript and better AI integration: * `$NonMaybeType` -> `NonNullable` * `$ReadOnly` -> `Readonly` * `$ReadOnlyArray` -> `ReadonlyArray` * `$ReadOnlyMap` -> `ReadonlyMap` * `$ReadOnlySet` -> `ReadonlySet` * `$Keys` -> `keyof` * `$Values` -> `Values` * `mixed` -> `unknown` See details in https://fb.workplace.com/groups/flowlang/permalink/1837907750148213/. Reviewed By: SamChou19815 Differential Revision: D91148085 fbshipit-source-id: f6928c08fd2c5839fa91d526b025457393e9bd4a
1 parent 62dd1ab commit 3a96f2b

5 files changed

Lines changed: 9 additions & 12 deletions

File tree

packages/metro-file-map/src/lib/dependencyExtractor.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,15 @@ const RIGHT_PARENTHESIS = '\\)';
2222
const WHITESPACE = '\\s*';
2323
const OPTIONAL_COMMA = '(:?,\\s*)?';
2424

25-
function createRegExp(
26-
parts /*: $ReadOnlyArray<string> */,
27-
flags /*: string */,
28-
) {
25+
function createRegExp(parts /*: ReadonlyArray<string> */, flags /*: string */) {
2926
return new RegExp(parts.join(''), flags);
3027
}
3128

32-
function alternatives(...parts /*: $ReadOnlyArray<string> */) {
29+
function alternatives(...parts /*: ReadonlyArray<string> */) {
3330
return `(?:${parts.join('|')})`;
3431
}
3532

36-
function functionCallStart(...names /*: $ReadOnlyArray<string> */) {
33+
function functionCallStart(...names /*: ReadonlyArray<string> */) {
3734
return [
3835
NOT_A_DOT,
3936
WORD_SEPARATOR,

packages/metro-file-map/src/plugins/haste/worker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ import type {MetadataWorker, WorkerMessage, V8Serializable} from '../../flow-typ
2222
const PACKAGE_JSON = path.sep + 'package.json';
2323

2424
module.exports = class Worker /*:: implements MetadataWorker */ {
25-
/*:: + */ #hasteImpl /*: ?$ReadOnly<{getHasteName: string => ?string}> */ =
25+
/*:: + */ #hasteImpl /*: ?Readonly<{getHasteName: string => ?string}> */ =
2626
null;
2727

2828
constructor(
29-
{hasteImplModulePath} /*: $ReadOnly<{hasteImplModulePath: ?string}> */,
29+
{hasteImplModulePath} /*: Readonly<{hasteImplModulePath: ?string}> */,
3030
) {
3131
if (hasteImplModulePath != null) {
3232
// $FlowFixMe[unsupported-syntax] - dynamic require
@@ -36,7 +36,7 @@ module.exports = class Worker /*:: implements MetadataWorker */ {
3636

3737
processFile(
3838
data /*: WorkerMessage */,
39-
utils /*: $ReadOnly<{getContent: () => Buffer }> */,
39+
utils /*: Readonly<{getContent: () => Buffer }> */,
4040
) /*: V8Serializable */ {
4141
let hasteName /*: string | null */ = null;
4242
const {filePath} = data;

packages/metro-file-map/src/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function sha1hex(content /*: string | Buffer */) /*: string */ {
3333
}
3434

3535
class Worker {
36-
#plugins /*: $ReadOnlyArray<MetadataWorker> */;
36+
#plugins /*: ReadonlyArray<MetadataWorker> */;
3737

3838
constructor({plugins = []} /*: WorkerSetupArgs */) {
3939
this.#plugins = plugins.map(({modulePath, setupArgs}) => {

packages/metro-file-map/src/workerExclusionList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
'use strict';
2525

26-
const extensions /*: $ReadOnlySet<string> */ = new Set([
26+
const extensions /*: ReadonlySet<string> */ = new Set([
2727
// JSONs are never haste modules, except for "package.json", which is handled.
2828
'.json',
2929

scripts/jestFilter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ if (process.env.NIGHTLY_TESTS_NO_LOCKFILE != null) {
5555
}
5656

5757
module.exports = (
58-
absoluteTestPaths /*: $ReadOnlyArray<string> */,
58+
absoluteTestPaths /*: ReadonlyArray<string> */,
5959
) /*: {filtered: Array<{test: string}>}*/ => {
6060
const skippedPathsSet = new Set(
6161
SKIPPED_PATHS.map(relativePath =>

0 commit comments

Comments
 (0)