Skip to content

Commit 48bef13

Browse files
committed
fix eslint
1 parent f5b9020 commit 48bef13

25 files changed

+126
-149
lines changed

.eslintrc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"root": true,
33
"parser": "@typescript-eslint/parser",
44
"env": { "node": true },
5-
"plugins": ["@typescript-eslint"],
5+
"plugins": ["@typescript-eslint", "only-warn"],
66
"extends": ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended"],
77
"parserOptions": {
88
"sourceType": "module"
@@ -12,6 +12,9 @@
1212
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }],
1313
"@typescript-eslint/ban-ts-comment": "off",
1414
"no-prototype-builtins": "off",
15-
"@typescript-eslint/no-empty-function": "off"
15+
"@typescript-eslint/no-empty-function": "off",
16+
"@typescript-eslint/no-inferrable-types": "off",
17+
"@typescript-eslint/no-explicit-any": "off",
18+
"@typescript-eslint/explicit-function-return-type": ["warn"]
1619
}
1720
}

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"builtin-modules": "^3.2.0",
2424
"esbuild": "0.13.12",
2525
"esbuild-svelte": "^0.7.1",
26+
"eslint-plugin-only-warn": "^1.0.3",
2627
"jest": "^28.1.2",
2728
"jest-fetch-mock": "^3.0.3",
2829
"obsidian": "latest",

src/api/apis/BoardGameGeekAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class BoardGameGeekAPI extends APIModel {
3535

3636
console.debug(response);
3737

38-
let ret: MediaTypeModel[] = [];
38+
const ret: MediaTypeModel[] = [];
3939

4040
for (const boardgame of Array.from(response.querySelectorAll('boardgame'))) {
4141
const id = boardgame.attributes.getNamedItem('objectid')!.value;

src/api/apis/LocGovAPI.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { APIModel } from '../APIModel';
22
import { MediaTypeModel } from '../../models/MediaTypeModel';
33
import MediaDbPlugin from '../../main';
4-
import { debugLog } from '../../utils/Utils';
54

65
// WIP
76
export class LocGovAPI extends APIModel {

src/api/apis/MALAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class MALAPI extends APIModel {
3838

3939
console.debug(data);
4040

41-
let ret: MediaTypeModel[] = [];
41+
const ret: MediaTypeModel[] = [];
4242

4343
for (const result of data.data) {
4444
const type = this.typeMappings.get(result.type?.toLowerCase());

src/api/apis/MusicBrainzAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class MusicBrainzAPI extends APIModel {
3939

4040
const data = await fetchData.json;
4141
console.debug(data);
42-
let ret: MediaTypeModel[] = [];
42+
const ret: MediaTypeModel[] = [];
4343

4444
for (const result of data['release-groups']) {
4545
ret.push(

src/api/apis/OMDbAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class OMDbAPI extends APIModel {
4848

4949
console.debug(data.Search);
5050

51-
let ret: MediaTypeModel[] = [];
51+
const ret: MediaTypeModel[] = [];
5252

5353
for (const result of data.Search) {
5454
const type = this.typeMappings.get(result.Type.toLowerCase());

src/api/apis/SteamAPI.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class SteamAPI extends APIModel {
3737

3838
console.debug(data);
3939

40-
let filteredData = [];
40+
const filteredData = [];
4141

4242
for (const app of data.applist.apps) {
4343
if (app.name.toLowerCase().includes(title.toLowerCase())) {
@@ -48,7 +48,7 @@ export class SteamAPI extends APIModel {
4848
}
4949
}
5050

51-
let ret: MediaTypeModel[] = [];
51+
const ret: MediaTypeModel[] = [];
5252

5353
for (const result of filteredData) {
5454
ret.push(
@@ -69,7 +69,7 @@ export class SteamAPI extends APIModel {
6969
async getById(id: string): Promise<MediaTypeModel> {
7070
console.log(`MDB | api "${this.apiName}" queried by ID`);
7171

72-
const searchUrl = `http://store.steampowered.com/api/appdetails?appids=${encodeURIComponent(id)}`;
72+
const searchUrl = `http://store.steampowered.com/api/appdetails?appids=${encodeURIComponent(id)}&l=en`;
7373
const fetchData = await requestUrl({
7474
url: searchUrl,
7575
});

src/api/apis/WikipediaAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class WikipediaAPI extends APIModel {
3030

3131
const data = await fetchData.json();
3232
console.debug(data);
33-
let ret: MediaTypeModel[] = [];
33+
const ret: MediaTypeModel[] = [];
3434

3535
for (const result of data.query.search) {
3636
ret.push(

0 commit comments

Comments
 (0)