Skip to main content

typed_eslint

Function typed_eslint 

Source
pub fn typed_eslint(
    cwd: &Path,
    ns_dir: &Path,
    deadline: Instant,
    cancel: &AtomicBool,
) -> bool
Expand description

Whether eslint here uses type information. FAIL-CLOSED: anything but a definite “untyped” reads as typed, which only costs the cache, where a wrong “untyped” would let a stale per-file cache prove a typed tree.

Two looks, either of which says typed:

  • the TEXT of every tracked eslint config (eslint.config.*, .eslintrc*): projectService, or parserOptions with project. This catches a block that types files by name (**/*.test.ts) that no sample would hit;
  • eslint --print-config for one tracked file per (directory, extension) pair where eslint runs, as flat configs select files — bounded by deadline, cancellable, through tree_run. A file eslint ignores (it prints undefined) answers nothing.

Untyped is remembered only when both looks are clean and at least one sampled file answered. More pairs than [MAX_TYPED_SAMPLE], a probe error, or no answer at all reads typed and remembers nothing, so a transient failure never disables the cache for good. Known gap: a shared config PACKAGE that types by file name, whose words never appear in a local config and whose files no sample hits.