initial commit

This commit is contained in:
pi
2026-04-10 23:11:54 +01:00
commit 54e2709828
32 changed files with 6148 additions and 0 deletions

26
src/profiles.test.ts Normal file
View File

@@ -0,0 +1,26 @@
import test from "node:test";
import assert from "node:assert/strict";
import { resolveProfileForPath } from "./profiles.ts";
test("resolveProfileForPath finds the first matching profile and nearest workspace root", () => {
const result = resolveProfileForPath(
{
defaults: {},
profiles: [
{
name: "typescript",
match: ["src/**/*.ts"],
workspaceRootMarkers: ["package.json", "tsconfig.json"],
formatter: { kind: "command", command: ["biome", "format", "--write", "{file}"] },
diagnostics: [],
},
],
},
"/repo/src/app.ts",
"/repo",
["/repo/package.json", "/repo/src/app.ts"],
);
assert.equal(result?.profile.name, "typescript");
assert.equal(result?.workspaceRoot, "/repo");
});