From 37f6b09d5be983d272305cc2a8b46066fe3b734b Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Sun, 28 Sep 2025 18:29:33 +0000 Subject: [PATCH] fix(linter/plugins): make `null` a valid value for `meta.fixable` (#14204) `null` is a valid value for `meta.fixable`. Make it so. --- apps/oxlint/src-js/plugins/load.ts | 2 +- apps/oxlint/src-js/plugins/types.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/oxlint/src-js/plugins/load.ts b/apps/oxlint/src-js/plugins/load.ts index 293f886bdd6a4..0994f7c0d7318 100644 --- a/apps/oxlint/src-js/plugins/load.ts +++ b/apps/oxlint/src-js/plugins/load.ts @@ -131,7 +131,7 @@ async function loadPluginImpl(path: string): Promise { let { fixable } = ruleMeta; if (fixable === void 0) { fixable = null; - } else if (fixable !== 'code' && fixable !== 'whitespace') { + } else if (fixable !== null && fixable !== 'code' && fixable !== 'whitespace') { throw new TypeError('Invalid `meta.fixable`'); } diff --git a/apps/oxlint/src-js/plugins/types.ts b/apps/oxlint/src-js/plugins/types.ts index 8bc4af6d68001..bfe672dc49a13 100644 --- a/apps/oxlint/src-js/plugins/types.ts +++ b/apps/oxlint/src-js/plugins/types.ts @@ -43,6 +43,6 @@ export interface EnterExit { // Rule metadata. // TODO: Fill in all properties. export interface RuleMeta { - fixable?: 'code' | 'whitespace'; + fixable?: 'code' | 'whitespace' | null | undefined; [key: string]: unknown; }