Skip to content

Commit f13bbb9

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 1de07ed + 7b62bf6 commit f13bbb9

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,25 @@ mycoder --githubMode "Work with GitHub issues and PRs"
4848

4949
## Configuration
5050

51-
MyCoder is configured using a `mycoder.config.js` file in your project root, similar to ESLint and other modern JavaScript tools. This file exports a configuration object with your preferred settings.
51+
MyCoder is configured using a configuration file in your project. MyCoder supports multiple configuration file locations and formats, similar to ESLint and other modern JavaScript tools.
52+
53+
### Configuration File Locations
54+
55+
MyCoder will look for configuration in the following locations (in order of precedence):
56+
57+
1. `mycoder.config.js` in your project root
58+
2. `.mycoder.config.js` in your project root
59+
3. `.config/mycoder.js` in your project root
60+
4. `.mycoder.rc` in your project root
61+
5. `.mycoder.rc` in your home directory
62+
6. `mycoder` field in `package.json`
63+
7. `~/.config/mycoder/config.js` (XDG standard user configuration)
64+
65+
Multiple file extensions are supported: `.js`, `.ts`, `.mjs`, `.cjs`, `.json`, `.jsonc`, `.json5`, `.yaml`, `.yml`, and `.toml`.
5266

5367
### Creating a Configuration File
5468

55-
Create a `mycoder.config.js` file in your project root:
69+
Create a configuration file in your preferred location:
5670

5771
```js
5872
// mycoder.config.js

packages/docs/docs/usage/configuration.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,21 @@ export default {
119119
};
120120
```
121121

122-
## Configuration File Location
122+
## Configuration File Locations
123123

124-
The `mycoder.config.js` file should be placed in the root directory of your project. MyCoder will automatically detect and use this file when run from within the project directory or any of its subdirectories.
124+
MyCoder uses the [c12](https://github.com/unjs/c12) library to load configuration files, which supports multiple file locations and formats. Configuration files are searched in the following order:
125+
126+
1. `mycoder.config.js` (or other supported extensions) in the project root directory
127+
2. `.mycoder.config.js` (or other supported extensions) in the project root directory
128+
3. `.config/mycoder.js` (or other supported extensions) in the project root directory
129+
4. `.mycoder.rc` in the project root directory
130+
5. `.mycoder.rc` in the user's home directory (global configuration)
131+
6. Configuration from the `mycoder` field in `package.json`
132+
7. `~/.config/mycoder/config.js` (XDG standard user configuration)
133+
134+
Supported file extensions include `.js`, `.ts`, `.mjs`, `.cjs`, `.json`, `.jsonc`, `.json5`, `.yaml`, `.yml`, and `.toml`.
135+
136+
MyCoder will automatically detect and use these configuration files when run from within the project directory or any of its subdirectories.
125137

126138
## Overriding Configuration
127139

0 commit comments

Comments
 (0)