skif
Embeddable facade of skif, a dependency and package-manager linter for JavaScript and TypeScript monorepos (npm, pnpm, yarn and bun).
The crate discovers a workspace, runs the rules and plans fixes. It never prints, prompts, exits, reads the
environment or the working directory, or writes files: everything is read through a FileSystem (OsFs on disk, MemoryFs for editor
buffers and tests), and fixes come back as a FixPlan for the caller to show, merge or write.
use Path;
use Arc;
use ;
let fs = new
.with_file
.with_file;
let root = find_workspace_root?;
let config = load_config?;
let workspace = discover_with_fs?;
// The linter reads source files (with `js-analysis`) through the same file system as discovery.
let report = with_fs?.run?;
assert_eq!;
# Ok::
Features
| Feature | Enables |
|---|---|
manifest (default) |
The built-in manifest, workspace, version and semver group policy and catalog rules. |
fix |
apply_fixes and FixPlan (format-preserving JSON edits). |
yaml-fix |
YAML edits for pnpm-workspace.yaml (implies fix). |
report |
Human, JSON, SARIF and GitHub renderers, re-exported as skif::render. |
schema |
The JSON Schema of skif.toml, as skif::config_schema. |
js-analysis |
JavaScript and TypeScript analysis and the plugin table; Linter adds it to the built-in rules. Off by default. |
The command-line tool is the skif-cli crate. See the
repository for the rule reference and the architecture decisions.
Licensed under MIT.