diff --git a/common/build/eslint-config-fluid/minimal-deprecated.js b/common/build/eslint-config-fluid/minimal-deprecated.js index d1e4e10f1b32..95e75c580f31 100644 --- a/common/build/eslint-config-fluid/minimal-deprecated.js +++ b/common/build/eslint-config-fluid/minimal-deprecated.js @@ -127,10 +127,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/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", { 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",