Skip to content

Commit

Permalink
Merge pull request #1235 from intuit/auto-rc-js
Browse files Browse the repository at this point in the history
allow more rc file types
  • Loading branch information
hipstersmoothie authored May 19, 2020
2 parents 09c2099 + af4f2e4 commit 26a90c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
11 changes: 6 additions & 5 deletions docs/pages/autorc.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# `auto` RC File

`auto` uses [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) to find your config. This means you can define this file a variety of ways. Our `cosmiconfig` setup is custom and will start at the root of your project and start to search up the directory tree for the following:
`auto` uses [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) to find your config.
This means you can define this file a variety of ways.
`cosmiconfig` will start at the root of your project and start to search up the directory tree for the following:

- a JSON or YAML, extension-less "rc file"
- an "rc file" with the extensions `.json`, `.yaml`, or `.yml`
- a package.json property

`auto` does not support writing configuration files in JavaScript.
- a JSON or YAML, extension-less "rc file"
- an "rc file" with the extensions `.json`, `.yaml`, `.yml`, or `.js`
- a `.config.js` CommonJS module

## Initialization

Expand Down
10 changes: 1 addition & 9 deletions packages/core/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,7 @@ export default class Config {
* load the extends property, load the plugins and start the git remote interface.
*/
async loadConfig() {
const explorer = cosmiconfig("auto", {
searchPlaces: [
`.autorc`,
`.autorc.json`,
`.autorc.yaml`,
`.autorc.yml`,
"package.json",
],
});
const explorer = cosmiconfig("auto");
const result = await explorer.search();

let rawConfig: ConfigObject = {};
Expand Down

0 comments on commit 26a90c2

Please sign in to comment.