Skip to content

Commit 067dde0

Browse files
committed
fixes format
1 parent 9b712e9 commit 067dde0

File tree

10 files changed

+51
-20
lines changed

10 files changed

+51
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"scripts": {
1919
"build": "cross-env NODE_ENV=production node ./scripts/build.js",
2020
"jest": "cross-env NODE_ENV=test jest",
21-
"lint": "yarn run lint-prettier && eslint . --cache",
21+
"lint": "yarn run lint-prettier && eslint . --cache --fix",
2222
"lint-prettier": "node ./scripts/prettier.js lint",
2323
"prettier": "node ./scripts/prettier.js write && eslint . --cache --fix",
2424
"tck": "yarn run build && node ./packages/rsocket-tck/build/index.js \"$@\"",

packages/rsocket-core/src/Invariant.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@
1717
* The invariant message will be stripped in production, but the invariant will
1818
* remain to ensure logic does not differ in production.
1919
*/
20-
function invariant(condition: mixed, format: string, ...args: Array<mixed>): void {
20+
function invariant(
21+
condition: mixed,
22+
format: string,
23+
...args: Array<mixed>
24+
): void {
2125
if (!condition) {
2226
let error;
2327

2428
if (format === undefined) {
25-
error = new Error('Minified exception occurred; use the non-minified ' +
26-
'dev environment for the full error message and additional helpful warnings.');
29+
error = new Error(
30+
'Minified exception occurred; use the non-minified ' +
31+
'dev environment for the full error message and additional helpful warnings.',
32+
);
2733
} else {
2834
let argIndex = 0;
2935
error = new Error(format.replace(/%s/g, () => String(args[argIndex++])));

packages/rsocket-core/src/RSocketMachine.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,10 @@ class RSocketMachineImpl<D, M> implements RSocketMachine<D, M> {
482482
},
483483
});
484484
} else {
485-
console.warn('RSocketClient: re-entrant call to request n before initial' +
486-
' channel established.');
485+
console.warn(
486+
'RSocketClient: re-entrant call to request n before initial' +
487+
' channel established.',
488+
);
487489
}
488490
}
489491
},

packages/rsocket-flowable/src/Flowable.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import FlowableMapOperator from './FlowableMapOperator';
2828
import FlowableTakeOperator from './FlowableTakeOperator';
2929
import invariant from './Invariant';
3030

31-
3231
export type Source<T> = (subscriber: ISubscriber<T>) => void;
3332

3433
/**

packages/rsocket-flowable/src/Invariant.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,19 @@
1717
* The invariant message will be stripped in production, but the invariant will
1818
* remain to ensure logic does not differ in production.
1919
*/
20-
function invariant(condition: mixed, format: string, ...args: Array<mixed>): void {
20+
function invariant(
21+
condition: mixed,
22+
format: string,
23+
...args: Array<mixed>
24+
): void {
2125
if (!condition) {
2226
let error;
2327

2428
if (format === undefined) {
25-
error = new Error('Minified exception occurred; use the non-minified ' +
26-
'dev environment for the full error message and additional helpful warnings.');
29+
error = new Error(
30+
'Minified exception occurred; use the non-minified ' +
31+
'dev environment for the full error message and additional helpful warnings.',
32+
);
2733
} else {
2834
let argIndex = 0;
2935
error = new Error(format.replace(/%s/g, () => String(args[argIndex++])));

packages/rsocket-tck/src/Deferred.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,17 @@ export class Deferred<Tvalue, Treason> {
5252
return Promise.prototype.catch.apply(this._promise, arguments);
5353
}
5454

55-
then(onFulfill?: ?(value: any) => mixed, onReject?: ?(error: any) => mixed): Promise<any> {
55+
then(
56+
onFulfill?: ?(value: any) => mixed,
57+
onReject?: ?(error: any) => mixed,
58+
): Promise<any> {
5659
return Promise.prototype.then.apply(this._promise, arguments);
5760
}
5861

59-
done(onFulfill?: ?(value: any) => mixed, onReject?: ?(error: any) => mixed): void {
62+
done(
63+
onFulfill?: ?(value: any) => mixed,
64+
onReject?: ?(error: any) => mixed,
65+
): void {
6066
// Embed the polyfill for the non-standard Promise.prototype.done so that
6167
// users of the open source fbjs don't need a custom lib for Promise
6268
const promise = arguments.length

packages/rsocket-tck/src/RSocketTckClient.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ async function run(options: Options): Promise<void> {
100100
}
101101
process.stdout.write(chalk.inverse('Running TCK tests') + '\n');
102102
process.stdout.write(`Using testfile${testfilePath}\n`);
103-
process.stdout.write(`Connecting to server at ${options.host}:${options.port}\n`);
103+
process.stdout.write(
104+
`Connecting to server at ${options.host}:${options.port}\n`,
105+
);
104106
const testSource = fs.readFileSync(testfilePath, 'utf8');
105107
const testCases = testSource
106108
.split('!')

packages/rsocket-tcp-client/src/RSocketTcpClient.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ export class RSocketTcpClient extends RSocketTcpConnection {
210210

211211
connect(): void {
212212
if (this.getConnectionState().kind !== 'NOT_CONNECTED') {
213-
throw new Error('RSocketTcpClient: Cannot connect(), a connection is already established.');
213+
throw new Error(
214+
'RSocketTcpClient: Cannot connect(), a connection is already established.',
215+
);
214216
}
215217
this.setConnectionStatus(CONNECTION_STATUS.CONNECTING);
216218
const socket = net.connect(this._options);
@@ -237,7 +239,9 @@ export class RSocketTlsClient extends RSocketTcpConnection {
237239

238240
connect(): void {
239241
if (this.getConnectionState().kind !== 'NOT_CONNECTED') {
240-
throw new Error('RSocketTcpClient: Cannot connect(), a connection is already established.');
242+
throw new Error(
243+
'RSocketTcpClient: Cannot connect(), a connection is already established.',
244+
);
241245
}
242246
this.setConnectionStatus(CONNECTION_STATUS.CONNECTING);
243247
const socket = tls.connect(this._options);

packages/rsocket-websocket-client/src/RSocketWebSocketClient.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ export default class RSocketWebSocketClient implements DuplexConnection {
6767

6868
connect(): void {
6969
if (this._status.kind !== 'NOT_CONNECTED') {
70-
throw new Error('RSocketWebSocketClient: Cannot connect(), a connection is already ' +
71-
'established.');
70+
throw new Error(
71+
'RSocketWebSocketClient: Cannot connect(), a connection is already ' +
72+
'established.',
73+
);
7274
}
7375
this._setConnectionStatus(CONNECTION_STATUS.CONNECTING);
7476

@@ -217,7 +219,9 @@ export default class RSocketWebSocketClient implements DuplexConnection {
217219
? serializeFrameWithLength(frame, this._encoders)
218220
: serializeFrame(frame, this._encoders);
219221
if (!this._socket) {
220-
throw new Error('RSocketWebSocketClient: Cannot send frame, not connected.');
222+
throw new Error(
223+
'RSocketWebSocketClient: Cannot send frame, not connected.',
224+
);
221225
}
222226
this._socket.send(buffer);
223227
} catch (error) {

packages/rsocket-websocket-server/src/RSocketWebSocketServer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ class WSDuplexConnection implements DuplexConnection {
140140
let isSubscribed = false;
141141
this._receiver = new Flowable(subscriber => {
142142
if (isSubscribed) {
143-
throw new Error('RSocketWebSocketServer: Multicast receive() is not supported. Be sure ' +
144-
'to receive/subscribe only once.');
143+
throw new Error(
144+
'RSocketWebSocketServer: Multicast receive() is not supported. Be sure ' +
145+
'to receive/subscribe only once.',
146+
);
145147
}
146148
isSubscribed = true;
147149

0 commit comments

Comments
 (0)