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
27 changes: 0 additions & 27 deletions .eslintrc.json

This file was deleted.

5 changes: 0 additions & 5 deletions bin/.eslintrc.json

This file was deleted.

8 changes: 4 additions & 4 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,16 @@ async function run(argv) {
console.log(`Started throttler on localhost RTT:${options.rtt}ms `);
} else {
let message = 'Started throttler:';
if (typeof options.down !== 'undefined') {
if (options.down !== undefined) {
message += ` Down:${options.down}kbit/s`;
}
if (typeof options.up !== 'undefined') {
if (options.up !== undefined) {
message += ` Up:${options.up}kbit/s`;
}
if (typeof options.rtt !== 'undefined') {
if (options.rtt !== undefined) {
message += ` RTT:${options.rtt}ms`;
}
if (typeof options.packetLoss !== 'undefined') {
if (options.packetLoss !== undefined) {
message += ` PacketLoss:${options.packetLoss}%`;
}
console.log(message);
Expand Down
39 changes: 39 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import prettier from 'eslint-plugin-prettier';
import unicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
import js from '@eslint/js';

export default [
js.configs.recommended,
unicorn.configs.recommended,
{
plugins: {
prettier
},

languageOptions: {
globals: {
...globals.node
},

ecmaVersion: 'latest',
sourceType: 'module'
},

rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'none'
}
],

'no-extra-semi': 'off',
'no-mixed-spaces-and-tabs': 'off',
'no-unexpected-multiline': 'off',
'no-return-await': 'error',
'unicorn/filename-case': 'off'
}
}
];
6 changes: 4 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ export async function start(options = {}) {
: startTc(options.up, options.down, options.rtt, options.packetLoss);
}

default:
default: {
throw new Error('Platform ' + platform() + ' not supported');
}
}
}
export async function stop(options = {}) {
Expand All @@ -62,7 +63,8 @@ export async function stop(options = {}) {
return options.localhost ? stopTcLocalhost() : stopTc();
}

default:
default: {
throw new Error('Platform ' + platform() + ' not supported');
}
}
}
Loading
Loading