Skip to content

Commit f7a0383

Browse files
committed
chore: 调整 ESLint 配置以支持新的样式选项和文件类型。
1 parent 977f172 commit f7a0383

File tree

9 files changed

+271
-92
lines changed

9 files changed

+271
-92
lines changed

examples/green-wall/plugins/script.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,18 @@ if (isProfile) {
6666
if (theDay && typeof theDay.weekday === 'number') {
6767
if (theDay.weekday === weekday) {
6868
rows[theDay.weekday].push(theDay)
69-
} else {
69+
}
70+
else {
7071
newDays.splice(i, 0, nullDay)
7172
rows[i].push(nullDay)
7273
}
73-
} else {
74+
}
75+
else {
7476
rows[i].push(nullDay)
7577
}
7678
}
77-
} else {
79+
}
80+
else {
7881
days.forEach((day) => {
7982
if (typeof day.weekday === 'number') {
8083
rows[day.weekday].push(day)
@@ -372,7 +375,8 @@ if (isProfile) {
372375
})
373376

374377
hasLoaded = true
375-
} catch {
378+
}
379+
catch {
376380
handleLoadError()
377381
}
378382
},
@@ -396,7 +400,8 @@ if (isProfile) {
396400
handleDialogOpen()
397401
})
398402
}
399-
} else {
403+
}
404+
else {
400405
console.warn('[Green Wall]: Target node not found.')
401406
}
402407
}

examples/green-wall/src/useGraphRequest.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,19 @@ export function useGraphRequest(config: { onError?: () => void } = {}) {
2424

2525
if (res.ok) {
2626
return resJson.data
27-
} else {
27+
}
28+
else {
2829
setError({ errorType: resJson.errorType, message: resJson.message })
2930
}
30-
} catch (err) {
31+
}
32+
catch (err) {
3133
if (err instanceof Error) {
3234
trackEvent('Error: Fetch Ccontribution Data', { msg: err.message })
3335
}
3436

3537
onError()
36-
} finally {
38+
}
39+
finally {
3740
setLoading(false)
3841
}
3942
},

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
".": {
2424
"require": "./src/index.js"
2525
},
26+
"./constants": {
27+
"import": "./src/constants.mjs"
28+
},
2629
"./eslint/*": {
2730
"import": "./src/eslint/*.mjs"
2831
},
@@ -37,9 +40,6 @@
3740
},
3841
"./stylelint": {
3942
"require": "./src/stylelint.js"
40-
},
41-
"./constants": {
42-
"import": "./src/constants.mjs"
4343
}
4444
},
4545
"files": [
@@ -63,9 +63,8 @@
6363
"@next/eslint-plugin-next": "~15.2.3",
6464
"@stylistic/eslint-plugin": "^4.2.0",
6565
"eslint": "~9.23.0",
66-
"eslint-config-prettier": "^10.1.1",
6766
"eslint-plugin-jsx-a11y": "^6.10.2",
68-
"eslint-plugin-prettier": "~5.2.3",
67+
"eslint-plugin-package-json": "^0.29.0",
6968
"eslint-plugin-react": "~7.37.4",
7069
"eslint-plugin-react-hooks": "~5.2.0",
7170
"eslint-plugin-simple-import-sort": "~12.1.1",

0 commit comments

Comments
 (0)