Skip to content

Commit 65af886

Browse files
generatedunixname89002005232357meta-codesync[bot]
authored andcommitted
Revert D111190630: Stop using prettier-plugin-hermes-parser for formatting
Differential Revision: D111190630 Original commit changeset: e7ed7ee6f057 Original Phabricator Diff: D111190630 fbshipit-source-id: 49e33587fa084c181d64d35ac6bcf6ab73edfa5f
1 parent 2235b8e commit 65af886

70 files changed

Lines changed: 579 additions & 279 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierrc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
* @format
88
*/
99

10+
let plugins = ['prettier-plugin-hermes-parser'];
11+
try {
12+
plugins = require('./.prettier-plugins.fb.js');
13+
} catch {}
14+
1015
module.exports = {
1116
arrowParens: 'avoid',
1217
bracketSameLine: true,
@@ -15,6 +20,7 @@ module.exports = {
1520
singleQuote: true,
1621
trailingComma: 'all',
1722
endOfLine: 'lf',
23+
plugins,
1824
overrides: [
1925
{
2026
files: ['*.code-workspace'],
@@ -25,7 +31,7 @@ module.exports = {
2531
{
2632
files: ['*.js', '*.js.flow'],
2733
options: {
28-
parser: 'flow',
34+
parser: 'hermes',
2935
},
3036
},
3137
{

flow-typed/environment/node.js

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ declare class child_process$ChildProcessTyped<
457457
TStdin extends stream$Writable | null,
458458
TStdout extends stream$Readable | null,
459459
TStderr extends stream$Readable | null,
460-
> extends events$EventEmitter {
460+
> extends events$EventEmitter
461+
{
461462
+stdin: TStdin;
462463
+stdout: TStdout;
463464
+stderr: TStderr;
@@ -577,7 +578,8 @@ declare module 'child_process' {
577578
declare function execFile(
578579
file: string,
579580
argsOrCallback?:
580-
ReadonlyArray<string> | child_process$execFileCallback<string>,
581+
| ReadonlyArray<string>
582+
| child_process$execFileCallback<string>,
581583
callback?: child_process$execFileCallback<string>,
582584
): child_process$ChildProcessTyped<
583585
stream$Writable,
@@ -926,7 +928,14 @@ type crypto$key =
926928

927929
declare class crypto$KeyObject {
928930
+asymmetricKeyType?:
929-
'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448';
931+
| 'rsa'
932+
| 'rsa-pss'
933+
| 'dsa'
934+
| 'ec'
935+
| 'ed25519'
936+
| 'ed448'
937+
| 'x25519'
938+
| 'x448';
930939
+asymmetricKeySize?: number;
931940
+symmetricKeySize?: number;
932941
+type: 'secret' | 'public' | 'private';
@@ -2551,9 +2560,9 @@ declare class http$Agent<+SocketT = net$Socket> {
25512560
sockets: {[name: string]: ReadonlyArray<SocketT>, ...};
25522561
}
25532562

2554-
declare class http$IncomingMessage<
2555-
SocketT = net$Socket,
2556-
> extends stream$Readable {
2563+
declare class http$IncomingMessage<SocketT = net$Socket>
2564+
extends stream$Readable
2565+
{
25572566
headers: Object;
25582567
rawHeaders: Array<string>;
25592568
httpVersion: string;
@@ -2569,9 +2578,9 @@ declare class http$IncomingMessage<
25692578
rawTrailers: Array<string>;
25702579
}
25712580

2572-
declare class http$ClientRequest<
2573-
+SocketT = net$Socket,
2574-
> extends stream$Writable {
2581+
declare class http$ClientRequest<+SocketT = net$Socket>
2582+
extends stream$Writable
2583+
{
25752584
abort(): void;
25762585
aborted: boolean;
25772586
+connection: SocketT | null;
@@ -2869,7 +2878,10 @@ declare class net$Socket extends stream$Duplex {
28692878
destroyed: boolean;
28702879
end(
28712880
chunkOrEncodingOrCallback?:
2872-
Buffer | Uint8Array | string | ((data: any) => void),
2881+
| Buffer
2882+
| Uint8Array
2883+
| string
2884+
| ((data: any) => void),
28732885
encodingOrCallback?: string | ((data: any) => void),
28742886
callback?: (data: any) => void,
28752887
): this;
@@ -3199,9 +3211,9 @@ declare module 'perf_hooks' {
31993211
+detail?: T;
32003212
}
32013213

3202-
declare export class PerformanceMeasure<
3203-
T = unknown,
3204-
> extends PerformanceEntry {
3214+
declare export class PerformanceMeasure<T = unknown>
3215+
extends PerformanceEntry
3216+
{
32053217
+entryType: 'measure';
32063218
+detail?: T;
32073219
}
@@ -3386,7 +3398,11 @@ declare module 'querystring' {
33863398
*/
33873399
declare module 'node:sqlite' {
33883400
declare export type SupportedValueType =
3389-
null | number | bigint | string | Uint8Array;
3401+
| null
3402+
| number
3403+
| bigint
3404+
| string
3405+
| Uint8Array;
33903406

33913407
declare export type DatabaseSyncOptions = Readonly<{
33923408
open?: boolean,
@@ -5549,7 +5565,9 @@ declare module 'repl' {
55495565
writer?: (object: any, options?: util$InspectOptions) => string,
55505566
completer?: readline$InterfaceCompleter,
55515567
replMode?:
5552-
$SymbolReplModeMagic | $SymbolReplModeSloppy | $SymbolReplModeStrict,
5568+
| $SymbolReplModeMagic
5569+
| $SymbolReplModeSloppy
5570+
| $SymbolReplModeStrict,
55535571
breakEvalOnSigint?: boolean,
55545572
...
55555573
}): REPLServer;

flow-typed/npm/babel-traverse_v7.x.x.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,12 @@ declare module '@babel/traverse' {
246246
}
247247

248248
declare export type BindingKind =
249-
'var' | 'let' | 'const' | 'module' | 'hoisted' | 'unknown';
249+
| 'var'
250+
| 'let'
251+
| 'const'
252+
| 'module'
253+
| 'hoisted'
254+
| 'unknown';
250255

251256
declare export class Binding {
252257
constructor(opts: {
@@ -430,7 +435,13 @@ declare module '@babel/traverse' {
430435
isBaseType(baseName: string, soft?: boolean): boolean;
431436
couldBeBaseType(
432437
name:
433-
'string' | 'number' | 'boolean' | 'any' | 'mixed' | 'empty' | 'void',
438+
| 'string'
439+
| 'number'
440+
| 'boolean'
441+
| 'any'
442+
| 'mixed'
443+
| 'empty'
444+
| 'void',
434445
): boolean;
435446
baseTypeStrictlyMatches(right: NodePath<>): ?boolean;
436447
isGenericType(genericName: string): boolean;
@@ -1435,7 +1446,8 @@ declare module '@babel/traverse' {
14351446
}>;
14361447

14371448
declare export type VisitNode<-TNode extends BabelNode, TState> =
1438-
VisitNodeFunction<TNode, TState> | VisitNodeObject<TNode, TState>;
1449+
| VisitNodeFunction<TNode, TState>
1450+
| VisitNodeObject<TNode, TState>;
14391451

14401452
declare export type Visitor<TState = void> = Readonly<{
14411453
enter?: VisitNodeFunction<BabelNode, TState>,

flow-typed/npm/babel_v7.x.x.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1293,7 +1293,8 @@ declare module '@babel/template' {
12931293
};
12941294

12951295
declare export type PublicReplacements =
1296-
{[string]: ?BabelNode} | Array<?BabelNode>;
1296+
| {[string]: ?BabelNode}
1297+
| Array<?BabelNode>;
12971298

12981299
declare export type TemplateBuilder<T> = {
12991300
// Build a new builder, merging the given options with the previous ones.

flow-typed/npm/commander_v12.x.x.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
declare module 'commander' {
1717
declare type LiteralUnion<LiteralType, BaseType: string | number> =
18-
LiteralType | {...BaseType, ...{[key: empty]: empty, ...}};
18+
| LiteralType
19+
| {...BaseType, ...{[key: empty]: empty, ...}};
1920

2021
declare export class CommanderError mixins Error {
2122
code: string;
@@ -334,7 +335,10 @@ declare module 'commander' {
334335
outputError?: (str: string, write: (str: string) => void) => void;
335336
}
336337
export type AddHelpTextPosition =
337-
'beforeAll' | 'before' | 'after' | 'afterAll';
338+
| 'beforeAll'
339+
| 'before'
340+
| 'after'
341+
| 'afterAll';
338342
export type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
339343
export type OptionValueSource = LiteralUnion<
340344
'default' | 'config' | 'env' | 'cli' | 'implied',

flow-typed/npm/electron-packager_v20.x.x.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,21 @@ declare module '@electron/packager' {
4949
ProductName?: string,
5050
InternalName?: string,
5151
'requested-execution-level'?:
52-
'asInvoker' | 'highestAvailable' | 'requireAdministrator',
52+
| 'asInvoker'
53+
| 'highestAvailable'
54+
| 'requireAdministrator',
5355
'application-manifest'?: string,
5456
}>;
5557

5658
declare export type WindowsSignOptions = $FlowFixMe;
5759

5860
declare export type OfficialArch =
59-
'ia32' | 'x64' | 'armv7l' | 'arm64' | 'mips64el' | 'universal';
61+
| 'ia32'
62+
| 'x64'
63+
| 'armv7l'
64+
| 'arm64'
65+
| 'mips64el'
66+
| 'universal';
6067

6168
declare export type OfficialPlatform = 'linux' | 'win32' | 'darwin' | 'mas';
6269

flow-typed/npm/execa_v5.x.x.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313

1414
declare module 'execa' {
1515
declare type StdIoOption =
16-
'pipe' | 'ipc' | 'ignore' | 'inherit' | stream$Stream | number;
16+
| 'pipe'
17+
| 'ipc'
18+
| 'ignore'
19+
| 'inherit'
20+
| stream$Stream
21+
| number;
1722

1823
declare type CommonOptions = {
1924
argv0?: string,
@@ -69,7 +74,8 @@ declare module 'execa' {
6974
};
7075

7176
declare interface ExecaPromise
72-
extends Promise<Result>, child_process$ChildProcess {}
77+
extends Promise<Result>,
78+
child_process$ChildProcess {}
7379

7480
declare interface ExecaError extends ErrnoError {
7581
stdout: string;

flow-typed/npm/jest.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,10 @@ type FakeTimersConfig = {
214214
*/
215215

216216
type JestStyledComponentsMatcherValue =
217-
string | JestAsymmetricEqualityType | RegExp | void;
217+
| string
218+
| JestAsymmetricEqualityType
219+
| RegExp
220+
| void;
218221

219222
type JestStyledComponentsMatcherOptions = {
220223
media?: string,

flow-typed/npm/jsonc-parser_v2.2.x.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,13 @@ declare module 'jsonc-parser' {
155155
| 'InvalidCharacter'
156156
| '<unknown ParseErrorCode>';
157157
export type NodeType =
158-
'object' | 'array' | 'property' | 'string' | 'number' | 'boolean' | 'null';
158+
| 'object'
159+
| 'array'
160+
| 'property'
161+
| 'string'
162+
| 'number'
163+
| 'boolean'
164+
| 'null';
159165
export type Node = {
160166
type: NodeType,
161167
value?: any,

flow-typed/npm/node-fetch_v2.x.x.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,12 @@ declare module 'node-fetch' {
157157
}
158158

159159
declare type ResponseType =
160-
'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect';
160+
| 'basic'
161+
| 'cors'
162+
| 'default'
163+
| 'error'
164+
| 'opaque'
165+
| 'opaqueredirect';
161166

162167
declare interface ResponseInit {
163168
headers?: HeaderInit;
@@ -167,7 +172,12 @@ declare module 'node-fetch' {
167172

168173
declare type HeaderInit = Headers | Array<string>;
169174
declare type BodyInit =
170-
string | null | Buffer | Blob | Readable | URLSearchParams;
175+
| string
176+
| null
177+
| Buffer
178+
| Blob
179+
| Readable
180+
| URLSearchParams;
171181

172182
declare function fetch(
173183
url: string | URL | Request,

0 commit comments

Comments
 (0)