CodeVetter · Repo Unpack · Behavior traces
eslint/eslint
The traced flows include startup, physical-file linting, stdin analysis, automatic fixing, cache reuse, and suppression persistence. Their execution order separates analysis from source writes. Configuration selection occurs before verification, and CLI suppressions occur after optional fix writes. These are source-derived walkthroughs, not observed executions.
- Startup: enableCompileCache() and optional debug initialization → main() installs fatal handlers → optional readStdin() → cli.execute() → process.exitCode assignment unless a fatal handler already set status 2.
- File action: cli.execute() constructs ESLint directly or through fromOptionsModule() → lintFiles() → findFiles() → selected single-thread/worker path → cache reconcile() → report processing.
- Single-thread verification: lintFilesWithoutMultithreading() retrieves cached configs → lintFile() checks matching config/cache → readAndVerifyFile() reads UTF-8 → verifyText() → Linter.verifyAndFix().
- Rule execution: verify() normalizes flat config → _verifyWithFlatConfigArray() selects a matching config → processor or no-processor branch → ParserService.parseSync() → runRules() → applyDisableDirectives().
- Stdin action: readStdin() accumulates UTF-8 → cli.execute() detects string input → lintText() resolves configuration by virtual filename → verifyText() generates results → printResults(); --fix is rejected for this branch.
- Fix action: verifyAndFix() repeats verify() → SourceCodeFixer.applyFixes(), stops on no fixes, bounded passes, fatal parse failure, or a two-state cycle, then re-verifies final changed text; CLI --fix subsequently calls outputFixes().
- Cache persistence: getCachedLintResults() checks file/config validity and hydrates source; cached diagnostics are reprocessed when fixing; setCachedLintResults() skips results with output; lintFiles() calls reconcile() to persist entries.
- Suppression persistence: after linting and optional outputFixes(), CLI constructs SuppressionsService → suppress()/prune() → load()/save() → applySuppressions() → counts/formatting → status 2 for unused allowances unless explicitly permitted.