<commit_before>const types = require('./project_types.js');
const helpers = require('./helpers');
const path = require('path');
const fs = require('fs');

module.exports = function detect(options) {
  const packageJson = helpers.getPackageJson();
  if (!packageJson) {
    return types.UNDETECTED;
  }

  if (!options.force && packageJson.devDependencies) {
    if (
      packageJson.devDependencies['@storybook/react'] ||
      packageJson.devDependencies['@storybook/react-native']
    ) {
      return types.ALREADY_HAS_STORYBOOK;
    }

    if (
      packageJson.devDependencies['@kadira/storybook'] ||
      packageJson.devDependencies['@kadira/react-native-storybook']
    ) {
      return types.UPDATE_PACKAGE_ORGANIZATIONS;
    }
  }

  if (
    !options.force &&
    packageJson.devDependencies &&
    (packageJson.devDependencies['@storybook/react'] ||
      packageJson.devDependencies['@storybook/react-native'])
  ) {
    return types.ALREADY_HAS_STORYBOOK;
  }

  if (fs.existsSync(path.resolve('.meteor'))) {
    return types.METEOR;
  }

  if (packageJson.devDependencies && packageJson.devDependencies['react-scripts']) {
    return types.REACT_SCRIPTS;
  }

  if (packageJson.devDependencies && packageJson.devDependencies.webpack) {
    return types.WEBPACK_REACT;
  }

  if (packageJson.peerDependencies && packageJson.peerDependencies.react) {
    return types.REACT_PROJECT;
  }

  if (packageJson.dependencies && packageJson.devDependencies['react-native-scripts']) {
    return types.REACT_NATIVE_SCRIPTS;
  }

  if (packageJson.dependencies && packageJson.dependencies['react-native']) {
    return types.REACT_NATIVE;
  }

  if (
    (packageJson.dependencies && packageJson.dependencies.react) ||
    (packageJson.devDependencies && packageJson.devDependencies.react)
  ) {
    return types.REACT;
  }

  return types.UNDETECTED;
};
<commit_msg>Fix typo in CLI project detection<commit_after>const types = require('./project_types.js');
const helpers = require('./helpers');
const path = require('path');
const fs = require('fs');

module.exports = function detect(options) {
  const packageJson = helpers.getPackageJson();
  if (!packageJson) {
    return types.UNDETECTED;
  }

  if (!options.force && packageJson.devDependencies) {
    if (
      packageJson.devDependencies['@storybook/react'] ||
      packageJson.devDependencies['@storybook/react-native']
    ) {
      return types.ALREADY_HAS_STORYBOOK;
    }

    if (
      packageJson.devDependencies['@kadira/storybook'] ||
      packageJson.devDependencies['@kadira/react-native-storybook']
    ) {
      return types.UPDATE_PACKAGE_ORGANIZATIONS;
    }
  }

  if (
    !options.force &&
    packageJson.devDependencies &&
    (packageJson.devDependencies['@storybook/react'] ||
      packageJson.devDependencies['@storybook/react-native'])
  ) {
    return types.ALREADY_HAS_STORYBOOK;
  }

  if (fs.existsSync(path.resolve('.meteor'))) {
    return types.METEOR;
  }

  if (packageJson.devDependencies && packageJson.devDependencies['react-scripts']) {
    return types.REACT_SCRIPTS;
  }

  if (packageJson.devDependencies && packageJson.devDependencies.webpack) {
    return types.WEBPACK_REACT;
  }

  if (packageJson.peerDependencies && packageJson.peerDependencies.react) {
    return types.REACT_PROJECT;
  }

  if (packageJson.devDependencies && packageJson.devDependencies['react-native-scripts']) {
    return types.REACT_NATIVE_SCRIPTS;
  }

  if (packageJson.dependencies && packageJson.dependencies['react-native']) {
    return types.REACT_NATIVE;
  }

  if (
    (packageJson.dependencies && packageJson.dependencies.react) ||
    (packageJson.devDependencies && packageJson.devDependencies.react)
  ) {
    return types.REACT;
  }

  return types.UNDETECTED;
};

{'fraction_non_alphanumeric': 0.13046937151949084, 'fraction_numerical': 0.0, 'mean_word_length': 3.9242819843342036, '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': '1510545', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1161, 'n_words': 165}