Skip to content

Commit 58541b6

Browse files
chrisbobbegnprice
authored andcommitted
flow: Upgrade to v0.175.1
Changelog: https://github.com/facebook/flow/blob/main/Changelog.md#01751 The `signature-verification-failure` changed from a lint rule to a normal error in v0.172.0, so we remove it from the `[lints]` section in the config.
1 parent dbaff9d commit 58541b6

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

.flowconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ nonstrict-import=warn
8383
deprecated-type=warn
8484
unsafe-getters-setters=warn
8585
unnecessary-invariant=warn
86-
signature-verification-failure=warn
8786

8887
; ours
8988
sketchy-number=error
@@ -125,4 +124,4 @@ exact_by_default=true
125124
enums=true
126125

127126
[version]
128-
^0.170.0
127+
^0.175.1

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
"eslint-plugin-prettier": "^4.0.0",
110110
"eslint-plugin-react": "^7.24.0",
111111
"eslint-plugin-react-hooks": "^4.5.0",
112-
"flow-bin": "^0.170.0",
112+
"flow-bin": "^0.175.1",
113113
"flow-coverage-report": "^0.8.0",
114114
"flow-parser": "<0.159.0",
115115
"flow-typed": "^3.3.1",

src/__tests__/lib/exampleData.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,6 @@ export const plusReduxState: GlobalState & PerAccountState = reduxState({
680680
*/
681681
export const reduxStatePlus = (
682682
extra?: $Rest<GlobalState, { ... }>,
683-
// $FlowFixMe[not-an-object]
684683
): GlobalState & PerAccountState =>
685684
dubJointState(deepFreeze({ ...(plusReduxState: GlobalState), ...extra }));
686685

src/storage/__tests__/sqlite-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ describe('expo-sqlite', () => {
243243
expect(await select(db, 'SELECT x FROM foo')).toEqual([{ x: 1 }]);
244244

245245
// $FlowFixMe[prop-missing]
246+
// $FlowFixMe[incompatible-use]
246247
db._db.allowUnhandled();
247248

248249
let _ops = undefined;

src/storage/migrations.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ const migrationsInner: {| [string]: (LessPartialState) => LessPartialState |} =
134134
'10': state => {
135135
const newLocaleNames = { zh: 'zh-Hans', id: 'id-ID' };
136136
// $FlowIgnore[prop-missing]: `locale` renamed to `language` in 31
137-
const { locale } = state.settings;
137+
// $FlowIgnore[incompatible-type]: `locale` renamed to `language` in 31
138+
const locale: string = state.settings.locale;
138139
const newLocale = newLocaleNames[locale] ?? locale;
139140
// $FlowIgnore[prop-missing]
140141
return {
@@ -244,7 +245,8 @@ const migrationsInner: {| [string]: (LessPartialState) => LessPartialState |} =
244245
// Rename locale `id-ID` back to `id`.
245246
'26': state => {
246247
// $FlowIgnore[prop-missing]: `locale` renamed to `language` in 31
247-
const { locale } = state.settings;
248+
// $FlowIgnore[incompatible-type]: `locale` renamed to `language` in 31
249+
const locale: string = state.settings.locale;
248250
const newLocale = locale === 'id-ID' ? 'id' : locale;
249251
// $FlowIgnore[prop-missing]
250252
return {
@@ -299,12 +301,13 @@ const migrationsInner: {| [string]: (LessPartialState) => LessPartialState |} =
299301
// Rename to `state.settings.language` from `state.settings.locale`.
300302
'31': state => {
301303
// $FlowIgnore[prop-missing]: migration fudge
302-
const { locale: language, ...settingsRest } = state.settings;
304+
const { locale, ...settingsRest } = state.settings;
303305
return {
304306
...state,
305307
settings: {
306308
...settingsRest,
307-
language,
309+
// $FlowIgnore[incompatible-cast] - is string when migration runs
310+
language: (locale: string),
308311
},
309312
};
310313
},
@@ -455,7 +458,11 @@ const migrationsInner: {| [string]: (LessPartialState) => LessPartialState |} =
455458
...state,
456459
settings: {
457460
...restSettings,
458-
markMessagesReadOnScroll: (doNotMarkMessagesAsRead: boolean) ? 'never' : 'always',
461+
markMessagesReadOnScroll:
462+
// $FlowIgnore[incompatible-cast] - is boolean when migration runs
463+
(doNotMarkMessagesAsRead: boolean)
464+
? 'never' // newline to narrow FlowIgnore's scope, above
465+
: 'always',
459466
},
460467
};
461468
},

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5837,10 +5837,10 @@ flow-annotation-check@^1.8.1:
58375837
glob "7.1.6"
58385838
load-pkg "^4.0.0"
58395839

5840-
flow-bin@^0.170.0:
5841-
version "0.170.0"
5842-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.170.0.tgz#1da264de9868cc20a338f801bedc370e3e06f5cc"
5843-
integrity sha512-h4qy4f5loKdeLhj7TRM6XQWhmPpnfjDcOg6GPDuJnLAQuB60LJIHZ8QL3hxMf0oA++NkiYx62Vr8oHu+UZ2bGQ==
5840+
flow-bin@^0.175.1:
5841+
version "0.175.1"
5842+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.175.1.tgz#72237070ba4f293f9e04113481e18929c1de50df"
5843+
integrity sha512-zMCP0BPa9BrfBSR7QTcyT/XBwzUbyLdNG0eXvBuNxfHCbMRkUzSceRoOaEZIw+R+GH0UHjVfUvPJ30hXxz1Nfw==
58445844

58455845
flow-coverage-report@^0.8.0:
58465846
version "0.8.0"

0 commit comments

Comments
 (0)