Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## What does this PR do?
<!-- One sentence. If you can't describe it in one sentence, split. -->

## Why?
<!-- Link to issue. If no issue, explain motivation. -->

## Scope confirmation
- [ ] All changed files relate to the stated purpose
- [ ] No drive-by refactors or "while I'm here" cleanups
- [ ] No formatting changes mixed with functional changes

## New abstractions (if any)
- [ ] Each new type/interface/class has 3+ consumers or justification
- [ ] No speculative features ("we might need this later")

## New dependencies (if any)
- Package: `name`
- Justification:
47 changes: 47 additions & 0 deletions .reviews/.oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",

"plugins": ["typescript", "unicorn", "import"],

"categories": {
"correctness": "warn",
"suspicious": "warn",
"pedantic": "warn",
"style": "warn"
},

"rules": {
"eslint/no-unused-vars": ["warn", {
"args": "all",
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"ignoreRestSiblings": true
}],
"typescript/no-inferrable-types": "warn",
"typescript/no-empty-object-type": "warn",
"typescript/no-useless-empty-export": "warn",
"typescript/no-unnecessary-type-constraint": "warn",
"typescript/no-unnecessary-parameter-property-assignment": "warn",
"unicorn/no-static-only-class": "warn",
"eslint/no-empty-function": "warn",
"eslint/no-console": ["warn", { "allow": ["warn", "error"] }],
"eslint/no-debugger": "warn",

"typescript/no-unnecessary-type-arguments": "warn",
"typescript/no-unnecessary-type-assertion": "warn",
"typescript/no-redundant-type-constituents": "warn",
"typescript/no-unnecessary-boolean-literal-compare": "warn"
},

"overrides": [
{
"files": ["**/*.test.ts", "**/*.spec.ts", "**/test/**"],
"rules": {
"eslint/no-console": "off",
"eslint/no-empty-function": "off"
}
}
]
}
6 changes: 3 additions & 3 deletions .reviews/AnalyzeRepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const pr = {
};
```

<Capture as="doctorJson">
<Capture as="doctorJson" select="code[lang=json]">

<Doctor pr={pr} />

Expand All @@ -82,7 +82,7 @@ const doctor = parseDoctorResult(doctorJson);
|| doctor.recommendation === "type-aware-filtered"}>

```bash exec
OUT=$(npx oxlint --type-aware --tsconfig .reviews/tsconfig.oxlint.json --format json 2>/dev/null || true)
OUT=$(npx oxlint --config .reviews/.oxlintrc.json --type-aware --tsconfig .reviews/tsconfig.oxlint.json --format json 2>/dev/null || true)
if [ -n "$OUT" ]; then
printf '%s' "$OUT"
else
Expand All @@ -96,7 +96,7 @@ fi
&& doctor.oxlintInstalled}>

```bash exec
OUT=$(npx oxlint --format json 2>/dev/null || true)
OUT=$(npx oxlint --config .reviews/.oxlintrc.json --format json 2>/dev/null || true)
if [ -n "$OUT" ]; then
printf '%s' "$OUT"
else
Expand Down
6 changes: 3 additions & 3 deletions .reviews/AnalyzeRepoCI.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const pr = {
};
```

<Capture as="doctorJson">
<Capture as="doctorJson" select="code[lang=json]">

<Doctor pr={pr} />

Expand All @@ -78,7 +78,7 @@ const doctor = parseDoctorResult(doctorJson);
|| doctor.recommendation === "type-aware-filtered"}>

```bash exec
OUT=$(npx oxlint --type-aware --tsconfig .reviews/tsconfig.oxlint.json --format json 2>/dev/null || true)
OUT=$(npx oxlint --config .reviews/.oxlintrc.json --type-aware --tsconfig .reviews/tsconfig.oxlint.json --format json 2>/dev/null || true)
if [ -n "$OUT" ]; then
printf '%s' "$OUT"
else
Expand All @@ -92,7 +92,7 @@ fi
&& doctor.oxlintInstalled}>

```bash exec
OUT=$(npx oxlint --format json 2>/dev/null || true)
OUT=$(npx oxlint --config .reviews/.oxlintrc.json --format json 2>/dev/null || true)
if [ -n "$OUT" ]; then
printf '%s' "$OUT"
else
Expand Down
29 changes: 21 additions & 8 deletions .reviews/ReviewPR.local.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ cat > .reviews/tsconfig.oxlint.json << 'TSCONFIG'
"lib": ["ESNext", "DOM"],
"types": []
},
"include": ["packages/*/src/**/*.ts", "packages/*/*.ts"],
"include": [
"packages/*/src/**/*.ts",
"packages/*/*.ts",
"core/src/**/*.ts",
"cli/src/**/*.ts",
"durable-streams/**/*.ts",
"durable-effects/**/*.ts"
],
"exclude": ["node_modules", "dist", ".vendor", "**/*.test.ts"]
}
TSCONFIG
Expand All @@ -61,7 +68,7 @@ TSCONFIG
ollama show qwen3:30b-a3b >/dev/null 2>&1 || ollama pull qwen3:30b-a3b
```

<Capture as="doctorJson">
<Capture as="doctorJson" select="code[lang=json]">

<Doctor pr={pr} />

Expand All @@ -73,15 +80,22 @@ import { parseDoctorResult } from "@executablemd/code-review-agent";
const doctor = parseDoctorResult(doctorJson);
```

<Capture as="changedTsFiles">

```bash silent exec
git diff --name-only {BASE_SHA}...{HEAD_SHA} -- '*.ts' '*.tsx' | grep -v '\.test\.' | grep -v '\.spec\.' | grep -v '\.d\.ts$' | head -200
```

</Capture>

<Capture as="rawDiagnostics">

<Show when={doctor.recommendation === "type-aware"
|| doctor.recommendation === "type-aware-filtered"}>

```bash exec
OUT=$(npx oxlint --type-aware --tsconfig .reviews/tsconfig.oxlint.json --format json 2>/dev/null || true)
if [ -n "$OUT" ]; then
printf '%s' "$OUT"
if [ -n "{changedTsFiles}" ]; then
echo "{changedTsFiles}" | tr '\n' ' ' | xargs npx oxlint --config .reviews/.oxlintrc.json --type-aware --tsconfig .reviews/tsconfig.oxlint.json --format json 2>/dev/null || true
else
echo "[]"
fi
Expand All @@ -93,9 +107,8 @@ fi
&& doctor.oxlintInstalled}>

```bash exec
OUT=$(npx oxlint --format json 2>/dev/null || true)
if [ -n "$OUT" ]; then
printf '%s' "$OUT"
if [ -n "{changedTsFiles}" ]; then
echo "{changedTsFiles}" | tr '\n' ' ' | xargs npx oxlint --config .reviews/.oxlintrc.json --format json 2>/dev/null || true
else
echo "[]"
fi
Expand Down
29 changes: 21 additions & 8 deletions .reviews/ReviewPR.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,20 @@ cat > .reviews/tsconfig.oxlint.json << 'TSCONFIG'
"lib": ["ESNext", "DOM"],
"types": []
},
"include": ["packages/*/src/**/*.ts", "packages/*/*.ts"],
"include": [
"packages/*/src/**/*.ts",
"packages/*/*.ts",
"core/src/**/*.ts",
"cli/src/**/*.ts",
"durable-streams/**/*.ts",
"durable-effects/**/*.ts"
],
"exclude": ["node_modules", "dist", ".vendor", "**/*.test.ts"]
}
TSCONFIG
```

<Capture as="doctorJson">
<Capture as="doctorJson" select="code[lang=json]">

<Doctor pr={pr} />

Expand All @@ -77,15 +84,22 @@ import { parseDoctorResult } from "@executablemd/code-review-agent";
const doctor = parseDoctorResult(doctorJson);
```

<Capture as="changedTsFiles">

```bash silent exec
git diff --name-only {BASE_SHA}...{HEAD_SHA} -- '*.ts' '*.tsx' | grep -v '\.test\.' | grep -v '\.spec\.' | grep -v '\.d\.ts$' | head -200
```

</Capture>

<Capture as="rawDiagnostics">

<Show when={doctor.recommendation === "type-aware"
|| doctor.recommendation === "type-aware-filtered"}>

```bash exec
OUT=$(npx oxlint --type-aware --tsconfig .reviews/tsconfig.oxlint.json --format json 2>/dev/null || true)
if [ -n "$OUT" ]; then
printf '%s' "$OUT"
if [ -n "{changedTsFiles}" ]; then
echo "{changedTsFiles}" | tr '\n' ' ' | xargs npx oxlint --config .reviews/.oxlintrc.json --type-aware --tsconfig .reviews/tsconfig.oxlint.json --format json 2>/dev/null || true
else
echo "[]"
fi
Expand All @@ -97,9 +111,8 @@ fi
&& doctor.oxlintInstalled}>

```bash exec
OUT=$(npx oxlint --format json 2>/dev/null || true)
if [ -n "$OUT" ]; then
printf '%s' "$OUT"
if [ -n "{changedTsFiles}" ]; then
echo "{changedTsFiles}" | tr '\n' ' ' | xargs npx oxlint --config .reviews/.oxlintrc.json --format json 2>/dev/null || true
else
echo "[]"
fi
Expand Down
10 changes: 8 additions & 2 deletions .reviews/components/Doctor.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ inputs:
default: ".reviews/tsconfig.oxlint.json"
---

Checking environment for Oxlint static analysis...

<Capture as="oxlintVersion">

```bash exec
Expand Down Expand Up @@ -50,6 +52,8 @@ const canProbeTypeAware = oxlintInstalled && tsgolintInstalled
&& nodeModulesExists && tsconfigExists;
```

Scanning source files for scheme specifiers (jsr:, npm:)...

<Capture as="specifierScan">

```bash exec
Expand All @@ -73,13 +77,15 @@ const jsrCount = specifierLines.filter(l => l.includes("jsr:")).length;
const npmCount = specifierLines.filter(l => l.includes("npm:")).length;
```

Running type-aware probe to test Oxlint compatibility...

<Capture as="probeResult">

<Show when={canProbeTypeAware}
fallback='{"diagnostics":[],"stderr":""}'>

```bash exec
RESULT=$(npx oxlint --type-aware --tsconfig {tsconfigPath} --format json 2>.reviews/probe-stderr.tmp || true)
RESULT=$(npx oxlint --config .reviews/.oxlintrc.json --type-aware --tsconfig {tsconfigPath} --format json 2>.reviews/probe-stderr.tmp || true)
STDERR=$(cat .reviews/probe-stderr.tmp 2>/dev/null || echo "")
rm -f .reviews/probe-stderr.tmp
echo "{\"diagnostics\":$RESULT,\"stderr\":\"$STDERR\"}"
Expand Down Expand Up @@ -170,5 +176,5 @@ const doctor = {
},
};

return JSON.stringify(doctor);
return '```json\n' + JSON.stringify(doctor) + '\n```';
```
8 changes: 2 additions & 6 deletions .reviews/components/PrPolicyReport.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ inputs:
required: true
diagnostics:
type: object
required: false
required: true
doctor:
type: object
required: false
required: true
---

## PR #{pr.meta.number}: {pr.meta.title}
Expand All @@ -21,10 +21,6 @@ inputs:

<SlopPolicy pr={pr} diagnostics={diagnostics} />

<Show when={!!diagnostics && !!doctor}>

<OxlintSummary diagnostics={diagnostics} doctor={doctor} />

</Show>

<ExtraneousCodePolicy pr={pr} diagnostics={diagnostics} doctor={doctor} />
5 changes: 4 additions & 1 deletion .reviews/components/UnusedInDiff.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ inputs:
const declPattern = new RegExp(
`(?:${construct})\\s+(\\w+)`, "g"
);
const source = pr.added.map(l => l.content).join("\n");
const lines = pr.added.filter(l =>
l.file.endsWith(".ts") || l.file.endsWith(".tsx")
);
const source = lines.map(l => l.content).join("\n");

const names = [];
let match;
Expand Down
6 changes: 1 addition & 5 deletions .reviews/policies/BloatPolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
required: true
diagnostics:
type: object
required: false
required: true
---

<ReviewSection heading="Structural" clean="✅ No structural bloat detected.">
Expand Down Expand Up @@ -39,11 +39,7 @@ inputs:
severity="warning"
message="{count} console statements." />

<Show when={!!diagnostics && !!diagnostics.byCategory && !!diagnostics.byCategory.structural && diagnostics.byCategory.structural.length > 0}>

<OxlintSignals groups={diagnostics.byCategory.structural}
label="structural signals" />

</Show>

</ReviewSection>
Loading
Loading