From 6f319dc45a3b0363d9b9bfa1f10e9c160e06ad11 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Thu, 9 Oct 2025 17:12:56 -0700 Subject: [PATCH 1/2] build(eslint-config-fluid): migrate @rushstack/no-new-null to @typescript-eslint/no-restricted-types Replace the Rushstack rule with the equivalent TypeScript ESLint rule as recommended by the TypeScript ESLint migration guide. --- .../build/eslint-config-fluid/minimal-deprecated.js | 13 ++++++++++++- common/build/eslint-config-fluid/recommended.js | 12 +++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/common/build/eslint-config-fluid/minimal-deprecated.js b/common/build/eslint-config-fluid/minimal-deprecated.js index 14859f9da05d..be8aeb3ff3f5 100644 --- a/common/build/eslint-config-fluid/minimal-deprecated.js +++ b/common/build/eslint-config-fluid/minimal-deprecated.js @@ -134,10 +134,21 @@ module.exports = { "@fluid-internal/fluid/no-unchecked-record-access": "error", /** + * Replaced @rushstack/no-new-null with @typescript-eslint/no-restricted-types. * The @rushstack rules are documented in the package README: * {@link https://www.npmjs.com/package/@rushstack/eslint-plugin} */ - "@rushstack/no-new-null": "warn", + "@typescript-eslint/no-restricted-types": [ + "warn", + { + types: { + null: { + message: "Use 'undefined' instead of 'null'", + fixWith: "undefined", + }, + }, + }, + ], /** * RATIONALE: Harmless. diff --git a/common/build/eslint-config-fluid/recommended.js b/common/build/eslint-config-fluid/recommended.js index 5912ac03c0be..3edba16a7857 100644 --- a/common/build/eslint-config-fluid/recommended.js +++ b/common/build/eslint-config-fluid/recommended.js @@ -22,7 +22,17 @@ module.exports = { plugins: ["eslint-plugin-tsdoc"], rules: { // RECOMMENDED RULES - "@rushstack/no-new-null": "error", + "@typescript-eslint/no-restricted-types": [ + "error", + { + types: { + null: { + message: "Use 'undefined' instead of 'null'", + fixWith: "undefined", + }, + }, + }, + ], "no-empty": "error", "no-void": "error", "require-atomic-updates": "error", From d3218eb2932ad33a91a0c694c81b8725523a5b30 Mon Sep 17 00:00:00 2001 From: Tyler Butler Date: Tue, 14 Oct 2025 14:34:32 -0700 Subject: [PATCH 2/2] build --- .../printed-configs/default.json | 14 +++++++++++--- .../printed-configs/minimal.json | 14 +++++++++++--- .../eslint-config-fluid/printed-configs/react.json | 14 +++++++++++--- .../printed-configs/recommended.json | 14 +++++++++++--- .../printed-configs/strict-biome.json | 14 +++++++++++--- .../printed-configs/strict.json | 14 +++++++++++--- .../eslint-config-fluid/printed-configs/test.json | 14 +++++++++++--- 7 files changed, 77 insertions(+), 21 deletions(-) diff --git a/common/build/eslint-config-fluid/printed-configs/default.json b/common/build/eslint-config-fluid/printed-configs/default.json index c42f683dbc7d..9a14be53c2ef 100644 --- a/common/build/eslint-config-fluid/printed-configs/default.json +++ b/common/build/eslint-config-fluid/printed-configs/default.json @@ -56,9 +56,6 @@ "@fluid-internal/fluid/no-unchecked-record-access": [ "error" ], - "@rushstack/no-new-null": [ - "error" - ], "@rushstack/typedef-var": [ "off" ], @@ -837,6 +834,17 @@ ] } ], + "@typescript-eslint/no-restricted-types": [ + "error", + { + "types": { + "null": { + "message": "Use 'undefined' instead of 'null'", + "fixWith": "undefined" + } + } + } + ], "@typescript-eslint/no-shadow": [ "error", { diff --git a/common/build/eslint-config-fluid/printed-configs/minimal.json b/common/build/eslint-config-fluid/printed-configs/minimal.json index a81755cd7e01..4243bc8b31be 100644 --- a/common/build/eslint-config-fluid/printed-configs/minimal.json +++ b/common/build/eslint-config-fluid/printed-configs/minimal.json @@ -56,9 +56,6 @@ "@fluid-internal/fluid/no-unchecked-record-access": [ "error" ], - "@rushstack/no-new-null": [ - "warn" - ], "@rushstack/typedef-var": [ "off" ], @@ -818,6 +815,17 @@ ] } ], + "@typescript-eslint/no-restricted-types": [ + "warn", + { + "types": { + "null": { + "message": "Use 'undefined' instead of 'null'", + "fixWith": "undefined" + } + } + } + ], "@typescript-eslint/no-shadow": [ "error", { diff --git a/common/build/eslint-config-fluid/printed-configs/react.json b/common/build/eslint-config-fluid/printed-configs/react.json index 4a84304af8ce..a7e8eab2440b 100644 --- a/common/build/eslint-config-fluid/printed-configs/react.json +++ b/common/build/eslint-config-fluid/printed-configs/react.json @@ -58,9 +58,6 @@ "@fluid-internal/fluid/no-unchecked-record-access": [ "error" ], - "@rushstack/no-new-null": [ - "error" - ], "@rushstack/typedef-var": [ "off" ], @@ -839,6 +836,17 @@ ] } ], + "@typescript-eslint/no-restricted-types": [ + "error", + { + "types": { + "null": { + "message": "Use 'undefined' instead of 'null'", + "fixWith": "undefined" + } + } + } + ], "@typescript-eslint/no-shadow": [ "error", { diff --git a/common/build/eslint-config-fluid/printed-configs/recommended.json b/common/build/eslint-config-fluid/printed-configs/recommended.json index c42f683dbc7d..9a14be53c2ef 100644 --- a/common/build/eslint-config-fluid/printed-configs/recommended.json +++ b/common/build/eslint-config-fluid/printed-configs/recommended.json @@ -56,9 +56,6 @@ "@fluid-internal/fluid/no-unchecked-record-access": [ "error" ], - "@rushstack/no-new-null": [ - "error" - ], "@rushstack/typedef-var": [ "off" ], @@ -837,6 +834,17 @@ ] } ], + "@typescript-eslint/no-restricted-types": [ + "error", + { + "types": { + "null": { + "message": "Use 'undefined' instead of 'null'", + "fixWith": "undefined" + } + } + } + ], "@typescript-eslint/no-shadow": [ "error", { diff --git a/common/build/eslint-config-fluid/printed-configs/strict-biome.json b/common/build/eslint-config-fluid/printed-configs/strict-biome.json index 403ac0a11557..f3325c38cec1 100644 --- a/common/build/eslint-config-fluid/printed-configs/strict-biome.json +++ b/common/build/eslint-config-fluid/printed-configs/strict-biome.json @@ -80,9 +80,6 @@ "@next/eslint-plugin-next/no-unwanted-polyfillio": [ "off" ], - "@rushstack/no-new-null": [ - "error" - ], "@rushstack/typedef-var": [ "off" ], @@ -880,6 +877,17 @@ ] } ], + "@typescript-eslint/no-restricted-types": [ + "error", + { + "types": { + "null": { + "message": "Use 'undefined' instead of 'null'", + "fixWith": "undefined" + } + } + } + ], "@typescript-eslint/no-shadow": [ "error", { diff --git a/common/build/eslint-config-fluid/printed-configs/strict.json b/common/build/eslint-config-fluid/printed-configs/strict.json index a73b22262417..11a3c57c73ee 100644 --- a/common/build/eslint-config-fluid/printed-configs/strict.json +++ b/common/build/eslint-config-fluid/printed-configs/strict.json @@ -56,9 +56,6 @@ "@fluid-internal/fluid/no-unchecked-record-access": [ "error" ], - "@rushstack/no-new-null": [ - "error" - ], "@rushstack/typedef-var": [ "off" ], @@ -847,6 +844,17 @@ ] } ], + "@typescript-eslint/no-restricted-types": [ + "error", + { + "types": { + "null": { + "message": "Use 'undefined' instead of 'null'", + "fixWith": "undefined" + } + } + } + ], "@typescript-eslint/no-shadow": [ "error", { diff --git a/common/build/eslint-config-fluid/printed-configs/test.json b/common/build/eslint-config-fluid/printed-configs/test.json index 51019cca88bd..1eba12a51dd4 100644 --- a/common/build/eslint-config-fluid/printed-configs/test.json +++ b/common/build/eslint-config-fluid/printed-configs/test.json @@ -56,9 +56,6 @@ "@fluid-internal/fluid/no-unchecked-record-access": [ "error" ], - "@rushstack/no-new-null": [ - "error" - ], "@rushstack/typedef-var": [ "off" ], @@ -828,6 +825,17 @@ ] } ], + "@typescript-eslint/no-restricted-types": [ + "error", + { + "types": { + "null": { + "message": "Use 'undefined' instead of 'null'", + "fixWith": "undefined" + } + } + } + ], "@typescript-eslint/no-shadow": [ "error", {