Skip to content

Commit 16c09ef

Browse files
committed
docs: fix linting
1 parent 716287f commit 16c09ef

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

docs/guide/types.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,13 @@ Custom type functions with display properties can also be used for parameters, p
485485

486486
```ts
487487
// Custom type function for parsing version numbers
488-
const Version = (value: string): string => {
488+
function Version(value: string): string {
489489
if (!/^\d+\.\d+\.\d+$/.test(value)) {
490490
throw new Error(`Invalid version format: ${value}. Expected format: x.y.z`);
491491
}
492+
492493
return value;
493-
};
494+
}
494495

495496
// Add display property for help documentation
496497
Version.display = "x.y.z";

docs/zh/guide/context.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ const cli = Clerc.create()
7171
}
7272
})
7373
.parse();
74+
75+
// 也可以通过 cli.store 访问存储
76+
const config = cli.store.config;
7477
```
7578

7679
### 存储与上下文存储的区别
@@ -92,12 +95,9 @@ declare module "@clerc/core" {
9295
}
9396
}
9497

95-
// 在命令中使用
96-
.on("my-command", (ctx) => {
97-
ctx.store.help.addGroup({
98-
commands: [["custom", "自定义命令"]],
99-
});
100-
})
98+
cli.store.help.addGroup({
99+
commands: [["custom", "自定义命令"]],
100+
});
101101
```
102102

103103
这允许插件提供自己的存储 API,可以通过存储对象访问。

0 commit comments

Comments
 (0)