Skip to content

Commit 36d5527

Browse files
committed
fix: adapt to new cosmiconfig api
1 parent 2feb802 commit 36d5527

File tree

3 files changed

+7148
-242
lines changed

3 files changed

+7148
-242
lines changed

@commitlint/load/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"devDependencies": {
6060
"@commitlint/test": "^7.5.0",
6161
"@commitlint/utils": "^7.5.0",
62+
"alva": "^1.0.17",
6263
"ava": "0.22.0",
6364
"babel-cli": "6.26.0",
6465
"babel-preset-commitlint": "^7.5.0",

@commitlint/load/src/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ export default async (seed = {}, options = {cwd: process.cwd()}) => {
8686
};
8787

8888
async function loadConfig(cwd, configPath) {
89-
const explorer = cosmiconfig('commitlint', {
90-
searchPlaces: configPath ? [path.resolve(cwd, configPath)] : []
91-
});
89+
const explorer = cosmiconfig('commitlint');
9290

93-
const local = await explorer.load(cwd);
91+
const explicitPath = configPath ? path.join(cwd, configPath) : undefined;
92+
const explore = explicitPath ? explorer.load : explorer.search;
93+
const searchPath = explicitPath ? explicitPath : cwd;
94+
const local = await explore(searchPath);
9495

9596
if (local) {
9697
return local;

0 commit comments

Comments
 (0)