CodeVetter · Repo Unpack · Behavior traces
typescript-eslint/typescript-eslint
These traces follow source-level call order rather than observed executions. Configuration startup establishes shared plugin identity before ESLint parsing and rule dispatch. Typed linting adds project-service creation, file admission, and compiler lookup. Playground startup, editing, and persistence connect browser state to virtual files, lint events, and restored examples.
- Configuration startup: the package entrypoint checks TypeScript’s major version, imports pluginBase/rawPlugin, exposes their shared parser/plugin, and creates getters whose reads call getTSConfigRootDirFromStack then addCandidateTSConfigRootDir.
- Syntax-only linting: parseForESLint normalizes options and forces comments/locations/ranges/tokens → parseAndGenerateServices creates settings → getProgramAndAST uses createNoProgram → astConverter and createParserServices return structures → analyze supplies scopes.
- Typed service initialization: createParseSettings → populateProjectService validates default-project globs and initializes the cached service → createProjectService loads tsserverlibrary, constructs its host, creates ProjectService, applies cleanup throttling, and reads default compiler options.
- Typed file admission: useProgramFromProjectService updates extensions and matches allowDefaultProject → openClientFileFromProjectService opens current text, may retry a symlink path or reload stale projects, and rejects invalid admission → retrieveASTAndProgramFor obtains the language-service Program → createProjectProgram selects the AST.
- Promise diagnostic: no-floating-promises.create obtains parser services/checker → ExpressionStatement skips allowed IIFEs and unwraps chains → checkNode skips known-safe calls and calls isUnhandledPromise → context.report selects array, handler, or ordinary messages and applicable suggestions.
- Playground startup: Play renders BrowserOnly/Suspense → Playground initializes useHashState → useSandboxServices calls sandboxSingleton/loadSandbox → the loader checks the requested Monaco bundle and loads modules → the hook creates the sandbox, virtual filesystem, library files, and web linter.
- Playground edit: LoadedEditor.onDidChangeModelContent → system.writeFile → the /input watcher invokes triggerLint → linter.verify calls the virtual parser, which updates/creates the source and converts its Program AST → onLint updates Monaco markers and onParse updates AST views.
- Playground persistence: virtual-file watchers call onChange with code/eslintrc/tsconfig → updateState merges changes and skips shallow-equal updates → writeStateToLocalStorage saves preferences → writeStateToUrl encodes the example → history.replace stores the hash used by the next initialization.