Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Disable unicorn/no-this-outside-of-class#287

Merged
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-disable-no-this
Jun 22, 2026
Merged

Disable unicorn/no-this-outside-of-class#287
twschiller merged 1 commit into
mainfrom
ratchet-unicorn-disable-no-this

Conversation

@twschiller

Copy link
Copy Markdown
Contributor

From #279. This rule only fires on legitimate, unavoidable this-outside-a-class in this codebase, so it's turned off rather than left as ~30 standing warnings.

Why off, not ratcheted

All 30 hits are this in standalone functions that must use the dynamic receiver and can't be class methods:

  • Native-prototype monkeypatchesElement.prototype.attachShadow = function (this: Element) {…} and friends (shadow-root interception, defenses)
  • defineProperty get/set accessorsget(this: object) {…} (jsdom test polyfills)
  • Page-world executeScript entry fnsfunction install…(this: Window)
  • webext-messaging handlersgetTabUrl(this: MessengerMeta) {…} (the library's calling convention)

None can be rewritten as a class, so enabling it would mean ~30 inline disables across the most security-sensitive interception code. Pure noise → off.

Change

  • eslint.config.js: no-this-outside-of-class warnoff, grouped with the other disabled rules, with rationale.

Verification

  • bun run check exit 0
  • Drops ~30 standing warnings (eslint warnings: ~298 → 268)

Refs #279

All 30 hits are legitimate, unavoidable `this`-outside-a-class that can't
be class methods: native-prototype monkeypatches (Element.prototype
.attachShadow etc.), defineProperty get/set accessors, page-world
executeScript entry fns (`this: Window`), and webext-messaging handlers.
Every one would need an inline disable, so the rule is pure noise here —
turn it off rather than leave ~30 standing warnings. See #279.

Refs #279

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-browser-shield-demo-site Ready Ready Preview, Comment Jun 22, 2026 12:19pm

Request Review

@twschiller twschiller merged commit d6f88c6 into main Jun 22, 2026
7 checks passed
@twschiller twschiller deleted the ratchet-unicorn-disable-no-this branch June 22, 2026 12:20
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