diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..e3e4c05 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +node_modules +tests +dist \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 81122ea..2a0e8f3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,10 @@ { "root": true, "parser": "@typescript-eslint/parser", + "parserOptions": { + "sourceType": "module", + "project": "./tsconfig.json" + }, "plugins": ["@typescript-eslint"], "extends": [ "plugin:@typescript-eslint/eslint-recommended", @@ -16,7 +20,6 @@ "require-await": "warn", "no-await-in-loop": "warn", "spaced-comment": "warn", - "sort-imports": "warn", "no-unused-vars": "off", "curly": "warn", diff --git a/src/api.ts b/src/api.ts index c6c0816..c442322 100644 --- a/src/api.ts +++ b/src/api.ts @@ -1,20 +1,24 @@ -import axios from "axios"; -import { MetarResponse } from "./types/response/metar.js"; -import { TafResponse } from "./types/response/taf.js"; +import axios, { AxiosResponse } from "axios"; import { TafParams } from "./types/params/taf.js"; +import { TafResponse } from "./types/response/taf.js"; +import { MetarResponse } from "./types/response/metar.js"; import { MetarParams } from "./types/params/metar.js"; export const api = axios.create({ baseURL: "https://aviationweather.gov/cgi-bin/data", }); -export function getMetar(params: MetarParams) { +export function getMetar( + params: MetarParams +): Promise> { return api.get("/metar.php", { params, }); } -export function getTaf(params: TafParams) { +export function getTaf( + params: TafParams +): Promise> { return api.get("/metar.php", { params, });