Skip to content

Commit

Permalink
RN: Fix Prettier Formatting Errors (#32524)
Browse files Browse the repository at this point in the history
Summary:
Ignores the `Libraries/Renderer/` directory of files which are synchronized from React (and should not be modified).

Also, formats some EventEmitter modules that for some reason were missed when I upgraded to Prettier v2.x.

## Changelog

[Internal]

Pull Request resolved: #32524

Test Plan:
```
yarn run format-check
```

Reviewed By: javache

Differential Revision: D32129837

Pulled By: yungsters

fbshipit-source-id: 1cb42cec210508db499850e13f77beefdb35eb25
  • Loading branch information
yungsters authored and facebook-github-bot committed Nov 9, 2021
1 parent f1f88b0 commit 32f36fe
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Libraries/Renderer/
3 changes: 2 additions & 1 deletion Libraries/vendor/emitter/_EmitterSubscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import {type EventSubscription} from './EventSubscription';
*/
class EmitterSubscription<EventDefinitions: {...}, K: $Keys<EventDefinitions>>
extends _EventSubscription<EventDefinitions, K>
implements EventSubscription {
implements EventSubscription
{
emitter: EventEmitter<EventDefinitions>;
listener: ?(...$ElementType<EventDefinitions, K>) => mixed;
context: ?$FlowFixMe;
Expand Down
3 changes: 2 additions & 1 deletion Libraries/vendor/emitter/_EventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ const sparseFilterPredicate = () => true;
* more advanced emitter may use an EventHolder and EventFactory.
*/
class EventEmitter<EventDefinitions: {...}> {
_subscriber: EventSubscriptionVendor<EventDefinitions> = new EventSubscriptionVendor<EventDefinitions>();
_subscriber: EventSubscriptionVendor<EventDefinitions> =
new EventSubscriptionVendor<EventDefinitions>();

/**
* @constructor
Expand Down
3 changes: 2 additions & 1 deletion Libraries/vendor/emitter/_EventSubscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import type EventSubscriptionVendor from './_EventSubscriptionVendor';
* remove its own subscription.
*/
class _EventSubscription<EventDefinitions: {...}, K: $Keys<EventDefinitions>>
implements EventSubscription {
implements EventSubscription
{
eventType: K;
key: number;
subscriber: EventSubscriptionVendor<EventDefinitions>;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/vendor/emitter/_EventSubscriptionVendor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class EventSubscriptionVendor<EventDefinitions: {...}> {
[type: $Keys<EventDefinitions>]: Array<
EventSubscription<EventDefinitions, $FlowFixMe>,
>,
...,
...
};

constructor() {
Expand Down

0 comments on commit 32f36fe

Please sign in to comment.