@dry-lint/dry-lint
The core engine and registry for dry-lint.
Provides the singleton extractor registry, structural similarity algorithms, and ts-morph
project — powering all official plugins and the CLI.
You usually don’t install @dry-lint/dry-lint
directly.
It’s included automatically when you install the CLI or any official plugins.
Example:
# Example: TypeScript + Zod plugins + CLI
bun add -D @dry-lint/cli @dry-lint/typescript @dry-lint/zod
The CLI depends on @dry-lint/dry-lint
under the hood.
@dry-lint/dry-lint
exposes the core APIs:
import { registerExtractor, findDuplicates } from '@dry-lint/dry-lint';
registerExtractor((filePath, fileText) => {
// Return an array of declarations for this file
return [];
});
const groups = await findDuplicates(['src/**/*.ts'], { threshold: 0.9 });
Plugins use registerExtractor
to plug in domain-specific parsers.
The CLI and custom Node scripts use findDuplicates
to orchestrate extraction, grouping, and output.
@dry-lint/core
?@dry-lint/core
is fully merged into this package.ts-morph
project, no duplicate states.If you see any instructions to install @dry-lint/core
, just use @dry-lint/dry-lint
instead.
MIT — see LICENSE.