Skip to content

Commit

Permalink
style: use antfu's style and bump eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
northword committed Jun 29, 2024
1 parent 830481c commit 7bb525f
Show file tree
Hide file tree
Showing 66 changed files with 3,290 additions and 1,850 deletions.
25 changes: 0 additions & 25 deletions .eslintrc.cjs

This file was deleted.

41 changes: 21 additions & 20 deletions .github/scripts/fetch-data.mjs
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
import fs from "fs-extra";
import path from "path";
import { exit } from "process";
/* eslint-disable no-console */
import path from 'node:path'
import { exit } from 'node:process'
import fs from 'fs-extra'

const data_list = [
{
local_path: "src/plugins/data/plugins.json",
local_path: 'src/plugins/data/plugins.json',
remote_url:
"https://raw.githubusercontent.com/zotero-chinese/zotero-plugins/gh-pages/dist/plugins.json",
'https://raw.githubusercontent.com/zotero-chinese/zotero-plugins/gh-pages/dist/plugins.json',
},
{
local_path: "src/plugins/data/update-time.json",
local_path: 'src/plugins/data/update-time.json',
remote_url:
"https://raw.githubusercontent.com/zotero-chinese/zotero-plugins/gh-pages/dist/shields.json",
'https://raw.githubusercontent.com/zotero-chinese/zotero-plugins/gh-pages/dist/shields.json',
},
{
local_path: "src/plugins/data/charts.json",
local_path: 'src/plugins/data/charts.json',
remote_url:
"https://raw.githubusercontent.com/zotero-chinese/zotero-plugins/gh-pages/dist/charts.json",
'https://raw.githubusercontent.com/zotero-chinese/zotero-plugins/gh-pages/dist/charts.json',
},
{
local_path: "src/translators/data/dashboard.json",
local_path: 'src/translators/data/dashboard.json',
remote_url:
"https://raw.githubusercontent.com/l0o0/translators_CN/master/data/dashboard.json",
'https://raw.githubusercontent.com/l0o0/translators_CN/master/data/dashboard.json',
},
];
]

const tasks = data_list.map(async (d) => {
const data = await (await fetch(d.remote_url)).json();
fs.outputJSONSync(path.resolve(d.local_path), data);
console.log(`Download ${d.local_path} success!`);
});
const data = await (await fetch(d.remote_url)).json()
fs.outputJSONSync(path.resolve(d.local_path), data)
console.log(`Download ${d.local_path} success!`)
})

Promise.all(tasks)
.then(() => {
console.log("Done!");
console.log('Done!')
})
.catch((e) => {
console.error(e);
exit(1);
});
console.error(e)
exit(1)
})
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- name: Install deps
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ jobs:
id: netlify
uses: nwtgck/actions-netlify@v3.0
with:
publish-dir: "dist"
deploy-message: "Deploy from GitHub Actions"
publish-dir: dist
deploy-message: Deploy from GitHub Actions
production-deploy: true
enable-commit-comment: false
enable-pull-request-comment: false
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
id: netlify
uses: nwtgck/actions-netlify@v3.0
with:
publish-dir: "dist"
deploy-message: "Deploy from GitHub Actions"
publish-dir: dist
deploy-message: Deploy from GitHub Actions
production-deploy: false
alias: deploy-preview-${{ env.PR_NUM }}
enable-commit-comment: false
Expand All @@ -63,7 +63,7 @@ jobs:
id: fc
with:
issue-number: ${{ env.PR_NUM }}
comment-author: "github-actions[bot]"
comment-author: 'github-actions[bot]'
body-includes: <!-- auto message -->

- name: 创建或更新评论
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
id: fc
with:
issue-number: ${{ env.PR_NUM }}
comment-author: "github-actions[bot]"
comment-author: 'github-actions[bot]'
body-includes: <!-- auto message -->

- name: 创建或更新评论:失败
Expand Down
Loading

0 comments on commit 7bb525f

Please sign in to comment.