From 4f66f0a5f110629c0a8541f7377cba329bd2f4fb Mon Sep 17 00:00:00 2001 From: Rishhi Balakrishnan <107130183+RishhiB@users.noreply.github.com> Date: Thu, 2 Jan 2025 23:47:30 +0000 Subject: [PATCH] Enable no-unchecked-record-access for client packages --- azure/packages/test/scenario-runner/.eslintrc.cjs | 2 +- experimental/dds/attributable-map/.eslintrc.cjs | 2 +- experimental/dds/sequence-deprecated/.eslintrc.cjs | 2 +- packages/dds/map/.eslintrc.cjs | 2 +- packages/dds/matrix/.eslintrc.cjs | 2 +- packages/dds/merge-tree/.eslintrc.cjs | 2 +- packages/dds/sequence/.eslintrc.cjs | 2 +- packages/dds/tree/.eslintrc.cjs | 2 +- packages/drivers/driver-web-cache/.eslintrc.cjs | 2 +- packages/drivers/odsp-driver/.eslintrc.cjs | 2 +- packages/drivers/replay-driver/.eslintrc.cjs | 2 +- packages/drivers/routerlicious-driver/.eslintrc.cjs | 2 +- packages/framework/presence/.eslintrc.cjs | 2 ++ packages/loader/driver-utils/.eslintrc.cjs | 2 +- packages/runtime/container-runtime/.eslintrc.cjs | 2 +- packages/runtime/id-compressor/.eslintrc.cjs | 2 +- packages/runtime/runtime-utils/.eslintrc.cjs | 2 +- packages/test/functional-tests/.eslintrc.cjs | 2 +- packages/test/local-server-tests/.eslintrc.cjs | 2 +- packages/test/test-drivers/.eslintrc.cjs | 2 +- packages/test/test-end-to-end-tests/.eslintrc.cjs | 2 +- packages/test/test-service-load/.eslintrc.cjs | 2 +- packages/test/test-utils/.eslintrc.cjs | 2 +- packages/tools/devtools/devtools-core/.eslintrc.cjs | 2 +- packages/tools/devtools/devtools-example/.eslintrc.cjs | 2 +- packages/tools/devtools/devtools-view/.eslintrc.cjs | 2 +- packages/tools/fetch-tool/.eslintrc.cjs | 2 +- 27 files changed, 28 insertions(+), 26 deletions(-) diff --git a/azure/packages/test/scenario-runner/.eslintrc.cjs b/azure/packages/test/scenario-runner/.eslintrc.cjs index e763cfe15d7b..950de68bf24d 100644 --- a/azure/packages/test/scenario-runner/.eslintrc.cjs +++ b/azure/packages/test/scenario-runner/.eslintrc.cjs @@ -12,7 +12,7 @@ module.exports = { "prefer-arrow-callback": "off", "@typescript-eslint/strict-boolean-expressions": "off", // requires strictNullChecks=true in tsconfig "import/no-nodejs-modules": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, parserOptions: { project: ["./tsconfig.json", "./src/test/tsconfig.json"], diff --git a/experimental/dds/attributable-map/.eslintrc.cjs b/experimental/dds/attributable-map/.eslintrc.cjs index c155127959ac..cf1a805251d1 100644 --- a/experimental/dds/attributable-map/.eslintrc.cjs +++ b/experimental/dds/attributable-map/.eslintrc.cjs @@ -17,6 +17,6 @@ module.exports = { // TODO: consider re-enabling once we have addressed how this rule conflicts with our error codes. "unicorn/numeric-separators-style": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, }; diff --git a/experimental/dds/sequence-deprecated/.eslintrc.cjs b/experimental/dds/sequence-deprecated/.eslintrc.cjs index 145e4cb2fdc2..a8cc8dcddcf3 100644 --- a/experimental/dds/sequence-deprecated/.eslintrc.cjs +++ b/experimental/dds/sequence-deprecated/.eslintrc.cjs @@ -15,6 +15,6 @@ module.exports = { "import/no-deprecated": "off", // This package uses deprecated APIs by design. "@typescript-eslint/no-use-before-define": "off", "@typescript-eslint/strict-boolean-expressions": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, }; diff --git a/packages/dds/map/.eslintrc.cjs b/packages/dds/map/.eslintrc.cjs index c3fd19a9ba22..a85070955165 100644 --- a/packages/dds/map/.eslintrc.cjs +++ b/packages/dds/map/.eslintrc.cjs @@ -14,7 +14,7 @@ module.exports = { // TODO: consider re-enabling once we have addressed how this rule conflicts with our error codes. "unicorn/numeric-separators-style": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, overrides: [ { diff --git a/packages/dds/matrix/.eslintrc.cjs b/packages/dds/matrix/.eslintrc.cjs index 8936746eb678..f653b972994c 100644 --- a/packages/dds/matrix/.eslintrc.cjs +++ b/packages/dds/matrix/.eslintrc.cjs @@ -12,7 +12,7 @@ module.exports = { rules: { "@typescript-eslint/no-shadow": "off", "space-before-function-paren": "off", // Off because it conflicts with typescript-formatter - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, overrides: [ { diff --git a/packages/dds/merge-tree/.eslintrc.cjs b/packages/dds/merge-tree/.eslintrc.cjs index fd0c39169dd0..0be508b7aeaa 100644 --- a/packages/dds/merge-tree/.eslintrc.cjs +++ b/packages/dds/merge-tree/.eslintrc.cjs @@ -15,6 +15,6 @@ module.exports = { "no-case-declarations": "off", "prefer-arrow/prefer-arrow-functions": "off", "unicorn/no-useless-spread": "off", // Off because it generates incorrect code in autofixes and cannot distinguish useful copies of arrays from useless ones - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, }; diff --git a/packages/dds/sequence/.eslintrc.cjs b/packages/dds/sequence/.eslintrc.cjs index 29d7b99306d1..9c539682f5f1 100644 --- a/packages/dds/sequence/.eslintrc.cjs +++ b/packages/dds/sequence/.eslintrc.cjs @@ -14,7 +14,7 @@ module.exports = { rules: { "@typescript-eslint/no-use-before-define": "off", "@typescript-eslint/strict-boolean-expressions": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, settings: { "import/extensions": [".ts", ".tsx", ".d.ts", ".js", ".jsx"], diff --git a/packages/dds/tree/.eslintrc.cjs b/packages/dds/tree/.eslintrc.cjs index 3bd3d011bc37..57914096a9df 100644 --- a/packages/dds/tree/.eslintrc.cjs +++ b/packages/dds/tree/.eslintrc.cjs @@ -11,7 +11,7 @@ module.exports = { rules: { "@typescript-eslint/no-namespace": "off", "@typescript-eslint/no-empty-interface": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", // This package is build with noUnusedLocals disabled for a specific use case (see note in tsconfig.json), // but should reject other cases using this rule: diff --git a/packages/drivers/driver-web-cache/.eslintrc.cjs b/packages/drivers/driver-web-cache/.eslintrc.cjs index 57a6eaf3fc2f..66e85b25a0b4 100644 --- a/packages/drivers/driver-web-cache/.eslintrc.cjs +++ b/packages/drivers/driver-web-cache/.eslintrc.cjs @@ -17,6 +17,6 @@ module.exports = { "@typescript-eslint/strict-boolean-expressions": "off", "@typescript-eslint/promise-function-async": "off", "@typescript-eslint/no-misused-promises": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, }; diff --git a/packages/drivers/odsp-driver/.eslintrc.cjs b/packages/drivers/odsp-driver/.eslintrc.cjs index 6758df724712..26642ac1ca84 100644 --- a/packages/drivers/odsp-driver/.eslintrc.cjs +++ b/packages/drivers/odsp-driver/.eslintrc.cjs @@ -16,7 +16,7 @@ module.exports = { // This library uses and serializes "utf-8". "unicorn/text-encoding-identifier-case": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, overrides: [ { diff --git a/packages/drivers/replay-driver/.eslintrc.cjs b/packages/drivers/replay-driver/.eslintrc.cjs index a8f260775d3c..1d56de9a2f4e 100644 --- a/packages/drivers/replay-driver/.eslintrc.cjs +++ b/packages/drivers/replay-driver/.eslintrc.cjs @@ -10,6 +10,6 @@ module.exports = { ], rules: { "@typescript-eslint/strict-boolean-expressions": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, }; diff --git a/packages/drivers/routerlicious-driver/.eslintrc.cjs b/packages/drivers/routerlicious-driver/.eslintrc.cjs index 1f213a985b45..9512602efd60 100644 --- a/packages/drivers/routerlicious-driver/.eslintrc.cjs +++ b/packages/drivers/routerlicious-driver/.eslintrc.cjs @@ -15,6 +15,6 @@ module.exports = { "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/strict-boolean-expressions": "off", "no-case-declarations": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, }; diff --git a/packages/framework/presence/.eslintrc.cjs b/packages/framework/presence/.eslintrc.cjs index 3e874fdd454b..48e623a26449 100644 --- a/packages/framework/presence/.eslintrc.cjs +++ b/packages/framework/presence/.eslintrc.cjs @@ -16,6 +16,8 @@ module.exports = { // The clarity of explicit index signatures is helpful in many places with this package. "@typescript-eslint/consistent-indexed-object-style": "off", + "@fluid-internal/fluid/no-unchecked-record-access": "error", + // TODO: Reenable no-explicit-any once need with ValueDirectoryOrState is // understood. If `any` is still needed disable is on a per line basis. "@typescript-eslint/no-explicit-any": "off", diff --git a/packages/loader/driver-utils/.eslintrc.cjs b/packages/loader/driver-utils/.eslintrc.cjs index 99682a2f1793..dc34263219f9 100644 --- a/packages/loader/driver-utils/.eslintrc.cjs +++ b/packages/loader/driver-utils/.eslintrc.cjs @@ -13,7 +13,7 @@ module.exports = { }, rules: { "import/no-nodejs-modules": ["error"], - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, overrides: [ { diff --git a/packages/runtime/container-runtime/.eslintrc.cjs b/packages/runtime/container-runtime/.eslintrc.cjs index 0cfb8c689f85..7a9db3d078ba 100644 --- a/packages/runtime/container-runtime/.eslintrc.cjs +++ b/packages/runtime/container-runtime/.eslintrc.cjs @@ -13,7 +13,7 @@ module.exports = { }, rules: { "@typescript-eslint/strict-boolean-expressions": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, overrides: [ { diff --git a/packages/runtime/id-compressor/.eslintrc.cjs b/packages/runtime/id-compressor/.eslintrc.cjs index 0cfb8c689f85..7a9db3d078ba 100644 --- a/packages/runtime/id-compressor/.eslintrc.cjs +++ b/packages/runtime/id-compressor/.eslintrc.cjs @@ -13,7 +13,7 @@ module.exports = { }, rules: { "@typescript-eslint/strict-boolean-expressions": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, overrides: [ { diff --git a/packages/runtime/runtime-utils/.eslintrc.cjs b/packages/runtime/runtime-utils/.eslintrc.cjs index c489a4dd5f2d..19322ec98243 100644 --- a/packages/runtime/runtime-utils/.eslintrc.cjs +++ b/packages/runtime/runtime-utils/.eslintrc.cjs @@ -12,6 +12,6 @@ module.exports = { project: ["./tsconfig.json", "./src/test/tsconfig.json"], }, rules: { - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, }; diff --git a/packages/test/functional-tests/.eslintrc.cjs b/packages/test/functional-tests/.eslintrc.cjs index 815f87590ff4..92d9c0e8f2bf 100644 --- a/packages/test/functional-tests/.eslintrc.cjs +++ b/packages/test/functional-tests/.eslintrc.cjs @@ -9,7 +9,7 @@ module.exports = { "prettier", ], rules: { - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, overrides: [ { diff --git a/packages/test/local-server-tests/.eslintrc.cjs b/packages/test/local-server-tests/.eslintrc.cjs index 13a408a0973b..a6a0499e3bf7 100644 --- a/packages/test/local-server-tests/.eslintrc.cjs +++ b/packages/test/local-server-tests/.eslintrc.cjs @@ -11,7 +11,7 @@ module.exports = { rules: { "@typescript-eslint/strict-boolean-expressions": "off", // requires strictNullChecks=true in tsconfig "import/no-nodejs-modules": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", "import/no-extraneous-dependencies": [ "error", { diff --git a/packages/test/test-drivers/.eslintrc.cjs b/packages/test/test-drivers/.eslintrc.cjs index f35e95f32e54..4126128c8322 100644 --- a/packages/test/test-drivers/.eslintrc.cjs +++ b/packages/test/test-drivers/.eslintrc.cjs @@ -13,6 +13,6 @@ module.exports = { }, rules: { "import/no-nodejs-modules": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, }; diff --git a/packages/test/test-end-to-end-tests/.eslintrc.cjs b/packages/test/test-end-to-end-tests/.eslintrc.cjs index f7af4907730c..5b84c0090578 100644 --- a/packages/test/test-end-to-end-tests/.eslintrc.cjs +++ b/packages/test/test-end-to-end-tests/.eslintrc.cjs @@ -14,7 +14,7 @@ module.exports = { rules: { "prefer-arrow-callback": "off", "@typescript-eslint/strict-boolean-expressions": "off", // requires strictNullChecks=true in tsconfig - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", // This library is used in the browser, so we don't want dependencies on most node libraries. "import/no-nodejs-modules": ["error"], diff --git a/packages/test/test-service-load/.eslintrc.cjs b/packages/test/test-service-load/.eslintrc.cjs index afffe3928fff..0b4fccc7e796 100644 --- a/packages/test/test-service-load/.eslintrc.cjs +++ b/packages/test/test-service-load/.eslintrc.cjs @@ -13,6 +13,6 @@ module.exports = { }, rules: { "import/no-nodejs-modules": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, }; diff --git a/packages/test/test-utils/.eslintrc.cjs b/packages/test/test-utils/.eslintrc.cjs index afffe3928fff..0b4fccc7e796 100644 --- a/packages/test/test-utils/.eslintrc.cjs +++ b/packages/test/test-utils/.eslintrc.cjs @@ -13,6 +13,6 @@ module.exports = { }, rules: { "import/no-nodejs-modules": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, }; diff --git a/packages/tools/devtools/devtools-core/.eslintrc.cjs b/packages/tools/devtools/devtools-core/.eslintrc.cjs index 346908b00ef0..25490b516b36 100644 --- a/packages/tools/devtools/devtools-core/.eslintrc.cjs +++ b/packages/tools/devtools/devtools-core/.eslintrc.cjs @@ -14,7 +14,7 @@ module.exports = { // Disabled because it is incompatible with API-Extractor. "@typescript-eslint/no-namespace": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, overrides: [ { diff --git a/packages/tools/devtools/devtools-example/.eslintrc.cjs b/packages/tools/devtools/devtools-example/.eslintrc.cjs index 4415b3806042..5c5f72516116 100644 --- a/packages/tools/devtools/devtools-example/.eslintrc.cjs +++ b/packages/tools/devtools/devtools-example/.eslintrc.cjs @@ -26,7 +26,7 @@ module.exports = { // TODO: AB#18875 - Re-enable react/no-deprecated once we replace uses of the deprecated ReactDOM.render() // with the new React 18 createRoot(). "react/no-deprecated": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, overrides: [ { diff --git a/packages/tools/devtools/devtools-view/.eslintrc.cjs b/packages/tools/devtools/devtools-view/.eslintrc.cjs index db321f388876..ad120e0a8480 100644 --- a/packages/tools/devtools/devtools-view/.eslintrc.cjs +++ b/packages/tools/devtools/devtools-view/.eslintrc.cjs @@ -18,7 +18,7 @@ module.exports = { // Disabled because they disagrees with React common patterns / best practices. "@typescript-eslint/unbound-method": "off", "unicorn/consistent-function-scoping": "off", - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", // Disabled because they conflict with Prettier. "unicorn/no-nested-ternary": "off", diff --git a/packages/tools/fetch-tool/.eslintrc.cjs b/packages/tools/fetch-tool/.eslintrc.cjs index 954133a1982e..ba4f62cec180 100644 --- a/packages/tools/fetch-tool/.eslintrc.cjs +++ b/packages/tools/fetch-tool/.eslintrc.cjs @@ -11,6 +11,6 @@ module.exports = { rules: { // This library is used in the browser, so we don't want dependencies on most node libraries. "import/no-nodejs-modules": ["error", { allow: ["child_process", "fs", "util"] }], - "@fluid-internal/fluid/no-unchecked-record-access": "warn", + "@fluid-internal/fluid/no-unchecked-record-access": "error", }, };