Skip to content

Commit a9f8ac1

Browse files
committed
chore(eslint): Update eslint 8.43.0 -> 9.21.0
chore(eslint-plugin-import): Update eslint-plugin-import 2.27.5 -> 2.31.0 chore(@eslint/js) Add @eslint/js required for eslint 9.x.x chore(eslint-config-prettier): Add eslint-config-prettier to remove conflicts chore(globals): Add globals required for eslint 9.x.x
1 parent a2919d4 commit a9f8ac1

25 files changed

+2270
-1123
lines changed

.eslintrc

Lines changed: 0 additions & 25 deletions
This file was deleted.

API/constants/functions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
}
99
str = splitStr.join(" ");
1010
return str;
11-
} catch (err) {
11+
} catch {
1212
return null;
1313
}
1414
},

API/constants/pets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class Eerie extends Pet {
334334
const mult = getValue(this.rarity, { legendary: 0.01 });
335335

336336
const primalFearKills = this.profile.kills
337-
? (this.profile.kills.kills.find((mob) => mob.entityId === "primal_fear")?.amount ?? 0)
337+
? this.profile.kills.kills.find((mob) => mob.entityId === "primal_fear")?.amount ?? 0
338338
: 0;
339339
const kills = Math.max(primalFearKills, 150);
340340

API/functions/getCalendar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function getSkyblockCalendar() {
66
const calendar = buildSkyblockCalendar(null, Date.now(), Date.now() + 10710000000, 1, false);
77

88
return calendar;
9-
} catch (error) {
9+
} catch {
1010
return null;
1111
}
1212
}

API/functions/getGarden.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-throw-literal */
21
const config = require("../../config.json");
32
const axios = require("axios");
43

API/functions/getLatestProfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-throw-literal */
21
const { getUUID, getUsername } = require("../../src/contracts/API/mowojangAPI.js");
32
const { getMuseum } = require("./getMuseum.js");
43
const { getGarden } = require("./getGarden.js");

API/functions/getMuseum.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-throw-literal */
21
const config = require("../../config.json");
32
const axios = require("axios");
43

API/stats/jacob.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = (profile) => {
2929
} else {
3030
return null;
3131
}
32-
} catch (error) {
32+
} catch {
3333
return null;
3434
}
3535
};

API/stats/pets.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = (profile) => {
4444
petData.hatching?.level > pet.level
4545
? petData.hatching.name
4646
: petData.name
47-
? (petData.name[pet.rarity] ?? petData.name.default)
47+
? petData.name[pet.rarity] ?? petData.name.default
4848
: titleCase(pet.type.replaceAll("_", " "));
4949

5050
// Rarity upgrades
@@ -60,8 +60,7 @@ module.exports = (profile) => {
6060

6161
// Get texture
6262
if (typeof petData.head === "object") {
63-
pet.texture_path =
64-
`https://sky.shiiyu.moe${petData.head[pet.rarity]}` ?? `https://sky.shiiyu.moe${petData.head.default}`;
63+
pet.texture_path = `https://sky.shiiyu.moe${petData.head[pet.rarity] ?? petData.head.default}`;
6564
} else {
6665
pet.texture_path = `https://sky.shiiyu.moe${petData.head}`;
6766
}

eslint.config.mjs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import importPlugin from "eslint-plugin-import";
2+
import prettier from "eslint-config-prettier";
3+
import globals from "globals";
4+
import js from "@eslint/js";
5+
6+
export default [
7+
js.configs.recommended,
8+
importPlugin.flatConfigs.recommended,
9+
prettier,
10+
{
11+
languageOptions: {
12+
ecmaVersion: 2021,
13+
sourceType: "module",
14+
globals: {
15+
...globals.es2021,
16+
...globals.node,
17+
bot: "readonly",
18+
client: "readonly",
19+
guild: "readonly",
20+
imgurUrl: "writeable"
21+
}
22+
},
23+
rules: {
24+
"no-constant-condition": ["error", { checkLoops: false }],
25+
"import/extensions": ["warn", "always", { ts: "never" }],
26+
"prefer-const": ["warn", { destructuring: "all" }],
27+
"no-unused-vars": ["error", { args: "none" }],
28+
curly: ["warn", "multi-line", "consistent"]
29+
}
30+
}
31+
];

0 commit comments

Comments
 (0)