Repository navigation
chore(lint): add anti-slop oxlint plugin (pinned, all rules off) - #20726
Conversation
There was a problem hiding this comment.
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 thetailwind/sources. - Adds
config/oxlint-anti-slop.jsonwith every anti-slop rule"off"and all oxlint categories"off", wired intopnpm lintas the newaudit:anti-slopscript. - Excludes the vendored directory from the root
oxlint/oxfmtignores and adds--no-error-on-unmatched-patternto the lint-staged commands. - Adds
@oxlint/plugins@1.80.0and reflows.oxlintrc.json/.oxfmtrc.jsonto 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.mdtells maintainers to runpnpm checkandpnpm 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'scanonical-class-names) is never registered inindex.ts. If that opt-in Tailwind rule is not being adopted, the directory is dead weight.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| "@electron-toolkit/tsconfig": "^2.0.0", | ||
| "@electron/rebuild": "^4.2.0", | ||
| "@monaco-editor/react": "^4.7.0", | ||
| "@oxlint/plugins": "1.80.0", |
There was a problem hiding this comment.
@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.
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between b9f5906 and 70c8f7361ad4f34043410532569a7cfb6aa5c479. 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe PR adds an anti-slop Oxlint configuration and a script that copies the pinned plugin source into Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to 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)
✅ Passed checks (3 passed)
Full details: Description checkExplanation 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 CoverageExplanation 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: da03c3d0-a71d-4305-8793-c2ebbec99fba
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (43)
.oxfmtrc.json.oxlintrc.jsonconfig/oxlint-anti-slop.jsonconfig/oxlint-plugins/anti-slop/LICENSE.anti-slopconfig/oxlint-plugins/anti-slop/index.tsconfig/oxlint-plugins/anti-slop/package.jsonconfig/oxlint-plugins/anti-slop/rules/no-array-filter-map.tsconfig/oxlint-plugins/anti-slop/rules/no-call-only-assertions.tsconfig/oxlint-plugins/anti-slop/rules/no-chained-type-assertions.tsconfig/oxlint-plugins/anti-slop/rules/no-conditional-empty-object-spread.tsconfig/oxlint-plugins/anti-slop/rules/no-known-value-widening.tsconfig/oxlint-plugins/anti-slop/rules/no-module-mocking.tsconfig/oxlint-plugins/anti-slop/rules/no-object-parameters.tsconfig/oxlint-plugins/anti-slop/rules/no-pass-through-type-alias.tsconfig/oxlint-plugins/anti-slop/rules/no-reduce-accumulator-copy.tsconfig/oxlint-plugins/anti-slop/rules/no-reflect-apply.tsconfig/oxlint-plugins/anti-slop/rules/no-reflect-get.tsconfig/oxlint-plugins/anti-slop/rules/no-runtime-typeof.tsconfig/oxlint-plugins/anti-slop/rules/no-shape-in-symbol-names.tsconfig/oxlint-plugins/anti-slop/rules/no-unknown-parameters.tsconfig/oxlint-plugins/anti-slop/rules/no-unknown-returns.tsconfig/oxlint-plugins/anti-slop/rules/no-unknown-type-aliases.tsconfig/oxlint-plugins/anti-slop/rules/no-unsafe-dictionary-type.tsconfig/oxlint-plugins/anti-slop/rules/no-widen-then-assert.tsconfig/oxlint-plugins/anti-slop/rules/require-readable-spacing.tsconfig/oxlint-plugins/anti-slop/rules/require-safety-comment-for-type-assertion.tsconfig/oxlint-plugins/anti-slop/shared/array-method.tsconfig/oxlint-plugins/anti-slop/shared/dictionary-types.tsconfig/oxlint-plugins/anti-slop/shared/function-parameters.tsconfig/oxlint-plugins/anti-slop/shared/lexical-type-parameters.tsconfig/oxlint-plugins/anti-slop/shared/reflect-method.tsconfig/oxlint-plugins/anti-slop/shared/scope.tsconfig/oxlint-plugins/anti-slop/shared/type-alias-resolution.tsconfig/oxlint-plugins/anti-slop/tailwind/candidates.tsconfig/oxlint-plugins/anti-slop/tailwind/design-system.tsconfig/oxlint-plugins/anti-slop/tailwind/rule.tsconfig/oxlint-plugins/anti-slop/tailwind/worker.tsconfig/oxlint-plugins/anti-slop/vendor/eslint-stylistic/LICENSEconfig/oxlint-plugins/anti-slop/vendor/eslint-stylistic/UPSTREAM.mdconfig/oxlint-plugins/anti-slop/vendor/eslint-stylistic/padding-line-ast.tsconfig/oxlint-plugins/anti-slop/vendor/eslint-stylistic/padding-line-between-statements.tsconfig/oxlint-plugins/anti-slop/vendor/eslint-stylistic/padding-line-options.d.tspackage.json
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
| "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" |
There was a problem hiding this comment.
🎯 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.
| const callback = node.arguments.at(-1); | ||
| return callback?.type === "FunctionExpression" || callback?.type === "ArrowFunctionExpression"; |
There was a problem hiding this comment.
🎯 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.
| 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"; |
There was a problem hiding this comment.
🎯 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.
| 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; | ||
| } |
There was a problem hiding this comment.
🎯 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.
| const first = context.sourceCode.getText(node)[0]; | ||
| const quote = first === "'" || first === '"' || first === "`" ? first : '"'; | ||
| return fixer.replaceText(node, `${quote}${fixed}${quote}`); |
There was a problem hiding this comment.
🎯 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.
There was a problem hiding this comment.
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-slopfromconfig/oxlint-anti-slop.json'signorePatternsto a--ignore-patternCLI flag inpackage.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?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| "**/dist", | ||
| "**/out", | ||
| "cloud/**", | ||
| "src/shared/rpc-contract/rpc-params-catalog.generated.ts", |
There was a problem hiding this comment.
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.
6cf5b99 to
b9f5906
Compare
There was a problem hiding this comment.
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/**, pinnedoxlint-plugin-anti-sloptogithub:dmmulroy/anti-slop#c44ef22, and dropped the two deslop rules. - Added a sync step and rewired the config.
config/scripts/sync-anti-slop-plugin.mjscopies the pinned package'ssrc/to gitignored.anti-slop-plugin/;config/oxlint-anti-slop.jsonnow 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.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| @@ -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", | |||
There was a problem hiding this comment.
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?b9f5906 to
70c8f73
Compare
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.
70c8f73 to
bfad0be
Compare
There was a problem hiding this comment.
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.ymlgains a "Reject low-evidence patterns" step runningpnpm run audit:anti-slop, satisfying thepr-workflow-lint-parityratchet. - Made
audit:anti-slopself-syncing — the script now runssync-anti-slop-plugin.mjsbefore oxlint, so an install that skippedpostinstall(CI installs with--ignore-scripts) still loads the plugin.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| @@ -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", | |||
There was a problem hiding this comment.
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.…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.
…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.
…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.

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
oxlint-plugin-anti-slop: github:dmmulroy/anti-slop#c44ef22.config/scripts/sync-anti-slop-plugin.mjs, run frompostinstall, copies the pinned package's source to.anti-slop-plugin/(gitignored).config/oxlint-anti-slop.json— every rule set to"off", wired intopnpm lintvia a newaudit:anti-slopscript.Why a copy step instead of loading it from node_modules
anti-slop ships raw
.tswith no build step (exports: "./src/index.ts"). Node refuses to type-strip anything undernode_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 outsidenode_modulessidesteps 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 mobilelint 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-slopfrom npmThat 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 asis exactly where a test quietly stops matching the real type.no-module-mockingis 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 isofffor tests via an override and enforced on the 73 production hits only.maharshi365/deslopwas 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.