Skip to content

Commit d84ad12

Browse files
chrisbobbegnprice
authored andcommitted
eslint: Use better-maintained fork ("ft-flow") of "flowtyped" plugin
This has more recent releases, and the repo lives in the actual Flow Typed org: https://github.com/flow-typed/eslint-plugin-ft-flow (The original, which we've been using until now, lives at https://github.com/gajus/eslint-plugin-flowtype .) Also, the fork brings awareness of Flow enums, so that the "no-undef" rule doesn't give us spurious errors in enum definitions: gajus/eslint-plugin-flowtype#502 (comment) We'd like to use Flow enums soon.
1 parent dde1861 commit d84ad12

File tree

9 files changed

+36
-36
lines changed

9 files changed

+36
-36
lines changed

.eslintrc.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extends:
3030

3131
plugins:
3232
- jest
33-
- flowtype
33+
- ft-flow
3434
# - react-native # see commented-out rules config below
3535

3636
env:
@@ -321,28 +321,28 @@ rules:
321321

322322
#
323323
# ================================================================
324-
# Flow; plugin `flowtype`.
324+
# Flow; plugin `ft-flow`.
325325
#
326326

327-
flowtype/boolean-style: [error, boolean]
328-
flowtype/define-flow-type: warn
329-
flowtype/delimiter-dangle: off
330-
flowtype/no-dupe-keys: error
331-
flowtype/no-primitive-constructor-types: error
332-
flowtype/no-types-missing-file-annotation: error
333-
################# flowtype/no-weak-types: error
334-
# flowtype/require-parameter-type: error
335-
flowtype/require-readonly-react-props: error
336-
# flowtype/require-return-type: [error, always, {annotateUndefined: never}]
337-
flowtype/require-valid-file-annotation: error
338-
flowtype/semi: [error, always]
339-
flowtype/space-before-generic-bracket: [error, never]
340-
flowtype/space-before-type-colon: [error, never]
327+
ft-flow/boolean-style: [error, boolean]
328+
ft-flow/define-flow-type: warn
329+
ft-flow/delimiter-dangle: off
330+
ft-flow/no-dupe-keys: error
331+
ft-flow/no-primitive-constructor-types: error
332+
ft-flow/no-types-missing-file-annotation: error
333+
################# ft-flow/no-weak-types: error
334+
# ft-flow/require-parameter-type: error
335+
ft-flow/require-readonly-react-props: error
336+
# ft-flow/require-return-type: [error, always, {annotateUndefined: never}]
337+
ft-flow/require-valid-file-annotation: error
338+
ft-flow/semi: [error, always]
339+
ft-flow/space-before-generic-bracket: [error, never]
340+
ft-flow/space-before-type-colon: [error, never]
341341
# For more formatting rules, see tools/formatting.eslintrc.yaml.
342-
flowtype/type-id-match: [error, '^([A-Z][a-z0-9]+)+$']
343-
flowtype/union-intersection-spacing: [error, always]
344-
flowtype/use-flow-type: warn
345-
flowtype/valid-syntax: warn
342+
ft-flow/type-id-match: [error, '^([A-Z][a-z0-9]+)+$']
343+
ft-flow/union-intersection-spacing: [error, always]
344+
ft-flow/use-flow-type: warn
345+
ft-flow/valid-syntax: warn
346346

347347
overrides:
348348

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"eslint": "^8.15.0",
9696
"eslint-config-airbnb": "^19.0.4",
9797
"eslint-config-prettier": "^8.5.0",
98-
"eslint-plugin-flowtype": "^8.0.3",
98+
"eslint-plugin-ft-flow": "^2.0.1",
9999
"eslint-plugin-import": "^2.22.1",
100100
"eslint-plugin-jest": "^26.1.5",
101101
"eslint-plugin-jsx-a11y": "^6.4.1",

src/api/modelTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export type * from './idTypes';
2727
* CustomProfileFieldTypeValues for a list of values.
2828
*/
2929
// This is an enum; see discussion on other enums.
30-
// eslint-disable-next-line flowtype/type-id-match
30+
// eslint-disable-next-line ft-flow/type-id-match
3131
export type CustomProfileFieldTypeT = 1 | 2 | 3 | 4 | 5 | 6 | 7;
3232

3333
/**

src/api/permissionsTypes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { objectValues } from '../flowPonyfill';
1111
// Or we could leapfrog TS and make this a Flow enum:
1212
// https://flow.org/en/docs/enums/
1313
// (TS has its own enums, but they are a mess.)
14-
// eslint-disable-next-line flowtype/type-id-match
14+
// eslint-disable-next-line ft-flow/type-id-match
1515
export type RoleT = 100 | 200 | 300 | 400 | 600;
1616

1717
/**
@@ -49,7 +49,7 @@ export const RoleValues: $ReadOnlyArray<RoleT> = objectValues(Role);
4949
*
5050
* For the policy for web-public streams, see CreateWebPublicStreamPolicyT.
5151
*/
52-
// eslint-disable-next-line flowtype/type-id-match
52+
// eslint-disable-next-line ft-flow/type-id-match
5353
export type CreatePublicOrPrivateStreamPolicyT = 1 | 2 | 3 | 4;
5454

5555
/**
@@ -94,7 +94,7 @@ export const CreatePublicOrPrivateStreamPolicyValues: $ReadOnlyArray<CreatePubli
9494
// Or we could leapfrog TS and make this a Flow enum:
9595
// https://flow.org/en/docs/enums/
9696
// (TS has its own enums, but they are a mess.)
97-
// eslint-disable-next-line flowtype/type-id-match
97+
// eslint-disable-next-line ft-flow/type-id-match
9898
export type CreateWebPublicStreamPolicyT = 2 | 4 | 6 | 7;
9999

100100
/**

src/storage/sqlite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import invariant from 'invariant';
1010
/* eslint-disable no-use-before-define */
1111
/* eslint-disable no-underscore-dangle */
1212
/* eslint-disable no-void */
13-
/* eslint-disable flowtype/type-id-match */
13+
/* eslint-disable ft-flow/type-id-match */
1414

1515
type SQLArgument = number | string;
1616

src/utils/jsonable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* @flow strict */
2-
/* eslint-disable flowtype/type-id-match */
2+
/* eslint-disable ft-flow/type-id-match */
33

44
/**
55
* Type of a round-trip-capable JSONable object.

tools/flow-todo.eslintrc.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
parser: babel-eslint
22
plugins:
3-
- flowtype
3+
- ft-flow
44
rules:
5-
flowtype/no-weak-types: error
6-
flowtype/require-parameter-type:
5+
ft-flow/no-weak-types: error
6+
ft-flow/require-parameter-type:
77
- error
88
- excludeArrowFunctions: true
9-
flowtype/require-return-type:
9+
ft-flow/require-return-type:
1010
- error
1111
- always
1212
- excludeArrowFunctions: true

tools/formatting.eslintrc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
parser: "@babel/eslint-parser"
66

77
plugins:
8-
- flowtype
8+
- ft-flow
99
- import
1010
- jest
1111
- react

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4671,10 +4671,10 @@ eslint-module-utils@^2.7.3:
46714671
debug "^3.2.7"
46724672
find-up "^2.1.0"
46734673

4674-
eslint-plugin-flowtype@^8.0.3:
4675-
version "8.0.3"
4676-
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-8.0.3.tgz#e1557e37118f24734aa3122e7536a038d34a4912"
4677-
integrity sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ==
4674+
eslint-plugin-ft-flow@^2.0.1:
4675+
version "2.0.1"
4676+
resolved "https://registry.yarnpkg.com/eslint-plugin-ft-flow/-/eslint-plugin-ft-flow-2.0.1.tgz#57d9a12ef02b7af8f9bd6ccd6bd8fa4034809716"
4677+
integrity sha512-dGBnCo+ok6H9p6Vw2oPFEM4vA9IEclRXQQAA/Zws51/L5zr3FDl9FxQiWGfaw0WaTIX5biiAxp/q1W5bGXjlVA==
46784678
dependencies:
46794679
lodash "^4.17.21"
46804680
string-natural-compare "^3.0.1"

0 commit comments

Comments
 (0)