Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lint-staged/lint-staged
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v12.1.0
Choose a base ref
...
head repository: lint-staged/lint-staged
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v12.1.1
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 21, 2021

  1. Copy the full SHA
    e96b6d9 View commit details
Showing with 8 additions and 2 deletions.
  1. +8 βˆ’2 lib/loadConfig.js
10 changes: 8 additions & 2 deletions lib/loadConfig.js
Original file line number Diff line number Diff line change
@@ -57,7 +57,13 @@ const resolveConfig = (configPath) => {
/**
* @param {string} [configPath]
*/
export const loadConfig = (configPath) => {
export const loadConfig = async (configPath) => {
const explorer = lilconfig('lint-staged', { searchPlaces, loaders })
return configPath ? explorer.load(resolveConfig(configPath)) : explorer.search()
const result = await (configPath ? explorer.load(resolveConfig(configPath)) : explorer.search())
if (!result) return null

const { config, filepath } = result

// config is a promise when using the `dynamicImport` loader
return { config: await config, filepath }
}