Skip to content

Commit

Permalink
doc: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 1, 2023
1 parent 5b70327 commit aab7b2c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export interface AutoConfOption<T> {
export default function autoConf<T>(namespace?: string, option?: AutoConfOption<T>): {} & T;
```

**Default `searchPlaces`:**
Discover configurations in the specified directory order. When configuring a tool, you can use multiple file formats and put these in multiple places. Usually, a tool would mention this in its own README file, but by default, these are the following places, where `${moduleName}` represents the name of the tool:

Discover configurations in the specified directory order.
**Default `searchPlaces`:**

```js
[
Expand Down Expand Up @@ -106,6 +106,26 @@ Discover configurations in the specified directory order.

Configurations are loaded sequentially, and the configuration file search is terminated when a configuration file exists.


The content of these files is defined by the tool. For example, you can add a `semi` configuration value to `false` using a file called `.config/autoconfig.yml`:

```yml
semi: true
```
Additionally, you have the option to put a property named after the tool in your `package.json` file, with the contents of that property being the same as the file contents. To use the same example as above:

```js
{
"name": "your-project",
"autoconfig": {
"semi": true
}
}
```

This has the advantage that you can put the configuration of all tools (at least the ones that use `auto-config-loader`) in one file.

## Yaml loader

This is an example, the default `yaml`/`yml` does not require a loader.
Expand Down

0 comments on commit aab7b2c

Please sign in to comment.