We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
1 parent dc79216 commit e96b6d9Copy full SHA for e96b6d9
lib/loadConfig.js
@@ -57,7 +57,13 @@ const resolveConfig = (configPath) => {
57
/**
58
* @param {string} [configPath]
59
*/
60
-export const loadConfig = (configPath) => {
+export const loadConfig = async (configPath) => {
61
const explorer = lilconfig('lint-staged', { searchPlaces, loaders })
62
- return configPath ? explorer.load(resolveConfig(configPath)) : explorer.search()
+ const result = await (configPath ? explorer.load(resolveConfig(configPath)) : explorer.search())
63
+ if (!result) return null
64
+
65
+ const { config, filepath } = result
66
67
+ // config is a promise when using the `dynamicImport` loader
68
+ return { config: await config, filepath }
69
}
0 commit comments