Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed .eslintignore
Empty file.
7 changes: 0 additions & 7 deletions .eslintrc

This file was deleted.

10 changes: 10 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'eslint/config';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import js from '@eslint/js';

export default defineConfig([
{ files: ['**/*.js', '**/*.mjs'], languageOptions: { globals: globals.node } },
{ plugins: { js }, extends: ['js/recommended'] },
eslintPluginPrettierRecommended
]);
5 changes: 0 additions & 5 deletions examples/.eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion lib/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Session {
remoteAddress = socket.remoteAddress;
remotePort = socket.remotePort;
address = socket.address();
} catch (x) {
} catch {
// intentionally empty
}

Expand Down
4 changes: 2 additions & 2 deletions lib/transport/jsonp-polling.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function jsonp_send(req, res, _head, next) {
if (typeof req.body === 'string') {
try {
d = JSON.parse(req.body);
} catch (x) {
} catch {
return next({
status: 500,
message: 'Broken JSON encoding.'
Expand All @@ -69,7 +69,7 @@ function jsonp_send(req, res, _head, next) {
if (typeof d === 'string' && d) {
try {
d = JSON.parse(d);
} catch (x) {
} catch {
return next({
status: 500,
message: 'Broken JSON encoding.'
Expand Down
6 changes: 3 additions & 3 deletions lib/transport/response-receiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ResponseReceiver extends BaseReceiver {
this.curr_response_size = 0;
try {
this.request.socket.setKeepAlive(true, 5000);
} catch (x) {
} catch {
// intentionally empty
}
}
Expand All @@ -27,7 +27,7 @@ class ResponseReceiver extends BaseReceiver {
try {
this.response.write(payload);
r = true;
} catch (x) {
} catch {
// intentionally empty
}
if (this.max_response_size && this.curr_response_size >= this.max_response_size) {
Expand All @@ -40,7 +40,7 @@ class ResponseReceiver extends BaseReceiver {
super.close(...arguments);
try {
this.response.end();
} catch (x) {
} catch {
// intentionally empty
}
this.request = null;
Expand Down
2 changes: 1 addition & 1 deletion lib/transport/websocket-raw.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class RawWebsocketSessionReceiver {
this.ws.removeEventListener('close', this._close);
try {
this.ws.close(1000, 'Normal closure', false);
} catch (x) {
} catch {
// intentionally empty
}
this.ws = null;
Expand Down
8 changes: 4 additions & 4 deletions lib/transport/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class WebSocketReceiver extends BaseReceiver {
this.ws = ws;
try {
socket.setKeepAlive(true, 5000);
} catch (x) {
} catch {
// intentionally empty
}
this.ws.once('close', this.abort);
Expand All @@ -35,7 +35,7 @@ class WebSocketReceiver extends BaseReceiver {
let message;
try {
message = JSON.parse(payload);
} catch (x) {
} catch {
return this.close(3000, 'Broken framing.');
}
if (payload[0] === '[') {
Expand All @@ -52,7 +52,7 @@ class WebSocketReceiver extends BaseReceiver {
try {
this.ws.send(payload);
return true;
} catch (x) {
} catch {
// intentionally empty
}
}
Expand All @@ -64,7 +64,7 @@ class WebSocketReceiver extends BaseReceiver {
if (this.ws) {
try {
this.ws.close(status, reason, false);
} catch (x) {
} catch {
// intentionally empty
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/transport/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
let d;
try {
d = JSON.parse(req.body);
} catch (x) {
} catch {
return next({
status: 500,
message: 'Broken JSON encoding.'
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports.fake_response = function fake_response(req, res) {
r.push('');
try {
res.write(r.join('\r\n'));
} catch (x) {
} catch {
// intentionally empty
}
};
Expand Down
Loading
Loading