Skip to content

Commit 39d3b97

Browse files
committed
docs: simplify configuration loading boundaries
1 parent ad4f4ef commit 39d3b97

2 files changed

Lines changed: 2 additions & 10 deletions

File tree

‎website/docs/en/guide/api-reference.mdx‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,7 @@ The returned object has these fields:
9898
- `filePath`: the loaded configuration file's path, or `null` if no file was found.
9999
- `dependencies`: paths to configuration dependencies collected by the loader.
100100

101-
The loader does not run tool configuration functions. When several configurations need to be merged, it may return an async function even if the original configurations were all objects. The merge runs when that function is called.
102-
103-
Your code still needs to pass the parameters each tool expects, resolve its configuration, and run the tool. Automatic test inheritance and formatting normalization do not run during loading.
104-
105-
Functions in `staged` generate tasks from file lists. They are called by lint-staged when tasks run.
101+
`loadRstackConfig()` only loads configurations; it does not run tool configuration functions. Before running a tool, the caller must resolve its configuration and initialize it.
106102

107103
`rstack/config` also exports the related types: `LoadRstackConfigOptions` for the parameters, `LoadedRstackConfig` for the return value, and `Configs` for the tool configurations.
108104

‎website/docs/zh/guide/api-reference.mdx‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,7 @@ const { configs, filePath, dependencies } = await loadRstackConfig({
9898
- `filePath`:加载的配置文件路径,未找到文件时为 `null`。
9999
- `dependencies`:加载器收集到的配置依赖路径列表。
100100

101-
加载时不会执行工具配置函数。需要合并多份配置时,返回值可能是一个异步函数,即使原始配置都是对象。调用该函数时才会执行合并。
102-
103-
调用方仍需按各工具的要求传入参数、解析配置并运行工具。测试自动继承、格式化配置标准化等步骤不会在加载时执行。
104-
105-
`staged` 中的函数用于根据文件列表生成任务,由 lint-staged 在运行时调用。
101+
`loadRstackConfig()` 仅负责加载配置,不会执行工具配置函数。调用方仍需完成相应工具的配置解析和初始化,才能运行工具。
106102

107103
`rstack/config` 还导出相关类型:`LoadRstackConfigOptions`(参数)、`LoadedRstackConfig`(返回值)和 `Configs`(工具配置)。
108104

0 commit comments

Comments
 (0)