MoonImpact: change-impact and selective regression-test planning for MoonBit modules and Vue/TypeScript projects, written in MoonBit. Also ships the moonlint convention linter.
moon build --target native
# A MoonBit module: this repository is one.
moon run cmd/impact -- plan --file impact_plan.mbt .
moon run cmd/impact -- plan --file cmd/impact/main.mbt .
# A MoonBit workspace with declared cross-module imports.
moon run cmd/impact -- plan --file shared/shared.mbt \
examples/workspace-demo
# A JS/TS project with its explicit configuration.
moon run cmd/impact -- plan --file src/fees.ts \
--config examples/impact-demo/moonimpact.json examples/impact-demo| Change | Plan | Full suite | Selected run | Wall time (cold) |
|---|---|---|---|---|
| encoding/encoding.mbt | 4 / 19 packages | 795 tests | 175 tests | 4.67s → 0.57s |
| decimal/decimal.mbt | 1 / 19 packages | 795 tests | 27 tests | 4.67s → 0.48s |
| Kind | Detection | Test unit | Runner (--run) |
|---|---|---|---|
| MoonBit module/workspace (default) | root holds moon.mod / moon.mod.json or moon.work, no --config | package | moon test <package> per selected package |
| JS/TS project | explicit --config moonimpact.json | test file | pnpm exec vitest run with ./test-path filters |
| Strategy | Meaning |
|---|---|
| related | selected test files or packages have a known dependency chain to the change |
| full | the model cannot narrow the change safely, so the full Vitest suite or unfiltered moon test is requested |
| none | no changes, or no affected test files or packages with tests under the supported model |
| blocked | an I/O or unsafe-path condition prevents execution |
moon build --target native
BIN="$PWD/_build/native/debug/build/cmd/impact/impact.exe"
# The public subject project, pinned at commit 6b67e08:
git clone https://github.com/moonbitlang/x /tmp/x-checkout
git -C /tmp/x-checkout checkout 6b67e08
# Full suite in the subject project, then the selected subset through the tool.
( cd /tmp/x-checkout && moon test )
"$BIN" plan --file encoding/encoding.mbt --run /tmp/x-checkout| Record | Subject | What it establishes |
|---|---|---|
| Initial MoonImpact verification | initial MVP | the JS/TS impact MVP on a first evaluation project |
| Round two | MVP, extended | static readers, symbolic paths and stylesheet inputs |
| Round three | wot-lynx-ui (JS/TS) | whole-tree membership, declaration contract, real-project selective execution |
| Round four | moonbitlang/x (MoonBit) | the MoonBit front end and its planning measurements |
| Round five | moonbitlang/x (MoonBit) | end-to-end selective execution and fault injection on a pinned commit |
# Clone and build
git clone https://github.com/ximo-156/wot-lynx-ui-moonbit
cd wot-lynx-ui-moonbit
moon build --target native# Create a MoonBit starter config in the current directory
moon run cmd/main -- --init
# Lint a MoonBit package with the built-in preset
moon run cmd/main -- --preset moonbit packages/
# Lint with the generated config
moon run cmd/main -- .
# Lint a specific directory
moon run cmd/main -- /path/to/project
# Use a custom config
moon run cmd/main -- --config my-rules.json /path/to/project
# Summary mode
moon run cmd/main -- --summary /path/to/project
# Only show errors
moon run cmd/main -- --errors-only /path/to/project
# Generate a baseline (exempts all current findings)
moon run cmd/main -- --update-baseline /path/to/project
# Use a baseline
moon run cmd/main -- --baseline moonlint.baseline.json /path/to/project
# Machine-readable JSON report on stdout, and written to a file
moon run cmd/main -- --format json /path/to/project
moon run cmd/main -- --report moonlint-report.json /path/to/project
# GitHub Actions annotations
moon run cmd/main -- --format github /path/to/project
# Cross-file import checks for a JS/TS compatibility scan
moon run cmd/main -- --preset imports /path/to/project
# Fast repeated scans: only changed files are re-linted
moon run cmd/main -- --incremental /path/to/project# List available presets
moon run cmd/main -- --list-presets
# Lint MoonBit sources
moon run cmd/main -- --preset moonbit packages/
# Lint a React project
moon run cmd/main -- --preset react /path/to/project
# Lint a Vue project
moon run cmd/main -- --preset vue /path/to/project
# Combine presets (e.g. React + common hygiene)
moon run cmd/main -- --preset react --preset common /path/to/project| Preset | Extensions | Rules | Focus |
|---|---|---|---|
| moonbit | .mbt | 6 structural rules | MoonBit: require-public-doc, naming, no-unwrap, no-panic, no-println, no-todo-comment |
| common | .js .jsx .ts .tsx .mjs .cjs .vue .svelte .astro | 6 | Framework-agnostic hygiene: no-console-log, no-debugger, no-alert, no-eval, no-var, no-todo-comment |
| react | .jsx .tsx | 20 | React/JSX: no-danger, no-string-refs, jsx-key, self-closing, target-blank, button-type, ... |
| vue | .vue .js .ts | 11 | Vue 3: no-v-html, require-v-for-key, no-v-if-with-v-for, require-scoped-style, ... |
| angular | .ts | 9 | Angular: no-input-rename, no-output-native, no-forward-ref, relative-url-prefix, ... |
| svelte | .svelte | 8 | Svelte: no-at-html, require-each-key, a11y-missing-attribute, no-goto-without-base, ... |
| next | .jsx .tsx .js .ts | 7 | Next.js: no-img-element, no-head-element, no-html-link-for-pages, google-font-display, ... |
| solid | .jsx .tsx | 6 | SolidJS: no-innerhtml, prefer-for, no-react-imports, event-directives, ... |
| astro | .astro | 5 | Astro: no-set-html-directive, prefer-class-list, no-unused-define-vars, ... |
| nuxt | .vue .js .ts | 5 | Nuxt: no-env-in-runtime, prefer-use-fetch, no-window-in-ssr, ... |
| file | .js .jsx .ts .tsx .mjs .cjs .vue .svelte .astro | 6 file rules | File-level: max-lines, max-line-length, no-trailing-whitespace, no-tabs, final-newline, no-duplicate-lines |
| imports | .js .jsx .ts .tsx .mjs .cjs .mts .cts .vue .svelte .astro | 7 structural rules | Cross-file: no-unused-imports, no-duplicate-imports, no-unresolved-relative-imports, no-import-cycles, no-deep-relative-imports, no-require-imports, no-unused-exports |
moon run cmd/main -- --config presets/react.json /path/to/projectNote: The framework presets are line-oriented — they match one source line at a time, after comments have been blanked out. Rules that need an AST (unused variables, hook dependencies, prop types) are intentionally absent from those presets; the imports preset instead uses best-effort cross-file import analysis (see Cross-File Structural Rules). The moonbit preset goes through a declaration scanner instead of the JS/TS parser; it reads non-empty documentation and top-level items, and it skips *_test.mbt / *_wbtest.mbt because tests may unwrap, panic and print.
{
"id": "common/no-unguarded-console",
"severity": "warning",
"message": "console.log without a lint exemption",
"extensions": [".ts"],
"match_comments": true,
"match": {
"all": [
{ "contains": "console.log" },
{ "not": { "any": [ { "word": "allow" }, { "contains": "moonlint-ok" } ] } }
]
}
}{
"id": "common/no-todo-comment",
"severity": "warning",
"message": "TODO/FIXME comment left in code",
"extensions": [".ts"],
"match": { "any": [ { "word": "TODO" }, { "word": "FIXME" } ] },
"match_comments": true
}{
"id": "react/jsx-no-target-blank",
"severity": "warning",
"message": "target=\"_blank\" without rel=\"noopener\" is a security risk",
"extensions": [".jsx", ".tsx"],
"match": { "regex": "target=\"_blank\"" },
"unless": { "regex": "noopener" },
"match_literals": true
}{
"rules": [],
"file_rules": [
{
"id": "file/max-lines",
"severity": "warning",
"message": "File exceeds 500 lines",
"extensions": [".ts", ".tsx"],
"check": { "max_lines": 500 }
},
{
"id": "file/no-trailing-whitespace",
"severity": "warning",
"message": "Trailing whitespace found",
"extensions": [],
"check": { "no_trailing_whitespace": true }
},
{
"id": "file/naming",
"severity": "warning",
"message": "File name must be kebab-case",
"extensions": [".ts"],
"check": { "file_naming": "kebab-case" }
}
]
}| Check | JSON | Description |
|---|---|---|
| max_lines | { "max_lines": 500 } | File must not exceed N lines |
| max_line_length | { "max_line_length": 120 } | No line may exceed N characters |
| no_trailing_whitespace | { "no_trailing_whitespace": true } | No trailing whitespace on any line |
| no_tabs | { "no_tabs": true } | No tab characters |
| final_newline | { "final_newline": true } | File must end with a newline |
| no_duplicate_lines | { "no_duplicate_lines": true } or { "no_duplicate_lines": 40 } | No repeated line of at least N trimmed characters (default 24; 0 compares any non-empty line) |
| file_naming | { "file_naming": "kebab-case" } | File name must follow a convention (camelCase, PascalCase, snake_case, kebab-case) |
| max_file_size | { "max_file_size": 10000 } | File must not exceed N bytes |
| no_empty_files | { "no_empty_files": true } | File must not be empty |
| line_ending | { "line_ending": "lf" } | File must use consistent line endings (lf or crlf) |
| no_bom | { "no_bom": true } | File must not start with a UTF-8 BOM |
{
"rules": [],
"structural_rules": [
{
"id": "imports/no-unused-imports",
"severity": "error",
"message": "Imported binding is never used",
"extensions": [".ts", ".tsx"],
"check": { "no_unused_imports": true }
},
{
"id": "imports/no-import-cycles",
"severity": "error",
"message": "Import cycle detected",
"extensions": [],
"check": { "no_import_cycles": true }
}
]
}| Check | JSON | Description |
|---|---|---|
| no_unused_imports | { "no_unused_imports": true } | An imported binding is never referenced in the importing file |
| no_duplicate_imports | { "no_duplicate_imports": true } | The same module is imported by more than one import statement |
| no_unresolved_relative_imports | { "no_unresolved_relative_imports": true } | A relative import cannot be resolved in the supplied project/context membership |
| no_import_cycles | { "no_import_cycles": true } | The file takes part in a cycle of relative imports (reported per file) |
| no_default_export | { "no_default_export": true } | export default is used |
| no_deep_relative_imports | { "no_deep_relative_imports": 2 } | A relative import climbs more than N directories with ../ |
| no_require_imports | { "no_require_imports": true } | require() is used in an ES module codebase |
| no_unused_exports | { "no_unused_exports": true } | An exported name is never imported by the available project/context files (ambient .d.ts files are exempt) |
{
"aliases": { "@": "src", "~": "." },
"structural_rules": [
{ "id": "imports/no-unused-exports", "severity": "warning", "message": "dead export", "extensions": [], "check": { "no_unused_exports": true } }
]
}// moonlint-disable-next-line
const x = 1; // this line is not linted
// moonlint-disable-next-line no-console-log
console.log('debug'); // only no-console-log is suppressed here
// moonlint-disable
// everything below is not linted
const y = 2;
// moonlint-enable
// linting resumes here
const z = 3;{
"extends": "presets/react.json",
"rules": [
{ "id": "custom/no-foo", "message": "...", "match": { "contains": "foo" } }
]
}# Fix trailing whitespace and missing final newlines
moonlint --preset file --fix /path/to/project
# Additionally normalise tabs to 4 spaces (opt-in)
moonlint --preset file --fix --fix-tab-width 4 /path/to/project
# Show what would change without writing anything
moonlint --preset file --fix --dry-run /path/to/project| Behaviour | Detail |
|---|---|
| Scope-aware | A rule's include/exclude and extensions are honoured, so excluded trees (e.g. vendor/**) are never written |
| Line-ending preserving | final_newline appends \r\n to a CRLF file, never a bare \n |
| Tab opt-in | Tabs change indentation width and can alter semantics (Python, YAML, Makefiles), so no_tabs is only fixed with an explicit --fix-tab-width |
| Safe target / atomic writes | Reject symlink targets/ancestors, reread before replacement and refuse an observed content change; this is not a filesystem compare-and-swap transaction |
| stderr messages | Progress goes to stderr, keeping --format json/sarif stdout parseable |
| Working tree only | --fix is rejected together with --changed/--staged, which read Git blobs rather than the working tree |
| Dry run | --dry-run reports would fix <file> and writes nothing; findings are reported as they still are, since the tree is unchanged |
# Create a starter config
moonlint --init
# Lint MoonBit sources
moonlint --preset moonbit packages/
# Lint with a framework preset
moonlint --preset react /path/to/project
# Run cross-file import analysis
moonlint --preset imports /path/to/project
# Auto-fix and re-lint
moonlint --preset file --fix /path/to/project
# See every layer fire at once on the shipped demos
moonlint --config examples/demo/moonlint.json examples/demo/src
moonlint --preset moonbit examples/moonbit-demo/src# Only scan files changed since a git ref (ideal for CI)
moon run cmd/main -- --changed origin/main /path/to/project
# Only scan staged files (ideal for pre-commit hooks)
moon run cmd/main -- --staged /path/to/project
# Only scan files matching a glob pattern
moon run cmd/main -- --glob "src/**/*.ts" /path/to/project
# Read file paths from stdin, one per line
git diff --name-only | moon run cmd/main -- --stdin /path/to/project
(cd examples/package-policy-demo && moon tree --package --json --target native > graph.native.json)
moonlint --package-graph examples/package-policy-demo/graph.native.json \
--config examples/package-policy-demo/policy.json --format json
# Expected exit 1: the acyclic domain -> ui edge violates the team rule.# First generate each interface with the intended compiler/backend.
moon info
moonlint --api-snapshot pkg.generated.mbti \
--api-toolchain "moon 0.1.20261102; moonc v0.10.19+bee578715" \
--api-backend native --api-module-version 0.3.0 > api.snapshot.json
moonlint --api-check before.snapshot.json after.snapshot.json --format sarif
# Opt in to an intentional breaking 0.x minor / stable major release:
moonlint --api-check before.snapshot.json after.snapshot.json --api-version-policy semvermoonlint --preset moonbit --update-baseline --baseline-format v2 \
--baseline debt.json --baseline-reason "existing review debt" \
--baseline-owner "package-maintainer" --baseline-expires 2026-12-31 .
moonlint --preset moonbit --baseline debt.json .
moonlint --preset moonbit --baseline debt.json --changed origin/main .
# Full-tree audit, with reproducible UTC-date override if needed:
moonlint --preset moonbit --audit-baseline --baseline debt.json \
--baseline-today 2026-11-04 --format json .
# Convert only still-matching old exemptions, not newly introduced errors:
moonlint --preset moonbit --migrate-baseline --baseline legacy.json \
--baseline-reason "reviewed legacy debt" --baseline-owner "package-maintainer" .# First run populates .moonlint-cache.json; later runs reuse unchanged files
moon run cmd/main -- --incremental /path/to/project
# Custom cache location
moon run cmd/main -- --incremental --cache-file /tmp/moonlint.cache.json /path/to/project| Behaviour | Detail |
|---|---|
| Content-keyed | Each entry is keyed by a non-cryptographic hash of strictly decoded source (BOM/Unicode preserved); an edit, even whitespace, re-lints that file |
| Config-aware | The cache stores a fingerprint of the effective rules, file rules, structural rules and scopes; any change invalidates every entry |
| Self-healing | A missing, empty or unreadable cache starts a full scan; a non-empty cache that fails parsing or version validation also emits a warning |
| Structural-safe | Cached runs still collect project sources for cross-file checks, and refresh full dependency context under the same rules; context failures block the verdict |
| Opt-in | Without --incremental no cache file is read or written |
| Behaviour | Detail |
|---|---|
| Content-keyed models | A model is reused only when its stored hash equals the source being scanned |
| Rule-independent | Models are reused across rule changes; only cross-file findings are re-derived |
| Parser generation | A model written by an older parser (model_version) is dropped, so a front-end fix is never masked by a stale parse |
| Bounded | Only files in the current selection keep an entry; a deleted file leaves no model behind |
| Verdict identity | The cached structural verdict is keyed by the rule fingerprint plus every participating file's digest, so any edit invalidates it |
| No snippets stored | Cached structural findings omit snippets (a minified line can be larger than the cache); they are re-derived from the scanned source, so reports stay byte-identical |
| Pattern | Matches |
|---|---|
| * | Any characters except / |
| ** | Any characters including / |
| ? | Any single character except / |
| Literal | Exact match |
{
"rules": [
{
"id": "vue/import-from-vue",
"severity": "error",
"message": "Must import from 'vue-lynx', not 'vue'",
"extensions": [".vue", ".ts"],
"match_literals": true,
"match": { "regex": "from[[:space:]]+['\"]vue['\"]" },
"unless": { "regex": "from[[:space:]]+['\"]vue-lynx['\"]" }
}
]
}| Field | Type | Description |
|---|---|---|
| id | string | Stable identifier, e.g. vue/import-from-vue |
| severity | string | "error" or "warning" (default: "warning") |
| message | string | Human-readable explanation |
| extensions | string[] | File extensions to check (empty = all files) |
| match | object | Primary matcher (see below) |
| unless | object | Optional negative guard |
| match_comments | bool | Match the raw view (comments included). Default false |
| match_literals | bool | Match the literal view (string/template/regex contents intact). Default false; ignored when match_comments is set |
| include | string[] | Optional paths this rule applies to |
| exclude | string[] | Optional paths this rule never applies to |
{
"include": ["src/**", "app/**"],
"exclude": ["**/*.generated.ts", "src/vendor"],
"rules": [
{
"id": "vue/import-from-vue",
"include": ["src/components/**"],
"exclude": ["**/*.test.ts"],
"message": "…",
"match": { "regex": "…" }
}
]
}Note: MoonBit's regex engine supports POSIX character classes ([[:space:]], [[:digit:]], [[:alpha:]]) but not Perl-style escapes (\d, \w, \s).
src/app.ts:12: [error] vue/import-from-vue — Must import from 'vue-lynx', not 'vue'
import { createApp } from 'vue'{
"tool": "moonlint",
"version": 1,
"scan": {
"mode": "tree",
"root": "/repo",
"extensions": [".ts", ".vue"],
"files_selected": 12,
"files_scanned": 10,
"files_skipped": 1,
"files_failed": 1,
"files_out_of_scope": 3,
"context_files_scanned": 2,
"context_files_failed": 0,
"source_snapshot": "working-tree",
"baseline_suppressed": 0,
"skipped_files": [{ "file": "docs/notes.md", "reason": "no-applicable-rule" }]
},
"counts": { "findings": 1, "errors": 1, "warnings": 0 },
"findings": [
{
"rule_id": "vue/import-from-vue",
"severity": "error",
"message": "Must import from 'vue-lynx', not 'vue'",
"file": "src/app.ts",
"line": 12,
"column": 22,
"snippet": "import { createApp } from 'vue'"
}
],
"diagnostics": [{ "file": "src/broken.ts", "message": "source is not valid UTF-8" }]
}::error file=src/app.ts,line=12,col=22,title=vue/import-from-vue::Must import from 'vue-lynx', not 'vue'
::error file=src/broken.ts,title=moonlint/scan-failed::source is not valid UTF-8
::notice file=docs/notes.md,title=moonlint/skipped::no-applicable-rule
::notice title=moonlint::files selected: 12, scanned: 10, skipped: 1, failed: 1, …repo root/
├── cmd/impact/ — MoonImpact CLI entry point
├── cmd/main/ — moonlint CLI entry point
├── impact_types.mbt — plan/config/edge/issue/trace types
├── impact_config.mbt — strict inert MoonImpact JSON configuration
├── impact_moonbit.mbt — MoonBit front end: module discovery, moon.pkg import
│ parsing (`import`, `test-import`, `#cfg` blocks),
│ ownership, package graph, strategies
├── impact_dependencies.mbt — JS/TS/Vue reference extraction: imports, file
│ reads, directory reads, existence checks, glob imports
├── impact_styles.mbt — CSS/SCSS reference scanner (imports, Sass modules, urls)
├── impact_style_resolution.mbt — stylesheet candidate resolution, load paths
├── impact_plan.mbt — plan construction: membership, reference resolution,
│ reverse BFS, strategies, declaration contracts
├── impact_report.mbt — text/JSON/script-free HTML plan rendering
├── impact_native.mbt — native bridge for Git input, runner execution, reports
├── impact_native.c — process-group execution, atomic create-only report write
├── git.mbt — native filesystem/Git bridge (fixed argv, no shell)
├── git_native.c — lstat, Git (merge-base/changed/staged/blob), atomic write
├── scanner.mbt — file walking, line splitting, source reading
├── scope.mbt — include/exclude glob scopes
├── scan.mbt — scan modes, glob matching, file selection
├── types.mbt — Severity, MatchKind (leaves + all/any/not), Rule,
│ Finding, FileRule, StructuralRule, LintResult, ScanInfo
├── matcher.mbt — MatchKind evaluation; `prepare()` compiles each regex
│ once per rule, not per line, and pre-compiles nested
│ combinators depth-first
├── comment.mbt — comment blanking: JS/TS mode (template literals,
│ interpolations, strings, regex) and plain mode
├── lex.mbt — JS/TS tokenizer: strings, template literals with ${}
│ interpolation, regex literals, comments, identifiers
├── parse.mbt — structured parser: import/export statements, bindings,
│ usage positions, relative specifiers
├── analysis.mbt — cross-file engine: project index, import resolution,
│ import graph, and the 8 structural checks
├── moonbit_lang.mbt — MoonBit declaration scanner: comment/string blanking,
│ top-level items, ///| attachment, public-doc and naming
├── engine.mbt — rule application, scope filtering, scan accounting,
│ structural pass and incremental-cache plumbing
├── cache.mbt — incremental cache: content hashes, config fingerprint,
│ JSON render/parse (strict; corrupt input degrades to
│ a full scan)
├── config.mbt — JSON config parsing, validation, and extends
├── presets.mbt — built-in presets (common, react, vue, angular, svelte,
│ next, solid, astro, nuxt, file, imports, moonbit)
├── presets/ — standalone JSON copies of each preset for customization
├── disable.mbt — inline disable comment parsing (// moonlint-disable)
├── baseline.mbt — hash-based finding exemption
├── report.mbt — detail and summary rendering
├── report_json.mbt — JSON report
├── report_github.mbt — GitHub Actions annotations
├── report_sarif.mbt — SARIF 2.1.0 report
├── tests/ — dependency-free CLI integration tests
└── examples/ — TS and MoonBit demos with hand-verified reportsmoon check --target native
moon test --target native
moon build --target native
python3 tests/integration.py \
--binary "$PWD/_build/native/debug/build/cmd/main/main.exe" --phase all
python3 tests/impact_integration.py \
--binary "$PWD/_build/native/debug/build/cmd/impact/impact.exe"
python3 tests/impact_native.py
moon info && moon fmt
# Review generated interface/source diffs, then rerun affected gates.pub(all) suberror ConfigError {
ConfigError(String)
}#deprecated("`NativeError::to_repr` is deprecated, use `@moonbitlang/core/debug.Debug::to_repr` instead.")
fn NativeError::to_repr(NativeError) -> Reprpub struct BaselineV2 {
// private fields
}fn BaselineV2::capture(findings : Array[Finding], reason : String, owner : String, expires : String?) -> Result[BaselineV2, ConfigError]fn BaselineV2::partition(self : BaselineV2, findings : Array[Finding], today : String) -> Result[(Array[Finding], Array[Finding], PolicyReport), ConfigError]pub struct Cache {
version : Int
fingerprint : String
files : Map[String, CacheEntry]
models : Map[String, ModelEntry]
structural : StructuralCache?
} derive(Debug)pub enum FileCheck {
MaxLines(Int)
MaxLineLength(Int)
NoTrailingWhitespace
NoTabs
FinalNewline
NoDuplicateLines(Int)
FileNaming(NamingStyle)
MaxFileSize(Int)
NoEmptyFiles
LineEnding(LineEndingStyle)
NoBom
} derive(Eq, Debug)pub struct FileModel {
imports : Array[ImportSpec]
exports : Array[ExportSpec]
decls : Array[Decl]
used : Array[UsedIdent]
} derive(Debug)pub struct ImpactConfig {
includes : Array[String]
excludes : Array[String]
tests : Array[String]
aliases : Array[(String, String)]
file_readers : Array[String]
dependencies : Array[ImpactEdge]
global_inputs : Array[String]
style_load_paths : Array[String]
skip_dirs : Array[String]
runner_dir : String
max_source_bytes : Int
} derive(Debug)pub struct ImpactEdge {
dependency : String
dependent : String
kind : String
line : Int
column : Int
} derive(Debug)pub struct ImpactPlan {
root : String
input : String
changed : Array[String]
strategy : String
tests : Array[String]
inventory : Array[String]
affected : Array[String]
traces : Array[ImpactTrace]
issues : Array[ImpactIssue]
reasons : Array[String]
source_count : Int
edge_count : Int
mode : String
} derive(Debug)pub struct ImpactTrace {
test_file : String
changed : String
chain : Array[ImpactEdge]
} derive(Debug)pub struct ImportSpec {
kind : ImportKind
source : String
names : Array[ImportName]
line : Int
column : Int
type_only : Bool
} derive(Debug)pub struct LintResult {
findings : Array[Finding]
files_selected : Int
files_scanned : Int
files_skipped : Int
files_failed : Int
files_out_of_scope : Int
context_files_scanned : Int
context_files_failed : Int
source_snapshot : String?
baseline_hits : Int
diagnostics : Array[Diagnostic]
skipped_files : Array[SkippedFile]
} derive(Debug)fn LintResult::new(findings : Array[Finding], files_scanned : Int, baseline_hits : Int) -> LintResultfn LintResult::with_findings(self : LintResult, findings : Array[Finding], baseline_hits : Int) -> LintResultpub struct PolicyReport {
mode : String
metadata : Map[String, String]
counts : Map[String, Int]
issues : Array[PolicyIssue]
} derive(Debug)pub struct ProjectIndex {
files : Array[ProjectFile]
paths : Set[String]
aliases : Array[(String, String)]
} derive(Debug)pub struct StructuralRule {
id : String
severity : Severity
message : String
extensions : Array[String]
check : StructuralCheck
scope : Scope
} derive(Debug)fn build_impact_plan(root : String, sources : Array[(String, String)], paths : Array[String], changes : Array[String], config : ImpactConfig, input : String, observations : Array[ImpactIssue]) -> ImpactPlan raisefn check_api_snapshots(before_src : String, after_src : String, version_policy : String) -> Result[PolicyReport, ConfigError]fn check_package_graph(src : String, rules : Array[PackagePolicyRule]) -> Result[PolicyReport, ConfigError]fn content_hash(source : String) -> Stringfn error_message(error : Error) -> Stringfn fix_moonbit_whitespace(source : String, trailing : Bool, tab_width : Int?, final_newline : Bool) -> String raisefn glob_pattern_error(pattern : String) -> String?fn impact_has_moonbit_module(root : String) -> Boolfn impact_moonbit_plan(root : String, changed : Array[String], input : String, observations : Array[ImpactIssue]) -> ImpactPlan raisefn impact_plan(root : String, changed : Array[String], config : ImpactConfig, input : String, observations : Array[ImpactIssue]) -> ImpactPlan raisefn impact_run_moon_test_full(root : String, timeout_ms : Int) -> Int raisefn impact_run_vitest(root : String, tests : Array[String], full : Bool, timeout_ms : Int) -> Int raisefn impact_write_report_new(path : String, content : String) -> Unit raisefn is_relative(specifier : String) -> Boolfn lint_files(root : String, files : Array[String], rules : Array[Rule], file_rules : Array[FileRule], structural_rules : Array[StructuralRule], scope : Scope) -> LintResult raisefn lint_files_with(root : String, files : Array[String], rules : Array[Rule], file_rules : Array[FileRule], structural_rules : Array[StructuralRule], scope : Scope, aliases : Array[(String, String)]) -> LintResult raisefn lint_selected(root : String, mode : ScanMode, files : Array[String], rules : Array[Rule], file_rules : Array[FileRule], structural_rules : Array[StructuralRule], scope : Scope) -> LintResult raisefn lint_tree(root : String, rules : Array[Rule], file_rules : Array[FileRule], structural_rules : Array[StructuralRule], exts : Array[String], scope : Scope) -> Result[LintResult, Error]fn make_api_snapshot(interface_text : String, toolchain : String, backend : String, module_version : String) -> Result[String, ConfigError]fn read_fix_source(root : String, rel : String) -> String raisefn render_preset_list() -> Stringfn validate_fix_path(root : String, rel : String) -> Unit raisefn validate_glob(pattern : String) -> Unit raisefn validate_moonbit_source(source : String) -> Unit raiseInstall
Download zipMoonImpact: change-impact and selective regression-test planning for MoonBit modules and Vue/TypeScript projects, written in MoonBit. Also ships the moonlint convention linter.