Skip to content

Commit

Permalink
clean up lint + type warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
banterability committed Feb 10, 2024
1 parent 5a4ae77 commit 5ee5fe8
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
4 changes: 4 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ module.exports = {
"plugin:@typescript-eslint/recommended",
"prettier",
],
env: {
es6: true,
node: true,
},
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "import"],
root: true,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $ npm install slow-zone
Make sure you have a [CTA Train Tracker API Key][1].

```javascript
const SlowZone = require("slow-zone");
import SlowZone from "slow-zone";

const client = new SlowZone({ apiKey: "afafafafafafafafafafafafafafafaf" });
```
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class SlowZone {
return this.fetch("ttarrivals.aspx", options);
}

private async fetch(endpoint: string, queryParams: {}) {
private async fetch(endpoint: string, queryParams = {}) {
return this.makeRequest(endpoint, queryParams).then((resp) => {
return new Promise((resolve, reject) => {
if (!resp) {
Expand Down Expand Up @@ -72,8 +72,8 @@ export default class SlowZone {
return reject(new Error(res.statusCode.toString()));
}

let body: any[] = [],
json;
const body: Uint8Array[] = [];
let json;

res.on("data", (chunk) => {
body.push(chunk);
Expand Down
4 changes: 1 addition & 3 deletions src/parsers/prediction.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import timekeeper from "timekeeper";
import { describe, beforeAll, afterAll, test, expect } from "vitest";


import { parsePrediction } from "./train.js";

import type {
Expand All @@ -9,8 +9,6 @@ import type {
TrainDirection,
} from "../types/responses.js";

const timekeeper = require("timekeeper");

const MOCK_ATTRIBUTES = {
staId: "40160",
stpId: "30031",
Expand Down
3 changes: 1 addition & 2 deletions src/parsers/train.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import timekeeper from "timekeeper";
import { describe, beforeAll, afterAll, test, expect } from "vitest";

import { parseTrain } from "./train.js";

const timekeeper = require("timekeeper");

const MOCK_TRAIN_JSON = JSON.stringify({
staId: "40160",
stpId: "30031",
Expand Down

0 comments on commit 5ee5fe8

Please sign in to comment.