Skip to content

Commit

Permalink
chore: lint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan committed Jun 11, 2020
1 parent ff59502 commit 59a193b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { fetch } from "./api";
import { Server, QueryResult } from "../models/serverQueryResult";

const handleHelp = (args: string[]) => {
if (args.filter(x => x === "-h").length > 0) {
if (args.filter((x) => x === "-h").length > 0) {
console.log(`
usage: vpn-servers [parameters]
[-filter.<property> eq|lt|gt|le|ge|ne <value>]... Filter result
Expand Down Expand Up @@ -45,7 +45,7 @@ const print = (servers: Server[], args: string[]) => {
outputFilter = { name: "name" };
}

console.log(servers.map(x => project(x, outputFilter)));
console.log(servers.map((x) => project(x, outputFilter)));
} else {
console.log(servers);
}
Expand All @@ -59,12 +59,13 @@ const sortResult = (servers: Server[]) => {
return servers.sort((first, second) => first.load - second.load);
};

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
const run = async (args: string[]) => {
handleHelp(args);

const result = await fetch()
.then(response => filter(response, args))
.then(filtered => sortResult(filtered));
.then((response) => filter(response, args))
.then((filtered) => sortResult(filtered));

print(result, args);
};
Expand Down
4 changes: 2 additions & 2 deletions src/models/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export const empty: Server = {
features: features.empty,
flag: "",
id: 0,
// eslint-disable-next-line @typescript-eslint/camelcase
// eslint-disable-next-line
ip_address: "",
load: 0,
location: coordinate.empty,
name: "empty",
price: 0,
// eslint-disable-next-line @typescript-eslint/camelcase
// eslint-disable-next-line
search_keywords: []
};

Expand Down
2 changes: 0 additions & 2 deletions src/models/serverFeatures.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ServerFeatures } from "../types";

/* eslint-disable @typescript-eslint/camelcase */
export const empty: ServerFeatures = {
ikev2: false,
ikev2_v6: false,
Expand All @@ -23,7 +22,6 @@ export const empty: ServerFeatures = {
socks: false,
wireguard_udp: false
};
/* eslint-enable @typescript-eslint/camelcase */

export default {
empty
Expand Down

0 comments on commit 59a193b

Please sign in to comment.