chore: format description in lint-staged
This commit is contained in:
parent
a4b9d76776
commit
c2b00f6090
|
|
@ -17,11 +17,9 @@ export const route: Route = {
|
|||
categories: ['traditional-media'],
|
||||
description: `Provides a better reading experience (full text articles) over the official ones.
|
||||
|
||||
\`\`\`
|
||||
Support major channels, refer to [BBC RSS feeds](https://www.bbc.co.uk/news/10628494). Eg, \`business\` for \`https://feeds.bbci.co.uk/news/business/rss.xml\`.
|
||||
|
||||
- Channel contains sub-directories, such as \`https://feeds.bbci.co.uk/news/world/asia/rss.xml\`, replace \`/\` with \`-\`, \`/bbc/world-asia\`.
|
||||
\`\`\``,
|
||||
- Channel contains sub-directories, such as \`https://feeds.bbci.co.uk/news/world/asia/rss.xml\`, replace \`/\` with \`-\`, \`/bbc/world-asia\`.`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
|
|
|
|||
|
|
@ -46,9 +46,7 @@ export const route: Route = {
|
|||
name: 'Channels',
|
||||
description: `Get the channel from the Castbox channel URL. For example, the URL of the channel "Lemonade Stand" is \`https://castbox.fm/channel/Lemonade-Stand-id6776228\`, where \`Lemonade-Stand-id6776228\` is the \`channel\` parameter.
|
||||
|
||||
\`\`\`
|
||||
You can use the RSSHub global \`limit\` query parameter to specify the maximum number of episodes to fetch from the Castbox API (defaults to 50). For example: \`/castbox/channel/Lemonade-Stand-id6776228?limit=100\`.
|
||||
\`\`\``,
|
||||
You can use the RSSHub global \`limit\` query parameter to specify the maximum number of episodes to fetch from the Castbox API (defaults to 50). For example: \`/castbox/channel/Lemonade-Stand-id6776228?limit=100\`.`,
|
||||
maintainers: ['ananyatimalsina'],
|
||||
handler: async (ctx) => {
|
||||
const { channel } = ctx.req.param();
|
||||
|
|
|
|||
|
|
@ -27,25 +27,19 @@ export const route: Route = {
|
|||
description: `<details>
|
||||
<summary>市场公告</summary>
|
||||
|
||||
\`\`\`
|
||||
外汇市场公告
|
||||
\`\`\`
|
||||
|
||||
| 最新 | 市场公告通知 | 中心会员公告 | 会员信息公告 |
|
||||
| ---- | ------------ | ------------ | ------------ |
|
||||
| 2834 | 2835 | 2836 | 2837 |
|
||||
|
||||
\`\`\`
|
||||
本币市场公告
|
||||
\`\`\`
|
||||
|
||||
| 最新 | 市场公告通知 | 中心会员公告 | 会员信息公告 |
|
||||
| -------------- | ------------ | ------------ | ------------ |
|
||||
| 2839,2840,2841 | 2839 | 2840 | 2841 |
|
||||
|
||||
\`\`\`
|
||||
央行业务公告
|
||||
\`\`\`
|
||||
|
||||
| 最新 | 公开市场操作 | 中央国库现金管理 |
|
||||
| --------- | ------------ | ---------------- |
|
||||
|
|
@ -56,9 +50,7 @@ export const route: Route = {
|
|||
<details>
|
||||
<summary>本币市场</summary>
|
||||
|
||||
\`\`\`
|
||||
贷款市场报价利率
|
||||
\`\`\`
|
||||
|
||||
| LPR 市场公告 |
|
||||
| ------------ |
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@ import type { Namespace } from '@/types';
|
|||
export const namespace: Namespace = {
|
||||
name: 'DeadbyDaylight',
|
||||
url: 'deadbydaylight.com',
|
||||
description: `\`\`\`
|
||||
DeadbyDaylight Official
|
||||
\`\`\``,
|
||||
description: 'DeadbyDaylight Official',
|
||||
zh: {
|
||||
name: '黎明杀机',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -30,49 +30,37 @@ export const route: Route = {
|
|||
description: `<details>
|
||||
<summary>专题 ID</summary>
|
||||
|
||||
\`\`\`
|
||||
游戏推荐
|
||||
\`\`\`
|
||||
|
||||
| itch 一周游戏汇 | 一周值得关注的发售作品 | 诺娃速递 | 周末游戏视频集锦 | 每月媒体评分 | 年度最佳游戏 | Indie Focus 近期新游 | indienova Picks 精选 |
|
||||
| --------------- | ---------------------- | -------- | ---------------- | ------------ | ------------ | -------------------- | -------------------- |
|
||||
| 52 | 29 | 41 | 43 | 45 | 39 | 1 | 8 |
|
||||
|
||||
\`\`\`
|
||||
游戏评论
|
||||
\`\`\`
|
||||
|
||||
| 游必有方 Podcast | 独立游戏潮(RED) |
|
||||
| ---------------- | ----------------- |
|
||||
| 6 | 3 |
|
||||
|
||||
\`\`\`
|
||||
游戏开发
|
||||
\`\`\`
|
||||
|
||||
| 游戏设计模式 | Roguelike 开发 | GMS 中文教程 |
|
||||
| ------------ | -------------- | ------------ |
|
||||
| 15 | 14 | 7 |
|
||||
|
||||
\`\`\`
|
||||
游戏设计
|
||||
\`\`\`
|
||||
|
||||
| 游戏与所有 | 让人眼前一亮的游戏设计 | 游戏音乐分析 | 游戏情感设计 | 游戏相关书籍 | 游戏设计课程笔记 | 游戏设计工具 | 游戏设计灵感 | 设计师谈设计 | 游戏研究方法 | 功能游戏 | 游戏设计专业院校 | 像素课堂 |
|
||||
| ---------- | ---------------------- | ------------ | ------------ | ------------ | ---------------- | ------------ | ------------ | ------------ | ------------ | -------- | ---------------- | -------- |
|
||||
| 10 | 33 | 17 | 4 | 22 | 11 | 24 | 26 | 27 | 28 | 38 | 9 | 19 |
|
||||
|
||||
\`\`\`
|
||||
游戏文化
|
||||
\`\`\`
|
||||
|
||||
| NOVA 海外独立游戏见闻 | 工作室访谈 | indie Figure 游戏人 | 游戏艺术家 | 独立游戏音乐欣赏 | 游戏瑰宝 | 电脑 RPG 游戏史 | ALT. CTRL. GAMING |
|
||||
| --------------------- | ---------- | ------------------- | ---------- | ---------------- | -------- | --------------- | ----------------- |
|
||||
| 53 | 23 | 5 | 44 | 18 | 21 | 16 | 2 |
|
||||
|
||||
\`\`\`
|
||||
Game Jam
|
||||
\`\`\`
|
||||
|
||||
| Ludum Dare | Global Game Jam |
|
||||
| ---------- | --------------- |
|
||||
|
|
|
|||
|
|
@ -33,11 +33,9 @@ export const route: Route = {
|
|||
name: '用户作品',
|
||||
description: `例如:
|
||||
|
||||
\`\`\`
|
||||
站酷的个人主页 \`https://baiyong.zcool.com.cn\` 对应 rss 路径 \`/zcool/user/baiyong\`
|
||||
|
||||
站酷的个人主页 \`https://www.zcool.com.cn/u/568339\` 对应 rss 路径 \`/zcool/user/568339\`
|
||||
\`\`\``,
|
||||
站酷的个人主页 \`https://www.zcool.com.cn/u/568339\` 对应 rss 路径 \`/zcool/user/568339\``,
|
||||
maintainers: ['junbaor'],
|
||||
handler,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -213,6 +213,7 @@
|
|||
"oxfmt --no-error-on-unmatched-pattern"
|
||||
],
|
||||
"*.{ts,tsx,js,cjs,mjs}": [
|
||||
"tsx scripts/workflow/format-description.ts",
|
||||
"oxlint --type-aware --fix",
|
||||
"eslint --cache --fix --concurrency auto",
|
||||
"oxfmt --no-error-on-unmatched-pattern"
|
||||
|
|
|
|||
|
|
@ -267,10 +267,23 @@ async function processFile(filePath: string): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
function isRouteFile(filePath: string): boolean {
|
||||
const abs = path.resolve(filePath);
|
||||
if (!abs.startsWith(routesDir + path.sep)) {
|
||||
return false;
|
||||
}
|
||||
const base = path.basename(abs);
|
||||
return /\.tsx?$/.test(base) && !base.endsWith('.d.ts');
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const started = performance.now();
|
||||
// @ts-ignore ts(2550)
|
||||
const files: string[] = await Array.fromAsync(walk(routesDir));
|
||||
const args = process.argv.slice(2);
|
||||
const files: string[] =
|
||||
args.length > 0
|
||||
? args.map((f) => path.resolve(f)).filter((f) => isRouteFile(f))
|
||||
: // @ts-ignore ts(2550)
|
||||
await Array.fromAsync(walk(routesDir));
|
||||
|
||||
await Promise.all(files.map((f) => processFile(f)));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue