Skip to content

Commit 0ccd1a0

Browse files
Doarakkoclaude
andcommitted
refactor(lint): migrate from ESLint to Biome
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6f9acbc commit 0ccd1a0

File tree

7 files changed

+456
-2087
lines changed

7 files changed

+456
-2087
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: eslint
1+
name: lint
22
on: push
33
jobs:
44
lint:

biome.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"formatter": {
7+
"enabled": true,
8+
"indentStyle": "space",
9+
"indentWidth": 2
10+
},
11+
"linter": {
12+
"enabled": true,
13+
"rules": {
14+
"recommended": true
15+
}
16+
},
17+
"files": {
18+
"ignore": ["dist/"]
19+
}
20+
}

index.js

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,40 @@
1-
import fetch from "node-fetch";
21
import { getInput, setFailed } from "@actions/core";
32
import { context } from "@actions/github";
43
import { Octokit } from "@octokit/core";
4+
import fetch from "node-fetch";
55

66
async function run() {
77
try {
88
const githubToken = getInput("github-token");
99
const octokit = new Octokit({ auth: githubToken });
1010

11-
fetch("https://db.ygoprodeck.com/api/v7/cardinfo.php?num=1&offset=0&sort=random&cachebust")
11+
fetch(
12+
"https://db.ygoprodeck.com/api/v7/cardinfo.php?num=1&offset=0&sort=random&cachebust",
13+
)
1214
.then((response) => {
13-
if(!response.ok){
14-
console.error('response.ok:', response.ok);
15-
console.error('esponse.status:', response.status);
16-
console.error('esponse.statusText:', response.statusText);
15+
if (!response.ok) {
16+
console.error("response.ok:", response.ok);
17+
console.error("esponse.status:", response.status);
18+
console.error("esponse.statusText:", response.statusText);
1719
throw new Error("Failed to fetch random card");
1820
}
1921
return response.json();
2022
})
2123
.then((data) => {
22-
if (!(('data' in data) && Array.isArray(data["data"]) && data["data"].length > 0)) {
24+
if (
25+
!("data" in data && Array.isArray(data.data) && data.data.length > 0)
26+
) {
2327
throw new Error("Failed to get card");
2428
}
25-
const card = data["data"][0];
29+
const card = data.data[0];
2630
const cardName = card.name;
27-
if (!(('card_images' in card) && Array.isArray(card.card_images) && card.card_images.length > 0)) {
31+
if (
32+
!(
33+
"card_images" in card &&
34+
Array.isArray(card.card_images) &&
35+
card.card_images.length > 0
36+
)
37+
) {
2838
throw new Error("Failed to get card images");
2939
}
3040
const imageUrl = card.card_images[0].image_url;
@@ -36,7 +46,7 @@ async function run() {
3646
owner: context.repo.owner,
3747
repo: context.repo.repo,
3848
body: `_**Draw "${cardName}" !**_\n\n![${cardName}](${imageUrl})`,
39-
}
49+
},
4050
);
4151
});
4252
} catch (error) {

0 commit comments

Comments
 (0)