<commit_before>/* @flow */
"use strict";

const configurationError = require("./configurationError");
const globalModules = require("global-modules");
const resolveFrom = require("resolve-from");

module.exports = function getModulePath(
  basedir /*: string*/,
  lookup /*: string*/
) /*: string*/ {
  // 1. Try to resolve from the provided directory
  // 2. Try to resolve from `process.cwd`
  // 3. Try to resolve from global `node_modules` directory
  let path = resolveFrom.silent(basedir, lookup);

  if (!path) {
    path = resolveFrom.silent(process.cwd(), lookup);
  }

  if (!path) {
    path = resolveFrom.silent(globalModules, lookup);
  }
  if (!path) {
    throw configurationError(
      `Could not find "${lookup}". Do you need a \`configBasedir\`?`
    );
  }

  return path;
};
<commit_msg>Fix ESLint error<commit_after>/* @flow */
"use strict";

const configurationError = require("./configurationError");
const globalModules = require("global-modules");
const resolveFrom = require("resolve-from");

module.exports = function getModulePath(
  basedir /*: string*/,
  lookup /*: string*/
) /*: string*/ {
  // 1. Try to resolve from the provided directory
  // 2. Try to resolve from `process.cwd`
  // 3. Try to resolve from global `node_modules` directory
  let path = resolveFrom.silent(basedir, lookup);

  if (!path) {
    path = resolveFrom.silent(process.cwd(), lookup);
  }

  if (!path) {
    path = resolveFrom.silent(globalModules, lookup);
  }

  if (!path) {
    throw configurationError(
      `Could not find "${lookup}". Do you need a \`configBasedir\`?`
    );
  }

  return path;
};

{'fraction_non_alphanumeric': 0.15185185185185185, 'fraction_numerical': 0.003703703703703704, 'mean_word_length': 3.477900552486188, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1849095', 'n_tokens_mistral': 510, 'n_tokens_neox': 500, 'n_words': 146}