CodeVetter · Repo Unpack · Extension points
typescript-eslint/typescript-eslint
Rules plug into an explicit registry and a typed factory API. Preset generation consumes rule metadata, while syntax support spans conversion, visitor keys, and scope visitors. Project-service hosts and RuleTester framework adapters offer controlled integration boundaries. Playground configuration and diagnostics use maps, schemas, and event callbacks rather than a server router.
- New plugin rules register in src/rules/index.ts, whose named rule map is imported into raw-plugin.ts and exposed as plugin.rules.
- The local createRule wraps ESLintUtils.RuleCreator with the repository’s rule-documentation URL; RuleCreator accepts typed metadata/options/listeners and supports withoutDocs for other consumers.
- Preset generation derives core-rule overrides from extendsBaseRule and filters requiresTypeChecking/deprecated metadata, rejecting rules that are simultaneously deprecated and recommended.
- Flat presets are factory functions receiving plugin and parser objects; adding a preset requires wiring its factory into raw-plugin’s flatConfigs map and any desired umbrella export.
- Additional AST traversal keys are statically checked against node properties and merged with eslint-visitor-keys; their arrays must follow source visitation order.
- Scope integration accepts childVisitorKeys, library, JSX, and source-type options; Referencer supplies node-specific visitors and resolves transitive library definitions through TSLibraries.
- createProjectService accepts a partial ServerHost and service options; RuleTester’s TestFramework adapter separately permits explicit afterAll, describe, and it implementations instead of globals.
- createLinter exposes rule/config maps, onLint/onParse registration, registerFile, and trigger methods; LoadedEditor derives JSON validation schemas from registered rule metadata with external schema requests disabled.