-
Notifications
You must be signed in to change notification settings - Fork 781
chore(lint): add repo-wide anti-slop profile #1808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
914edee
feat(lint): vendor OpenCodex anti-slop rules
Wibias bb9585e
docs(lint): document anti-slop policy
Wibias 753de09
chore(lint): retain anti-slop licence
Wibias 00a7dd0
feat(lint): add root anti-slop profile
Wibias 86203cf
feat(lint): enable anti-slop in dashboard checks
Wibias 8ef0789
feat(lint): expose core anti-slop command
Wibias b425452
feat(lint): run anti-slop across core source
Wibias b89b429
test(lint): enforce anti-slop core profile in CI
Wibias 016fe4a
docs(lint): document core anti-slop gate
Wibias beef066
test(lint): exercise anti-slop error boundary
Wibias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "$schema": "./gui/node_modules/oxlint/configuration_schema.json", | ||
| "plugins": [], | ||
| "jsPlugins": [ | ||
| { | ||
| "name": "anti-slop", | ||
| "specifier": "./gui/.eslint/anti-slop/index.mjs" | ||
| } | ||
| ], | ||
| "categories": { | ||
| "correctness": "off" | ||
| }, | ||
| "env": { | ||
| "builtin": true, | ||
| "node": true | ||
| }, | ||
| "rules": { | ||
| "anti-slop/no-chained-type-assertions": "warn", | ||
| "anti-slop/no-known-value-widening": "warn", | ||
| "anti-slop/no-object-parameters": "warn", | ||
| "anti-slop/no-reflect-apply": "error", | ||
| "anti-slop/no-reflect-get": "error", | ||
| "anti-slop/no-widen-then-assert": "warn", | ||
| "anti-slop/require-safety-comment-for-type-assertion": "warn" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2026 Dillon Mulroy | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # OpenCodex anti-slop profile | ||
|
|
||
| This directory contains an OpenCodex-local adaptation of selected rules from `dmmulroy/anti-slop`, snapshot `446268e5d15baa968eaec669ff65358d36ae6259`. | ||
|
|
||
| The upstream project explicitly recommends vendoring and customising its rules. OpenCodex therefore owns this copy and its policy instead of taking a moving package dependency. | ||
|
|
||
| ## Enabled rules | ||
|
|
||
| The repository enables these rules across runtime source, scripts, and dashboard TypeScript: | ||
|
|
||
| - `no-chained-type-assertions` - warning during migration. | ||
| - `no-known-value-widening` - warning during migration. | ||
| - `no-object-parameters` - warning during migration. | ||
| - `no-reflect-apply` - error. | ||
| - `no-reflect-get` - error. | ||
| - `no-widen-then-assert` - warning during migration. | ||
| - `require-safety-comment-for-type-assertion` - warning during migration. | ||
|
|
||
| Warnings keep the existing codebase lintable while making new low-evidence patterns visible. The two Reflect rules are errors because the repository has no legitimate production use of those dynamic escape hatches. | ||
|
|
||
| ## Intentionally excluded upstream rules | ||
|
|
||
| OpenCodex accepts untrusted provider, protocol, process, and JSON input at explicit boundaries. `unknown`, narrow `typeof` checks, and dictionary-shaped boundary data can therefore be correct rather than slop. We do not enable upstream policies that broadly reject those patterns. | ||
|
|
||
| The local profile intentionally omits: | ||
|
|
||
| - `no-conditional-empty-object-spread` | ||
| - `no-module-mocking` | ||
| - `no-runtime-typeof` | ||
| - `no-shape-in-symbol-names` | ||
| - `no-unknown-parameters` | ||
| - `no-unknown-returns` | ||
| - `no-unknown-type-aliases` | ||
| - `no-unsafe-dictionary-type` | ||
|
|
||
| ## Implementation note | ||
|
|
||
| The plugin uses Oxlint's ESLint-compatible JavaScript plugin shape directly. It has no runtime npm dependency, so the same vendored file can be loaded by both repository lint configurations without coupling one package install tree to another. | ||
|
|
||
| Upstream is MIT licensed. See `LICENSE` in this directory. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
The changed line calls the GUI check "eslint", but the repository runs Oxlint.
Line 62 reads "GUI eslint and React Doctor portions of the CI gate". The gate runs
lint:gui:if-changed, which invokes Oxlint throughgui/.oxlintrc.json. The vendored plugin directory is named.eslint/only because it holds ESLint-compatible plugin shapes; no ESLint binary runs. A contributor who reads this line will look for an ESLint configuration that does not exist.📝 Proposed wording fix
📝 Committable suggestion
🤖 Prompt for AI Agents