lint-staged 12.1.0 → 12.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/loadConfig.js +8 -2
- package/package.json +1 -1
package/lib/loadConfig.js
CHANGED
|
@@ -57,7 +57,13 @@ const resolveConfig = (configPath) => {
|
|
|
57
57
|
/**
|
|
58
58
|
* @param {string} [configPath]
|
|
59
59
|
*/
|
|
60
|
-
export const loadConfig = (configPath) => {
|
|
60
|
+
export const loadConfig = async (configPath) => {
|
|
61
61
|
const explorer = lilconfig('lint-staged', { searchPlaces, loaders })
|
|
62
|
-
|
|
62
|
+
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 }
|
|
63
69
|
}
|