From f39418e6e5784583d1bb108b61eae8bac92ed420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Zl=C3=A1mal?= Date: Mon, 5 Apr 2021 20:10:04 -0500 Subject: [PATCH] Eslint config: migrate to the new 'flowtype/use-read-only-spread' rule This change finishes a migration from our custom `adeira/flow-use-readonly-spread` rule to the official `flowtype/use-read-only-spread` rule. The behavior should stay unchanged since the underlying code is basically identical. See: https://github.com/gajus/eslint-plugin-flowtype/pull/472 adeira-source-id: bf37c3e6bc3e80b54d97f1c9ac3157139fe76243 --- src/ResponseError.js | 4 ++-- src/fetchWithRetries.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ResponseError.js b/src/ResponseError.js index 2c6f416..bd52531 100644 --- a/src/ResponseError.js +++ b/src/ResponseError.js @@ -2,11 +2,11 @@ import setPrototypeOf from './setPrototypeOf'; -type ResponseErrorType = { +type ResponseErrorType = $ReadOnly<{ ...Error, +response: Response, ... -}; +}>; /** * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Custom_Error_Types diff --git a/src/fetchWithRetries.js b/src/fetchWithRetries.js index eb6c9b9..7f4da50 100644 --- a/src/fetchWithRetries.js +++ b/src/fetchWithRetries.js @@ -6,11 +6,11 @@ import fetch from './fetch'; import TimeoutError from './TimeoutError'; import ResponseError from './ResponseError'; -type InitWithRetries = {| +type InitWithRetries = $ReadOnly<{| ...$Exact, +fetchTimeout?: number, +retryDelays?: $ReadOnlyArray, -|}; +|}>; const DEFAULT_TIMEOUT = 15000; const DEFAULT_RETRIES = [1000, 3000];