Skip to content

chore(lint): add anti-slop oxlint plugin (pinned, all rules off) - #20726

Merged
nwparker merged 4 commits into
mainfrom
nwparker/2x-lint
Sep 15, 2026
Merged

nwparker merged 4 commits into
mainfrom
nwparker/2x-lint

Conversation

@nwparker

@nwparker nwparker commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 0 0 0 0
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​124 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​120

Base PR for the anti-slop rollout. Adds the linting machinery only — no rule is enabled, so this is a no-op for CI and for every existing file.

What's here

  • Pins dmmulroy/anti-slop as a devDependency at a commit SHA: oxlint-plugin-anti-slop: github:dmmulroy/anti-slop#c44ef22.
  • config/scripts/sync-anti-slop-plugin.mjs, run from postinstall, copies the pinned package's source to .anti-slop-plugin/ (gitignored).
  • config/oxlint-anti-slop.json — every rule set to "off", wired into pnpm lint via a new audit:anti-slop script.

Why a copy step instead of loading it from node_modules

anti-slop ships raw .ts with no build step (exports: "./src/index.ts"). Node refuses to type-strip anything under node_modules:

ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING
Stripping types is currently unsupported for files under node_modules

So the package genuinely cannot be loaded from node_modules — which is why upstream's README says it is "meant to be vendored, not treated as a fixed npm dependency." Copying the source to a gitignored directory outside node_modules sidesteps the restriction while keeping a single pinned source of truth. Upgrading is a SHA bump, not a re-vendor and three-way merge.

The generated directory sits at the repo root, outside the src config tests mobile lint paths, so no ignore-pattern plumbing is needed.

Verified the pinned plugin produces byte-identical rule output to a vendored copy across all 16 rules that fire.

Do not install oxlint-plugin-anti-slop from npm

That name is squatted. The npm package is version 0.0.0, 62 bytes, one file, no repository, no license, published 2026-08-12 by an unrelated account. It is not upstream's code. The git pin above is the only correct source. (oxlint-plugin-deslop, which deslop's README tells you to install, does not exist on npm at all.)

Rollout

Each follow-up PR fixes exactly one rule's violations and flips that single rule off → error, so each is independently green and reviewable. Baseline with all 18 rules on: 357,447 violations.

Scoping decision

Type-evidence rules are enforced in both production and test code — a fixture built with as unknown as is exactly where a test quietly stops matching the real type. no-module-mocking is the exception: it encodes a dependency-injection architecture rather than type evidence, and its 12,606 test hits across 3,185 files would mean re-architecting the suite, not cleaning it. It is off for tests via an override and enforced on the 73 production hits only.

maharshi365/deslop was evaluated and dropped. It is not on npm either, so it would need a second git pin and copy step, and it is a 5-star single-maintainer repo that is itself a re-namespaced copy of anti-slop. One upstream is enough.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

The vendored plugin is not excluded from the type-aware code-quality config, so pnpm lint and the PR CI step "Enforce type-aware code-quality baseline" now fail on it — this is not the no-op for CI the description claims.

Reviewed changes

  • Vendors the anti-slop plugin into config/oxlint-plugins/anti-slop/ (20 rules, shared helpers, vendored eslint-stylistic engine, provenance/licenses) plus two deslop rules and the tailwind/ sources.
  • Adds config/oxlint-anti-slop.json with every anti-slop rule "off" and all oxlint categories "off", wired into pnpm lint as the new audit:anti-slop script.
  • Excludes the vendored directory from the root oxlint/oxfmt ignores and adds --no-error-on-unmatched-pattern to the lint-staged commands.
  • Adds @oxlint/plugins@1.80.0 and reflows .oxlintrc.json / .oxfmtrc.json to oxfmt output.

ℹ️ The vendored rules land with no in-repo test coverage

The plugin ships twenty AST rules but zero *.test.ts files, and vendor/eslint-stylistic/UPSTREAM.md points at rules/require-readable-spacing.test.ts and -cli.test.ts that do not exist here. That is tolerable while every rule is "off", but the stated rollout flips rules to "error" one at a time — at that point a rule that silently stops matching (or crashes on an unusual AST shape) has no in-repo signal. Worth deciding whether the per-rule tests belong in each follow-up PR or in a shared harness here.

Technical details
# Vendored rule coverage

## Affected sites
- `config/oxlint-plugins/anti-slop/rules/` — 20 rules, no test files (glob `config/oxlint-plugins/anti-slop/**/*.test.ts` returns none).
- `config/oxlint-plugins/anti-slop/vendor/eslint-stylistic/UPSTREAM.md` — references `../../rules/require-readable-spacing.test.ts` and `../../rules/require-readable-spacing-cli.test.ts`, neither present.

## Open questions for the human
- Do the follow-up rule-enablement PRs carry focused RuleTester cases, or is the existing 360k-violation baseline the only evidence the rules work?

ℹ️ Nitpicks

  • vendor/eslint-stylistic/UPSTREAM.md tells maintainers to run pnpm check and pnpm sync:skill-assets; neither script exists in this repository (upstream anti-slop's Development section). Adapt or drop that line when vendoring.
  • config/oxlint-plugins/anti-slop/tailwind/ (~200 lines, deslop's canonical-class-names) is never registered in index.ts. If that opt-in Tailwind rule is not being adopted, the directory is dead weight.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread .oxlintrc.json Resolved
Comment thread package.json
"@electron-toolkit/tsconfig": "^2.0.0",
"@electron/rebuild": "^4.2.0",
"@monaco-editor/react": "^4.7.0",
"@oxlint/plugins": "1.80.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oxlint/plugins is pinned exact while oxlint is still ^1.80.0, so a fresh install can resolve the linter ahead of the plugin API it loads. The upstream anti-slop README is explicit about keeping both exact so upgrades move them together — consider pinning root oxlint to 1.80.0 as well.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 2e42225f-1c06-4a65-a7a0-23f17f2222cf

📥 Commits

Reviewing files that changed from the base of the PR and between b9f5906 and 70c8f7361ad4f34043410532569a7cfb6aa5c479.

📒 Files selected for processing (2)
  • .github/workflows/pr.yml
  • package.json

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds an anti-slop Oxlint configuration and a script that copies the pinned plugin source into .anti-slop-plugin. It adds package scripts and dependencies, runs the audit from lint and pull request static analysis, and ignores the generated plugin directory in Git and oxfmt.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 70c8f

The audit synchronizes the pinned plugin before Oxlint, and the manifest and lockfile agree. The reviewed rule concerns are not reachable in the current configuration.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the implementation, rationale, scope, and rollout plan. However, it omits most required template sections, including the linked issue, visual proof or an N/A explanation, test… Add the required template sections. Include a linked issue after "Fixes #"; provide visual proof or state N/A with a reason; document manual and automated testing, including tested platforms; complete the AI Disclosure, Review, Agent skill …
Docstring Coverage ⚠️ Warning Docstring coverage is 24.68% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 158 functions across 36 files. (2 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding the pinned anti-slop Oxlint plugin with all rules disabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the implementation, rationale, scope, and rollout plan. However, it omits most required template sections, including the linked issue, visual proof or an N/A explanation, testing details, AI disclosure, review notes, agent skill boundary, notes, and checklist.

Resolution

Add the required template sections. Include a linked issue after "Fixes #"; provide visual proof or state N/A with a reason; document manual and automated testing, including tested platforms; complete the AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections; and retain the existing implementation and rollout details.

Full details: Docstring Coverage

Explanation

Docstring coverage is 24.68% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 158 functions across 36 files. (2 skipped: 2 unsupported.)


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: da03c3d0-a71d-4305-8793-c2ebbec99fba

📥 Commits

Reviewing files that changed from the base of the PR and between b8554f1 and 3ca83ab.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (43)
  • .oxfmtrc.json
  • .oxlintrc.json
  • config/oxlint-anti-slop.json
  • config/oxlint-plugins/anti-slop/LICENSE.anti-slop
  • config/oxlint-plugins/anti-slop/index.ts
  • config/oxlint-plugins/anti-slop/package.json
  • config/oxlint-plugins/anti-slop/rules/no-array-filter-map.ts
  • config/oxlint-plugins/anti-slop/rules/no-call-only-assertions.ts
  • config/oxlint-plugins/anti-slop/rules/no-chained-type-assertions.ts
  • config/oxlint-plugins/anti-slop/rules/no-conditional-empty-object-spread.ts
  • config/oxlint-plugins/anti-slop/rules/no-known-value-widening.ts
  • config/oxlint-plugins/anti-slop/rules/no-module-mocking.ts
  • config/oxlint-plugins/anti-slop/rules/no-object-parameters.ts
  • config/oxlint-plugins/anti-slop/rules/no-pass-through-type-alias.ts
  • config/oxlint-plugins/anti-slop/rules/no-reduce-accumulator-copy.ts
  • config/oxlint-plugins/anti-slop/rules/no-reflect-apply.ts
  • config/oxlint-plugins/anti-slop/rules/no-reflect-get.ts
  • config/oxlint-plugins/anti-slop/rules/no-runtime-typeof.ts
  • config/oxlint-plugins/anti-slop/rules/no-shape-in-symbol-names.ts
  • config/oxlint-plugins/anti-slop/rules/no-unknown-parameters.ts
  • config/oxlint-plugins/anti-slop/rules/no-unknown-returns.ts
  • config/oxlint-plugins/anti-slop/rules/no-unknown-type-aliases.ts
  • config/oxlint-plugins/anti-slop/rules/no-unsafe-dictionary-type.ts
  • config/oxlint-plugins/anti-slop/rules/no-widen-then-assert.ts
  • config/oxlint-plugins/anti-slop/rules/require-readable-spacing.ts
  • config/oxlint-plugins/anti-slop/rules/require-safety-comment-for-type-assertion.ts
  • config/oxlint-plugins/anti-slop/shared/array-method.ts
  • config/oxlint-plugins/anti-slop/shared/dictionary-types.ts
  • config/oxlint-plugins/anti-slop/shared/function-parameters.ts
  • config/oxlint-plugins/anti-slop/shared/lexical-type-parameters.ts
  • config/oxlint-plugins/anti-slop/shared/reflect-method.ts
  • config/oxlint-plugins/anti-slop/shared/scope.ts
  • config/oxlint-plugins/anti-slop/shared/type-alias-resolution.ts
  • config/oxlint-plugins/anti-slop/tailwind/candidates.ts
  • config/oxlint-plugins/anti-slop/tailwind/design-system.ts
  • config/oxlint-plugins/anti-slop/tailwind/rule.ts
  • config/oxlint-plugins/anti-slop/tailwind/worker.ts
  • config/oxlint-plugins/anti-slop/vendor/eslint-stylistic/LICENSE
  • config/oxlint-plugins/anti-slop/vendor/eslint-stylistic/UPSTREAM.md
  • config/oxlint-plugins/anti-slop/vendor/eslint-stylistic/padding-line-ast.ts
  • config/oxlint-plugins/anti-slop/vendor/eslint-stylistic/padding-line-between-statements.ts
  • config/oxlint-plugins/anti-slop/vendor/eslint-stylistic/padding-line-options.d.ts
  • package.json

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Comment on lines +19 to +26
"ignorePatterns": [
"**/node_modules",
"**/dist",
"**/out",
"cloud/**",
"config/oxlint-plugins/anti-slop/**",
"src/shared/rpc-contract/rpc-params-catalog.generated.ts",
"tests/e2e/.cross-version-checkouts"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Move the anti-slop config to the repository root.

Oxlint rejects .. in ignorePatterns, so a config under config/ cannot ignore repository-root paths. The current patterns therefore miss the vendored plugin, generated catalog, and cross-version checkout paths. This violates the audit’s exclusion contract when rules are enabled.

Move the config to the repository root, update its schema and plugin paths, update package.json, and retain all three repository-root exclusions:

Required path corrections
- "config/oxlint-anti-slop.json"
+ "oxlint-anti-slop.json"

- "$schema": "../node_modules/oxlint/configuration_schema.json"
+ "$schema": "./node_modules/oxlint/configuration_schema.json"

- "specifier": "./oxlint-plugins/anti-slop/index.ts"
+ "specifier": "./config/oxlint-plugins/anti-slop/index.ts"

- "tests/e2e/.cross-version-checkouts"
+ "tests/e2e/.cross-version-checkouts/**"

Update the audit command to use --config oxlint-anti-slop.json.

Comment on lines +28 to +29
const callback = node.arguments.at(-1);
return callback?.type === "FunctionExpression" || callback?.type === "ArrowFunctionExpression";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Recognize callbacks before an optional timeout.

isTestCall checks only the final argument. For test(name, callback, timeout), the numeric timeout fails the function check, so the rule does not create a TestEntry and misses call-only assertions. Jest and Vitest both support this form. Check the callback argument before the optional timeout, including the supported options/body form.

Comment on lines +29 to +32
if (parent.type !== "BinaryExpression") return false;
if (!["===", "!==", "==", "!="].includes(parent.operator)) return false;
const other = parent.left === node ? parent.right : parent.left;
return other.type === "Literal" && other.value === "undefined";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Limit the exemption to absent-binding probes.

isExistenceProbe only checks the comparison and the "undefined" literal. It therefore skips typeof payload === "undefined" even when payload is declared. Restrict the exemption to identifier references that resolve to an eligible global or unresolved binding, using context.sourceCode.

The rule is currently disabled in config/oxlint-anti-slop.json, so this is a minor false negative in a future activation.

Comment on lines +11 to +15
function isBorrowedMemberName(node: ESTree.Node): boolean {
const parent = node.parent;
if (parent === null || parent.type !== "MemberExpression") return false;
return parent.property === node && parent.computed === false;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Exclude the imported side of aliased imports.

For import { Shape as Geometry } from "package", Oxlint visits both ImportSpecifier.imported (Shape) and ImportSpecifier.local (Geometry). The Identifier visitor reports Shape, although only the local symbol should be checked. Skip ImportSpecifier.imported and continue checking ImportSpecifier.local.

The rule is currently "off" in config/oxlint-anti-slop.json, so classify this as a minor future-lint issue.

Comment on lines +90 to +92
const first = context.sourceCode.getText(node)[0];
const quote = first === "'" || first === '"' || first === "`" ? first : '"';
return fixer.replaceText(node, `${quote}${fixed}${quote}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Serialize decoded Literal values before applying the autofix.

checkStringNode receives Literal nodes for JSX attribute literals and JavaScript string literals. These paths pass decoded node.value.value or node.value values to rewriteClassValue. The fixer then emits ${quote}${fixed}${quote} without escaping. If another token changes while the value contains a decoded quote, such as " or an escaped JavaScript quote, the fix can produce invalid JSX or JavaScript source.

Keep the existing raw-quasi path for expression-free TemplateLiteral nodes. Escape JavaScript Literal values for the selected quote. Encode JSX attribute values as entities or replace them with a safely serialized JSX expression container. The rule is currently "off" in config/oxlint-anti-slop.json, so this affects files only when the rule is enabled.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

The new commit fixes the anti-slop audit's own vendored-dir exclusion, but the CI-breaking case is untouched: static analysis is still red on this head because config/oxlint-code-quality-type-aware.json scans the vendored plugin. The commit's stated cause (oxlint ignores --config ignorePatterns) is not the real mechanism, and getting it right changes the fix.

Reviewed changes

  • Moved the vendored-plugin exclusion for audit:anti-slop from config/oxlint-anti-slop.json's ignorePatterns to a --ignore-pattern CLI flag in package.json, dropping the now-unused config entry.

🚨 The type-aware code-quality audit still fails on the vendored plugin

pnpm run audit:code-quality:type-aware — the static analysis job at .github/workflows/pr.yml:140 — exits 1 on config/oxlint-plugins/anti-slop/rules/no-widen-then-assert.ts:124, and check:code-quality:changed fails on the same added files. This commit fixed audit:anti-slop (0 diagnostics today, because every rule is off) and left the two configs that actually break the build. This is the same blocker the prior review flagged; what's new is the mechanism, which changes the correct fix.

Technical details
# Code-quality configs still lint the vendored plugin

## Affected sites
- `config/oxlint-code-quality-type-aware.json:31` — no vendored exclusion; the failing scan.
- `config/oxlint-code-quality-native-plugins.json:48` — same omission; 0 diagnostics today, same latent break.
- `config/scripts/check-changed-code-quality.mjs:26-28` — reuses the type-aware config; only `cloud/` is ignored.

## Required outcome
- `static analysis` stays green with the vendored plugin present.

## Suggested approach
- Add `--ignore-pattern 'config/oxlint-plugins/anti-slop/**'` to `audit:code-quality:native` and `audit:code-quality:type-aware`, and to the type-aware scan in `check-changed-code-quality.mjs`.
- A config-dir-relative `"oxlint-plugins/anti-slop/**"` entry inside each `config/`-hosted config also works; a root-relative `"config/..."` entry does not.

## Evidence
- `oxlint --type-aware --config config/oxlint-code-quality-type-aware.json src config tests --deny-warnings` → exit 1; adding `--ignore-pattern 'config/oxlint-plugins/anti-slop/**'` → exit 0.

## Open questions for the human
- Is a shared ignore list for every oxlint config preferable to repeating `--ignore-pattern` on each script?

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread package.json Resolved
"**/dist",
"**/out",
"cloud/**",
"src/shared/rpc-contract/rpc-params-catalog.generated.ts",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Config ignorePatterns are config-dir-relative, so this entry resolves under config/ and never matches — src/shared/rpc-contract/rpc-params-catalog.generated.ts is still scanned by audit:anti-slop. Harmless while every rule is "off" (the audit reports 0 diagnostics), but the first follow-up that flips a rule on will lint the generated file as first-party code.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Appending the anti-slop sync to postinstall fails the pinned postinstall contract test and can never run under this repo's --ignore-scripts CI install, so the new audit:anti-slop leaf is unrunnable in CI.

Reviewed changes

  • Replaced the vendored plugin with a git-pinned dependency. Deleted config/oxlint-plugins/anti-slop/**, pinned oxlint-plugin-anti-slop to github:dmmulroy/anti-slop#c44ef22, and dropped the two deslop rules.
  • Added a sync step and rewired the config. config/scripts/sync-anti-slop-plugin.mjs copies the pinned package's src/ to gitignored .anti-slop-plugin/; config/oxlint-anti-slop.json now loads it via ../.anti-slop-plugin/index.ts.
  • Dropped the vendored-dir lint/format ignores and added .anti-slop-plugin/** to .oxfmtrc.json.

Deleting the vendored tree also resolves the prior blocker: oxlint, audit:code-quality:native, and audit:code-quality:type-aware are all green on this head (verified).

⚠️ The anti-slop audit has no CI gate

audit:anti-slop is only reachable through the root pnpm lint chain, but no workflow runs it. pr.yml's static analysis job spells out its steps — pnpm exec oxlint, audit:code-quality:native, audit:code-quality:type-aware (pr.yml:134-140) — and the only pnpm lint invocations anywhere in CI are mobile/'s and the docs app's, each in its own package. The rollout plan's "flip one rule to error, independently green" therefore has no enforcement: a rule enabled without adding a CI step would only be checked locally.

Technical details
# anti-slop is not enforced by any CI job

## Affected sites
- `.github/workflows/pr.yml:134-140` — static analysis runs the root `oxlint` plus the two code-quality audits; it never runs `pnpm lint` or `audit:anti-slop`.
- `package.json:17` — `audit:anti-slop` is a leaf of the root `lint` chain only.
- `.github/workflows/mobile.yml:86` and `.github/workflows/docs.yml:71` — the only CI `lint` invocations; both run a different package's script.

## Required outcome
- A decision on where anti-slop is enforced. If CI is the intended gate, add `audit:anti-slop` to the static analysis job; if local-only is intended for now, note that in the PR description so the per-rule follow-ups aren't assumed to be CI-gated.

## Open questions for the human
- Is the anti-slop step meant to move into `pr.yml` when a rule is flipped on, or is `pnpm lint` the only intended entry point?

ℹ️ Nitpicks

  • The PR description still describes the vendored layout — "Vendors dmmulroy/anti-slop into config/oxlint-plugins/anti-slop/", the two deslop rules (no-call-only-assertions, no-pass-through-type-alias), and a 20-rule table. The branch now pins a git dependency, drops deslop, and ships 18 rules; updating the description would keep reviewers from diffing against the wrong design.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread package.json
@@ -97,7 +95,7 @@
"build": "pnpm run build:desktop && pnpm run build:native",
"build:release": "pnpm run build:relay && pnpm run build:native && pnpm run verify:computer-native && pnpm run build:cli && pnpm run build:electron-vite && pnpm run verify:built-skills-cli && pnpm run build:web-from-renderer",
"build:release:parallel": "pnpm run build:relay && pnpm run build:native && pnpm run verify:computer-native && pnpm run build:cli && pnpm run build:electron-vite:parallel && pnpm run verify:built-skills-cli && pnpm run build:web-from-renderer",
"postinstall": "node config/scripts/rebuild-native-deps.mjs",
"postinstall": "node config/scripts/rebuild-native-deps.mjs && node config/scripts/sync-anti-slop-plugin.mjs",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appending the sync to postinstall fails the pinned contract test config/scripts/package-electron-runtime-contract.test.mjs:28 ("keeps root postinstall as the single Electron binary install owner") — pnpm test now reports 1 failed. It also can't work in CI: the shared install action uses pnpm install --frozen-lockfile --ignore-scripts, so postinstall never runs, .anti-slop-plugin/ is never created, and oxlint --config config/oxlint-anti-slop.json exits 1 with Failed to load JS plugin: ../.anti-slop-plugin/index.ts.

Technical details
# postinstall is pinned and skipped in CI

## Affected sites
- `package.json:98` — `postinstall` now chains `rebuild-native-deps.mjs && sync-anti-slop-plugin.mjs`.
- `config/scripts/package-electron-runtime-contract.test.mjs:28` — asserts the exact single-command value; collected by `config/vitest.config.ts:34-35`, so the CI unit-test shard fails.
- `.github/actions/install-node-dependencies/action.yml:93` — `pnpm install --frozen-lockfile --ignore-scripts`, so the artifact is absent in every CI job.
- `config/oxlint-anti-slop.json:7` — the `jsPlugins` specifier resolves only if the copy ran.

## Required outcome
- The postinstall contract test stays green (or its invariant is deliberately redefined), and `audit:anti-slop` works in an environment installed with `--ignore-scripts`.

## Suggested approach
- Generate `.anti-slop-plugin/` on demand instead of at install time: e.g. prepend the sync to the `audit:anti-slop` script, keeping `postinstall` as the sole Electron-binary owner.
- Make the sync a no-op when the target already matches so a lint run stays cheap.

## Evidence
- `pnpm test config/scripts/package-electron-runtime-contract.test.mjs` → 1 failed.
- With `.anti-slop-plugin/` removed: `node_modules/.bin/oxlint --config config/oxlint-anti-slop.json src --deny-warnings` → exit 1.

## Open questions for the human
- Is generating the plugin copy on every lint invocation acceptable, or is a dedicated CI step (after a non-`--ignore-scripts` install) preferred?

@nwparker nwparker changed the title chore(lint): add anti-slop oxlint plugin (all rules off) chore(lint): add anti-slop oxlint plugin (pinned, all rules off) Sep 15, 2026
Vendors dmmulroy/anti-slop (MIT) plus no-call-only-assertions and
no-pass-through-type-alias from maharshi365/deslop (MIT). Every rule starts
"off"; each follow-up PR fixes one rule's violations and flips it to "error".
oxlint does not honour ignorePatterns supplied via --config, so the
config/oxlint-plugins/anti-slop/** entry never matched and the vendored rule
source was being linted as first-party code (505 violations). Move the exclusion
to the --ignore-pattern CLI flag in audit:anti-slop, which does work, and drop
the entry that gave a false sense of coverage.

Keeping vendored source unlinted matters because anti-slop is updated by
three-way merge against the upstream snapshot; reformatting it locally would
conflict on every update.
Replaces the ~5k vendored lines with a git-pinned devDependency:
  oxlint-plugin-anti-slop: github:dmmulroy/anti-slop#c44ef22

anti-slop ships raw .ts with no build step, and Node refuses to type-strip
anything under node_modules (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING), so
oxlint cannot load it from there -- which is why upstream says to vendor it. A
postinstall step copies the pinned package's source to .anti-slop-plugin/
(gitignored), which Node will type-strip because it sits outside node_modules.
Upgrading is now a SHA bump rather than a re-vendor and three-way merge.

Verified byte-identical rule output to the vendored copy across all 16 rules
that fire.

Drops maharshi365/deslop and its two rules (no-call-only-assertions,
no-pass-through-type-alias). It is not on npm either, so it would need a second
git pin and copy step, and it is a 5-star single-maintainer repo that is itself
a re-namespaced copy of anti-slop. One upstream is enough.
config/scripts/pr-workflow-lint-parity.test.mjs requires every step in
`pnpm lint` to have a matching step in .github/workflows/pr.yml; adding
audit:anti-slop to lint without the workflow step failed that ratchet.

Also makes audit:anti-slop sync the plugin itself before linting. The generated
.anti-slop-plugin/ directory is gitignored and otherwise only created by
postinstall, so a cached install that skips postinstall would leave oxlint
unable to load the plugin.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

The new commit closes the "no CI gate" gap, but the postinstall chain it now duplicates still fails the pinned contract test, so the unit-test shard stays red.

Reviewed changes

  • Gated anti-slop in PR CI — .github/workflows/pr.yml gains a "Reject low-evidence patterns" step running pnpm run audit:anti-slop, satisfying the pr-workflow-lint-parity ratchet.
  • Made audit:anti-slop self-syncing — the script now runs sync-anti-slop-plugin.mjs before oxlint, so an install that skipped postinstall (CI installs with --ignore-scripts) still loads the plugin.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment thread package.json Outdated
@@ -164,7 +164,9 @@
"test:e2e:remote-bulk-open-freeze": "pnpm run ensure:electron-runtime && pnpm exec playwright test tests/e2e/remote-session-bulk-open-freeze-repro.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1",
"test:e2e:ssh-docker-bulk-open-freeze": "node config/scripts/run-ssh-docker-bulk-open-freeze-e2e.mjs",
"repro:live-remote-bulk-open-freeze": "node config/scripts/live-remote-bulk-open-freeze-repro.mjs",
"repro:live-remote-realistic-freeze": "node config/scripts/live-remote-realistic-freeze-repro.mjs"
"repro:live-remote-realistic-freeze": "node config/scripts/live-remote-realistic-freeze-repro.mjs",
"audit:anti-slop": "node config/scripts/sync-anti-slop-plugin.mjs && oxlint --config config/oxlint-anti-slop.json src config tests mobile --deny-warnings",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this self-syncs, the postinstall chain at package.json:100 is redundant — and it still fails the pinned contract test config/scripts/package-electron-runtime-contract.test.mjs:28, which asserts postinstall is the single Electron-binary owner. Removing && node config/scripts/sync-anti-slop-plugin.mjs from postinstall restores the invariant without losing generation, since audit:anti-slop now creates the artifact. I re-ran the test: 1 failed / 21 passed.

Technical details
# postinstall chain still fails the pinned contract

## Affected sites
- `package.json:100` — `postinstall` chains `rebuild-native-deps.mjs && sync-anti-slop-plugin.mjs`; this is unchanged from the prior head and breaks the contract.
- `config/scripts/package-electron-runtime-contract.test.mjs:28` — asserts the exact single-command postinstall value.
- `config/vitest.config.ts:35` — collects `config/scripts/**/*.test.mjs`; `.github/workflows/unit-tests.yml` runs this config, so the failing test lands on the CI unit shard.
- `package.json:168` — `audit:anti-slop` now syncs on demand, making the postinstall copy redundant.

## Required outcome
- `pnpm test config/scripts/package-electron-runtime-contract.test.mjs` green while `audit:anti-slop` still produces `.anti-slop-plugin/`.

## Suggested approach
- Drop `&& node config/scripts/sync-anti-slop-plugin.mjs` from `postinstall`, or deliberately redefine the contract test's invariant and state that in the PR description.

## Evidence
- `pnpm exec vitest run config/scripts/package-electron-runtime-contract.test.mjs` → 1 failed / 21 passed: expected `node config/scripts/rebuild-native-deps.mjs`, received `node config/scripts/rebuild-native-deps.mjs && node config/scripts/sync-anti-slop-plugin.mjs`.
- `pnpm exec vitest run config/scripts/pr-workflow-lint-parity.test.mjs` → passed.

nwparker added a commit that referenced this pull request Sep 15, 2026
…owner (#20788)

#20726 appended the anti-slop plugin sync to postinstall, which breaks the
contract asserted by package-electron-runtime-contract.test.mjs and is failing
on main.

The sync is not needed there: audit:anti-slop already runs it before linting, so
a cached install that skips postinstall still works.
ivanvykopal pushed a commit to ivanvykopal/orca that referenced this pull request Sep 20, 2026
…blyai#20726)

* chore(lint): add anti-slop oxlint plugin (all rules off)

Vendors dmmulroy/anti-slop (MIT) plus no-call-only-assertions and
no-pass-through-type-alias from maharshi365/deslop (MIT). Every rule starts
"off"; each follow-up PR fixes one rule's violations and flips it to "error".

* fix(lint): actually exclude the vendored plugin from the anti-slop audit

oxlint does not honour ignorePatterns supplied via --config, so the
config/oxlint-plugins/anti-slop/** entry never matched and the vendored rule
source was being linted as first-party code (505 violations). Move the exclusion
to the --ignore-pattern CLI flag in audit:anti-slop, which does work, and drop
the entry that gave a false sense of coverage.

Keeping vendored source unlinted matters because anti-slop is updated by
three-way merge against the upstream snapshot; reformatting it locally would
conflict on every update.

* chore(lint): pin anti-slop instead of vendoring it; drop deslop

Replaces the ~5k vendored lines with a git-pinned devDependency:
  oxlint-plugin-anti-slop: github:dmmulroy/anti-slop#c44ef22

anti-slop ships raw .ts with no build step, and Node refuses to type-strip
anything under node_modules (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING), so
oxlint cannot load it from there -- which is why upstream says to vendor it. A
postinstall step copies the pinned package's source to .anti-slop-plugin/
(gitignored), which Node will type-strip because it sits outside node_modules.
Upgrading is now a SHA bump rather than a re-vendor and three-way merge.

Verified byte-identical rule output to the vendored copy across all 16 rules
that fire.

Drops maharshi365/deslop and its two rules (no-call-only-assertions,
no-pass-through-type-alias). It is not on npm either, so it would need a second
git pin and copy step, and it is a 5-star single-maintainer repo that is itself
a re-namespaced copy of anti-slop. One upstream is enough.

* ci(lint): run audit:anti-slop in PR CI

config/scripts/pr-workflow-lint-parity.test.mjs requires every step in
`pnpm lint` to have a matching step in .github/workflows/pr.yml; adding
audit:anti-slop to lint without the workflow step failed that ratchet.

Also makes audit:anti-slop sync the plugin itself before linting. The generated
.anti-slop-plugin/ directory is gitignored and otherwise only created by
postinstall, so a cached install that skips postinstall would leave oxlint
unable to load the plugin.
ivanvykopal pushed a commit to ivanvykopal/orca that referenced this pull request Sep 20, 2026
…owner (stablyai#20788)

stablyai#20726 appended the anti-slop plugin sync to postinstall, which breaks the
contract asserted by package-electron-runtime-contract.test.mjs and is failing
on main.

The sync is not needed there: audit:anti-slop already runs it before linting, so
a cached install that skips postinstall still works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant