code: function getConfig(macro, filename, source) {
    if (macro.options.configName) {
      try {
        // lazy-loading it here to avoid perf issues of loading it up front.
        // No I did not measure. Yes I'm a bad person.
        // FWIW, this thing told me that cosmiconfig is 227.1 kb of minified JS
        // so that's probably significant... https://bundlephobia.com/result?p=cosmiconfig@3.1.0
        // Note that cosmiconfig will cache the babel-plugin-macros config 👍
        const explorer = require('cosmiconfig')('babel-plugin-macros', {
          searchPlaces: [
            'package.json',
            `.babel-plugin-macrosrc`,
            `.babel-plugin-macrosrc.json`,
            `.babel-plugin-macrosrc.yaml`,
            `.babel-plugin-macrosrc.yml`,
            `.babel-plugin-macrosrc.js`,
            `babel-plugin-macros.config.js`,
          ],
          packageProp: 'babelMacros',
          sync: true,
        })
        const loaded = explorer.searchSync(filename)
        if (loaded) {
          return loaded.config[macro.options.configName]
        }
      } catch (error) {
        // eslint-disable-next-line no-console
        console.error(
          `There was an error trying to load the config "${
            macro.options.configName
          }" ` +
            `for the macro imported from "${source}. ` +
            `Please see the error thrown for more information.`,
        )
        throw error
      }
    }
  }
docs: eslint-disable-next-line consistent-return