Skip to content

audit --base falls back to resolver-less mode in React Native repos whose tsconfig extends ./node_modules/@react-native/typescript-config/tsconfig.json #292

@iarmankhan

Description

@iarmankhan

What happened?

fallow audit --base main appears to analyze against a temporary checkout of the base branch that does not have node_modules installed. In a React Native app whose tsconfig.json extends ./node_modules/@react-native/typescript-config/tsconfig.json, this causes a broken tsconfig chain warning and resolver fallback during audit.

In my case that fallback matters because the repo uses tsconfig path aliases heavily (@/*).

Observed warnings:

WARN node_modules directory not found. Run `npm install` / `pnpm install` first for accurate results.
WARN Broken tsconfig chain: Tsconfig not found /var/folders/.../fallow-audit-base-.../link-v2/node_modules/@react-native/typescript-config/tsconfig.json. Falling back to resolver-less resolution for affected files. Relative and bare imports still work, but tsconfig path aliases (e.g., `@/...`) will not. Fix the extends/references chain to restore alias support.

This happens even when the working tree itself has dependencies installed. The problem seems to be specifically the base-side temp checkout used by audit --base.

Why this is surprising

Issue #242 and its maintainer response on May 1, 2026 point users toward fallow audit --base "$BASE" --quiet as the preferred integrated path for hooks / gating. That makes this edge case important for React Native / Expo repos that extend tsconfig from node_modules.

Reproduction

A reduced shape that reproduces the problem:

  1. Create a JS/TS repo with:

    • tsconfig.json containing:
      {
        "$schema": "https://json.schemastore.org/tsconfig",
        "extends": "./node_modules/@react-native/typescript-config/tsconfig.json",
        "compilerOptions": {
          "baseUrl": ".",
          "paths": {
            "@/*": ["src/*"]
          }
        }
      }
    • source files that import through @/...
    • @react-native/typescript-config installed locally
  2. Ensure main contains that config.

  3. On a feature branch, run:

npx fallow audit --base main --format json
  1. Observe warnings about:
    • node_modules directory not found
    • broken tsconfig chain in a temp path like .../fallow-audit-base-.../node_modules/@react-native/typescript-config/tsconfig.json
    • fallback to resolver-less resolution, which explicitly says tsconfig path aliases will not work

What I tested locally

  • Running focused commands like fallow dead-code --changed-since main, fallow health --changed-since main, and fallow dupes --changed-since main did not surface the same temp-base warning in the same way.
  • Running fallow audit --base main consistently reproduced the warning.
  • Installing dependencies in the current working tree did not remove the warning.
  • Replacing tsconfig.json to extend a committed local base file instead of ./node_modules/... appears to avoid the structural problem, but that is a repo-level workaround rather than a clear answer about supported audit behavior.

Expected behavior

One of these, depending on intended design:

  1. fallow audit --base <ref> should preserve enough dependency/config context on the base-side analysis so that tsconfig chains extending into node_modules still resolve correctly, or
  2. the docs should explicitly call out that audit --base may fall back to resolver-less mode for repos whose tsconfig extends points into node_modules, with guidance on the recommended workaround.

Questions

  1. Is this expected behavior for audit --base today?
  2. Is there a supported way to make base-side temp analysis resolve node_modules-backed tsconfig chains correctly?
  3. For React Native / Expo repos, is the recommended path to vendor/commit the base tsconfig instead of extending from ./node_modules/... if we want reliable audit results?

Fallow version

Reproduced with 2.65.0 and 2.66.0.

Operating system

macOS

Configuration

The important part is a repo with:

  • tsconfig.json extending ./node_modules/@react-native/typescript-config/tsconfig.json
  • tsconfig path aliases like @/*
  • fallow audit --base main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions