From d51e75ec570626f71ef172061d31871c6f7f7118 Mon Sep 17 00:00:00 2001 From: Matt Davidson Date: Thu, 7 May 2026 13:53:46 -0700 Subject: [PATCH] refactor: replace .bind(this, intent) with arrow fn in Settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Settings is a function component; props.onSubmit.bind(this, intent) binds `this` to undefined (function components have no `this` in strict mode). At runtime it works because the parent's onSubmit is itself bound to the parent class instance, so the inner bind's this=undefined is silently ignored. But oxlint flags every `this` in an exported function (no-this-in-exported-function), and the intent of the code is clearer as a partial-application closure. 4 sites in components/Settings.js: props.onSubmit.bind(this, 'sso') → (e) => props.onSubmit('sso', e) ... and the same for dsync, audit_logs, domain_verification. No runtime behaviour change. Lint warnings drop from 7 to 3. --- components/Settings.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/Settings.js b/components/Settings.js index a01878d..6a70b96 100644 --- a/components/Settings.js +++ b/components/Settings.js @@ -42,7 +42,7 @@ export default function Settings(props) {
-
+ props.onSubmit('sso', e)}>
@@ -70,7 +70,7 @@ export default function Settings(props) {
- + props.onSubmit('dsync', e)}>
@@ -98,7 +98,7 @@ export default function Settings(props) {
- + props.onSubmit('audit_logs', e)}>
@@ -126,7 +126,7 @@ export default function Settings(props) {
- + props.onSubmit('domain_verification', e)}>