Vendor the anti-slop Oxlint plugin at tools/oxlint/anti-slop and register it in oxlint.config.ts, with Oxlint's own rule categories disabled so ESLint stays the general-purpose linter. Add scripts/anti-slop.mjs (bun run deslop) mirroring the React Doctor batch interface: next-batch, check-batch, active, release, top, file. Batch handoff directories now double as file claims shared across clones via ~/.openchamber/maintenance-claims, so concurrent maintenance batches from either pipeline never select the same file. Harden both scheduled maintenance flows: stop on a dirty worktree, stop on NO BATCH AVAILABLE, validate per package instead of workspace-wide, and pin react-doctor to 0.9.12. The anti-slop task command documents concrete good and bad fixes and forbids laundering types to satisfy a rule.
29 lines
939 B
TypeScript
29 lines
939 B
TypeScript
import { defineRule } from "@oxlint/plugins";
|
|
|
|
import { isGlobalReflectMethodCall } from "../shared/reflect-method.ts";
|
|
|
|
/** Ban Reflect.get, which bypasses ordinary property access and useful type evidence. */
|
|
export const noReflectGetRule = defineRule({
|
|
meta: {
|
|
type: "problem",
|
|
docs: {
|
|
description:
|
|
"Disallow Reflect.get; use typed property access or parse dynamic input into a domain type.",
|
|
},
|
|
messages: {
|
|
reflectGet:
|
|
"Replace `Reflect.get` with typed property access. Parse dynamic input into a named domain type before reading it.",
|
|
},
|
|
},
|
|
createOnce(context) {
|
|
return {
|
|
CallExpression(node) {
|
|
if (node.callee.type === "Super" || node.callee.type === "V8IntrinsicExpression") return;
|
|
if (isGlobalReflectMethodCall(context.sourceCode, node.callee, "get")) {
|
|
context.report({ node, messageId: "reflectGet" });
|
|
}
|
|
},
|
|
};
|
|
},
|
|
});
|