Просмотр исходного кода

fix: use eslint-ignore comments instead of modifying eslint configuration

Co-Authored-By: Connor Prussin <connor@dourolabs.xyz>
Devin AI 8 месяцев назад
Родитель
Сommit
7021e2e33a

+ 0 - 6
apps/hermes/client/js/.eslintrc.js

@@ -3,10 +3,4 @@ module.exports = {
   parser: "@typescript-eslint/parser",
   plugins: ["@typescript-eslint"],
   extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
-  rules: {
-    "@typescript-eslint/no-unused-vars": [
-      "warn",
-      { argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
-    ],
-  },
 };

+ 2 - 2
apps/hermes/client/js/src/examples/HermesClient.ts

@@ -89,8 +89,8 @@ async function run() {
 
   eventSource.onmessage = (event: MessageEvent<string>) => {
     console.log("Received price update:", event.data);
-    // Variable intentionally unused, prefixed with underscore
-    const _priceUpdate = JSON.parse(event.data) as PriceUpdate;
+    // eslint-disable-next-line @typescript-eslint/no-unused-vars
+    const priceUpdate = JSON.parse(event.data) as PriceUpdate;
   };
 
   eventSource.onerror = (error: Event) => {

+ 3 - 2
price_service/client/js/src/__tests__/connection.e2e.test.ts

@@ -218,10 +218,11 @@ describe("Test websocket endpoints", () => {
       await sleep(20000);
       connection.closeWebSocket();
 
-      let seenOutOfOrder = false;
+      // Check for out of order slots but don't assert on it since it's not stable
       for (let i = 1; i < observedSlots.length; i++) {
         if (observedSlots[i] < observedSlots[i - 1]) {
-          seenOutOfOrder = true;
+          // Out of order slot found, but we don't assert on it
+          break;
         }
       }
 

+ 0 - 1
price_service/sdk/js/.eslintrc.js

@@ -5,6 +5,5 @@ module.exports = {
   extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
   rules: {
     "@typescript-eslint/no-explicit-any": "off",
-    "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }]
   },
 };

+ 4 - 2
price_service/sdk/js/src/__tests__/AccumulatorUpdateData.test.ts

@@ -11,7 +11,8 @@ const TEST_ACCUMULATOR_UPDATE_DATA =
 
 describe("Test parse accumulator update", () => {
   test("Happy path", async () => {
-    const { vaa: _vaa, updates } = parseAccumulatorUpdateData(
+    // eslint-disable-next-line @typescript-eslint/no-unused-vars
+    const { vaa, updates } = parseAccumulatorUpdateData(
       Buffer.from(TEST_ACCUMULATOR_UPDATE_DATA, "base64")
     );
 
@@ -73,7 +74,8 @@ describe("Test parse accumulator update", () => {
       ).updates.length
     ).toBe(3);
 
-    const { vaa: _vaa, updates } = parseAccumulatorUpdateData(
+    // eslint-disable-next-line @typescript-eslint/no-unused-vars
+    const { vaa, updates } = parseAccumulatorUpdateData(
       sliceAccumulatorUpdateData(
         Buffer.from(TEST_ACCUMULATOR_UPDATE_DATA, "base64"),
         1,