From 0ba0cc9c61a2ce529a813355699acb66e47a835b Mon Sep 17 00:00:00 2001 From: Victor Zhou Date: Wed, 31 Jul 2019 22:05:23 -0400 Subject: [PATCH] Enable Flow Strict --- .flowconfig | 5 +++++ flow/css-module-stub.js | 2 +- src/cms/index.js | 2 +- src/cms/preview-templates/page-preview.js | 2 +- src/cms/preview-templates/post-preview.js | 2 +- src/components/Feed/Feed.js | 2 +- src/components/Feed/Feed.test.js | 2 +- src/components/Feed/index.js | 2 +- src/components/Icon/Icon.js | 2 +- src/components/Icon/Icon.test.js | 2 +- src/components/Icon/index.js | 2 +- src/components/Layout/Layout.js | 2 +- src/components/Layout/Layout.test.js | 2 +- src/components/Layout/index.js | 2 +- src/components/Page/Page.test.js | 2 +- src/components/Page/index.js | 2 +- src/components/Pagination/Pagination.js | 2 +- src/components/Pagination/Pagination.test.js | 2 +- src/components/Pagination/index.js | 2 +- src/components/Post/Author/Author.js | 2 +- src/components/Post/Author/Author.test.js | 2 +- src/components/Post/Author/index.js | 2 +- src/components/Post/Comments/Comments.js | 2 +- src/components/Post/Comments/Comments.test.js | 2 +- src/components/Post/Comments/index.js | 2 +- src/components/Post/Content/Content.js | 2 +- src/components/Post/Content/Content.test.js | 2 +- src/components/Post/Content/index.js | 2 +- src/components/Post/Meta/Meta.js | 2 +- src/components/Post/Meta/Meta.test.js | 2 +- src/components/Post/Meta/index.js | 2 +- src/components/Post/Post.js | 2 +- src/components/Post/Post.test.js | 2 +- src/components/Post/Tags/Tags.js | 2 +- src/components/Post/Tags/Tags.test.js | 2 +- src/components/Post/Tags/index.js | 2 +- src/components/Post/index.js | 2 +- src/components/Sidebar/Author/Author.js | 4 ++-- src/components/Sidebar/Author/Author.test.js | 2 +- src/components/Sidebar/Author/index.js | 2 +- src/components/Sidebar/Contacts/Contacts.js | 2 +- src/components/Sidebar/Contacts/Contacts.test.js | 2 +- src/components/Sidebar/Contacts/index.js | 2 +- src/components/Sidebar/Copyright/Copyright.js | 4 ++-- src/components/Sidebar/Copyright/Copyright.test.js | 2 +- src/components/Sidebar/Copyright/index.js | 2 +- src/components/Sidebar/Menu/Menu.js | 2 +- src/components/Sidebar/Menu/Menu.test.js | 2 +- src/components/Sidebar/Menu/index.js | 2 +- src/components/Sidebar/Sidebar.js | 2 +- src/components/Sidebar/Sidebar.test.js | 2 +- src/components/Sidebar/index.js | 2 +- src/constants/icons.js | 2 +- src/constants/index.js | 2 +- src/constants/pagination.js | 2 +- src/hooks/index.js | 2 +- src/hooks/use-categories-list.js | 2 +- src/hooks/use-site-metadata.js | 2 +- src/hooks/use-tags-list.js | 2 +- src/templates/categories-list-template.js | 4 ++-- src/templates/categories-list-template.test.js | 2 +- src/templates/category-template.js | 2 +- src/templates/category-template.test.js | 2 +- src/templates/index-template.js | 2 +- src/templates/index-template.test.js | 2 +- src/templates/not-found-template.js | 2 +- src/templates/not-found-template.test.js | 2 +- src/templates/page-template.js | 2 +- src/templates/page-template.test.js | 4 ++-- src/templates/post-template.js | 2 +- src/templates/post-template.test.js | 4 ++-- src/templates/tag-template.js | 2 +- src/templates/tag-template.test.js | 4 ++-- src/templates/tags-list-template.js | 4 ++-- src/templates/tags-list-template.test.js | 2 +- src/types/index.js | 3 ++- src/utils/get-contact-href.js | 2 +- src/utils/get-contact-href.test.js | 2 +- src/utils/get-icon.js | 2 +- src/utils/get-icon.test.js | 2 +- src/utils/index.js | 2 +- 81 files changed, 93 insertions(+), 87 deletions(-) diff --git a/.flowconfig b/.flowconfig index 54fc15e..a1ea32d 100644 --- a/.flowconfig +++ b/.flowconfig @@ -12,3 +12,8 @@ module.name_mapper.extension='scss' -> '/flow/css-module-stub.js' server.max_workers=4 [strict] +nonstrict-import +unclear-type +untyped-type-import +unsafe-getters-setters +sketchy-null diff --git a/flow/css-module-stub.js b/flow/css-module-stub.js index e35bc7a..fae9381 100644 --- a/flow/css-module-stub.js +++ b/flow/css-module-stub.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict type CSSModule = { [key: string]: string, }; diff --git a/src/cms/index.js b/src/cms/index.js index 07e044e..eb6c2a6 100644 --- a/src/cms/index.js +++ b/src/cms/index.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import CMS from 'netlify-cms-app'; import PagePreview from './preview-templates/page-preview'; import PostPreview from './preview-templates/post-preview'; diff --git a/src/cms/preview-templates/page-preview.js b/src/cms/preview-templates/page-preview.js index 416984e..401090a 100644 --- a/src/cms/preview-templates/page-preview.js +++ b/src/cms/preview-templates/page-preview.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import type { Entry, WidgetFor } from '../../types'; diff --git a/src/cms/preview-templates/post-preview.js b/src/cms/preview-templates/post-preview.js index 63aa5e9..ea3093e 100644 --- a/src/cms/preview-templates/post-preview.js +++ b/src/cms/preview-templates/post-preview.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import type { Entry, WidgetFor } from '../../types'; diff --git a/src/components/Feed/Feed.js b/src/components/Feed/Feed.js index fda311d..252323a 100644 --- a/src/components/Feed/Feed.js +++ b/src/components/Feed/Feed.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import moment from 'moment'; import { Link } from 'gatsby'; diff --git a/src/components/Feed/Feed.test.js b/src/components/Feed/Feed.test.js index e08b188..331c172 100644 --- a/src/components/Feed/Feed.test.js +++ b/src/components/Feed/Feed.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Feed from './Feed'; diff --git a/src/components/Feed/index.js b/src/components/Feed/index.js index b00dadd..3ee6568 100644 --- a/src/components/Feed/index.js +++ b/src/components/Feed/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Feed'; diff --git a/src/components/Icon/Icon.js b/src/components/Icon/Icon.js index 2caef61..6210172 100644 --- a/src/components/Icon/Icon.js +++ b/src/components/Icon/Icon.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import styles from './Icon.module.scss'; diff --git a/src/components/Icon/Icon.test.js b/src/components/Icon/Icon.test.js index 67574ec..bf1ee16 100644 --- a/src/components/Icon/Icon.test.js +++ b/src/components/Icon/Icon.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Icon from './Icon'; diff --git a/src/components/Icon/index.js b/src/components/Icon/index.js index 9457c7b..7f6bebc 100644 --- a/src/components/Icon/index.js +++ b/src/components/Icon/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Icon'; diff --git a/src/components/Layout/Layout.js b/src/components/Layout/Layout.js index 98c46ac..b9d5651 100644 --- a/src/components/Layout/Layout.js +++ b/src/components/Layout/Layout.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import Helmet from 'react-helmet'; import type { Node as ReactNode } from 'react'; diff --git a/src/components/Layout/Layout.test.js b/src/components/Layout/Layout.test.js index 1e20a8b..a0ca1c9 100644 --- a/src/components/Layout/Layout.test.js +++ b/src/components/Layout/Layout.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Layout from './Layout'; diff --git a/src/components/Layout/index.js b/src/components/Layout/index.js index 9fd3d43..18f9574 100644 --- a/src/components/Layout/index.js +++ b/src/components/Layout/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Layout'; diff --git a/src/components/Page/Page.test.js b/src/components/Page/Page.test.js index c224288..2327504 100644 --- a/src/components/Page/Page.test.js +++ b/src/components/Page/Page.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Page from './Page'; diff --git a/src/components/Page/index.js b/src/components/Page/index.js index 73f2ad5..a99c3f5 100644 --- a/src/components/Page/index.js +++ b/src/components/Page/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Page'; diff --git a/src/components/Pagination/Pagination.js b/src/components/Pagination/Pagination.js index 7970a82..1b23930 100644 --- a/src/components/Pagination/Pagination.js +++ b/src/components/Pagination/Pagination.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import classNames from 'classnames/bind'; import { Link } from 'gatsby'; diff --git a/src/components/Pagination/Pagination.test.js b/src/components/Pagination/Pagination.test.js index 377f065..a2c3aeb 100644 --- a/src/components/Pagination/Pagination.test.js +++ b/src/components/Pagination/Pagination.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Pagination from './Pagination'; diff --git a/src/components/Pagination/index.js b/src/components/Pagination/index.js index cf8613c..1a3974f 100644 --- a/src/components/Pagination/index.js +++ b/src/components/Pagination/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Pagination'; diff --git a/src/components/Post/Author/Author.js b/src/components/Post/Author/Author.js index c77ac65..f5d8679 100644 --- a/src/components/Post/Author/Author.js +++ b/src/components/Post/Author/Author.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { getContactHref } from '../../../utils'; import styles from './Author.module.scss'; diff --git a/src/components/Post/Author/Author.test.js b/src/components/Post/Author/Author.test.js index 95f0b02..5388cdf 100644 --- a/src/components/Post/Author/Author.test.js +++ b/src/components/Post/Author/Author.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { useStaticQuery, StaticQuery } from 'gatsby'; diff --git a/src/components/Post/Author/index.js b/src/components/Post/Author/index.js index 7fe4910..c5a0cc9 100644 --- a/src/components/Post/Author/index.js +++ b/src/components/Post/Author/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Author'; diff --git a/src/components/Post/Comments/Comments.js b/src/components/Post/Comments/Comments.js index 7a48b10..b2e5bbc 100644 --- a/src/components/Post/Comments/Comments.js +++ b/src/components/Post/Comments/Comments.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import ReactDisqusComments from 'react-disqus-comments'; import { useSiteMetadata } from '../../../hooks'; diff --git a/src/components/Post/Comments/Comments.test.js b/src/components/Post/Comments/Comments.test.js index d1abcb0..39400e2 100644 --- a/src/components/Post/Comments/Comments.test.js +++ b/src/components/Post/Comments/Comments.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { useStaticQuery, StaticQuery } from 'gatsby'; diff --git a/src/components/Post/Comments/index.js b/src/components/Post/Comments/index.js index 4dc4f74..1d5c1b3 100644 --- a/src/components/Post/Comments/index.js +++ b/src/components/Post/Comments/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Comments'; diff --git a/src/components/Post/Content/Content.js b/src/components/Post/Content/Content.js index bd8e55e..ef63e6d 100644 --- a/src/components/Post/Content/Content.js +++ b/src/components/Post/Content/Content.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import styles from './Content.module.scss'; diff --git a/src/components/Post/Content/Content.test.js b/src/components/Post/Content/Content.test.js index 158f752..1a76a22 100644 --- a/src/components/Post/Content/Content.test.js +++ b/src/components/Post/Content/Content.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Content from './Content'; diff --git a/src/components/Post/Content/index.js b/src/components/Post/Content/index.js index c12a20b..9fffb21 100644 --- a/src/components/Post/Content/index.js +++ b/src/components/Post/Content/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Content'; diff --git a/src/components/Post/Meta/Meta.js b/src/components/Post/Meta/Meta.js index 6595cb9..7a09974 100644 --- a/src/components/Post/Meta/Meta.js +++ b/src/components/Post/Meta/Meta.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import moment from 'moment'; import styles from './Meta.module.scss'; diff --git a/src/components/Post/Meta/Meta.test.js b/src/components/Post/Meta/Meta.test.js index d108cd8..69d096c 100644 --- a/src/components/Post/Meta/Meta.test.js +++ b/src/components/Post/Meta/Meta.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Meta from './Meta'; diff --git a/src/components/Post/Meta/index.js b/src/components/Post/Meta/index.js index 411ed6c..c2c06e9 100644 --- a/src/components/Post/Meta/index.js +++ b/src/components/Post/Meta/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Meta'; diff --git a/src/components/Post/Post.js b/src/components/Post/Post.js index f4dea4e..1f5cbb8 100644 --- a/src/components/Post/Post.js +++ b/src/components/Post/Post.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { Link } from 'gatsby'; import Author from './Author'; diff --git a/src/components/Post/Post.test.js b/src/components/Post/Post.test.js index 919b744..7ab6da5 100644 --- a/src/components/Post/Post.test.js +++ b/src/components/Post/Post.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { useStaticQuery, StaticQuery } from 'gatsby'; diff --git a/src/components/Post/Tags/Tags.js b/src/components/Post/Tags/Tags.js index e43a374..f6fe96b 100644 --- a/src/components/Post/Tags/Tags.js +++ b/src/components/Post/Tags/Tags.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { Link } from 'gatsby'; import styles from './Tags.module.scss'; diff --git a/src/components/Post/Tags/Tags.test.js b/src/components/Post/Tags/Tags.test.js index 9d87415..5365eb2 100644 --- a/src/components/Post/Tags/Tags.test.js +++ b/src/components/Post/Tags/Tags.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Tags from './Tags'; diff --git a/src/components/Post/Tags/index.js b/src/components/Post/Tags/index.js index 35f5dca..47998d6 100644 --- a/src/components/Post/Tags/index.js +++ b/src/components/Post/Tags/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Tags'; diff --git a/src/components/Post/index.js b/src/components/Post/index.js index a0bb2aa..c7ef5f4 100644 --- a/src/components/Post/index.js +++ b/src/components/Post/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Post'; diff --git a/src/components/Sidebar/Author/Author.js b/src/components/Sidebar/Author/Author.js index 506d20d..6532ebe 100644 --- a/src/components/Sidebar/Author/Author.js +++ b/src/components/Sidebar/Author/Author.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { withPrefix, Link } from 'gatsby'; import styles from './Author.module.scss'; @@ -24,7 +24,7 @@ const Author = ({ author, isIndex }: Props) => ( /> - { isIndex ? ( + { isIndex === true ? (

{author.name}

diff --git a/src/components/Sidebar/Author/Author.test.js b/src/components/Sidebar/Author/Author.test.js index e5eb527..4e5b0d8 100644 --- a/src/components/Sidebar/Author/Author.test.js +++ b/src/components/Sidebar/Author/Author.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Author from './Author'; diff --git a/src/components/Sidebar/Author/index.js b/src/components/Sidebar/Author/index.js index 7fe4910..c5a0cc9 100644 --- a/src/components/Sidebar/Author/index.js +++ b/src/components/Sidebar/Author/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Author'; diff --git a/src/components/Sidebar/Contacts/Contacts.js b/src/components/Sidebar/Contacts/Contacts.js index e9ed334..a3899fd 100644 --- a/src/components/Sidebar/Contacts/Contacts.js +++ b/src/components/Sidebar/Contacts/Contacts.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { getContactHref, getIcon } from '../../../utils'; import Icon from '../../Icon'; diff --git a/src/components/Sidebar/Contacts/Contacts.test.js b/src/components/Sidebar/Contacts/Contacts.test.js index ce7df32..15cd4d6 100644 --- a/src/components/Sidebar/Contacts/Contacts.test.js +++ b/src/components/Sidebar/Contacts/Contacts.test.js @@ -1,5 +1,5 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Contacts from './Contacts'; diff --git a/src/components/Sidebar/Contacts/index.js b/src/components/Sidebar/Contacts/index.js index e964206..dffcc42 100644 --- a/src/components/Sidebar/Contacts/index.js +++ b/src/components/Sidebar/Contacts/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Contacts'; diff --git a/src/components/Sidebar/Copyright/Copyright.js b/src/components/Sidebar/Copyright/Copyright.js index 60996ef..bee15f5 100644 --- a/src/components/Sidebar/Copyright/Copyright.js +++ b/src/components/Sidebar/Copyright/Copyright.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import styles from './Copyright.module.scss'; @@ -12,4 +12,4 @@ const Copyright = ({ copyright }: Props) => ( ); -export default Copyright; \ No newline at end of file +export default Copyright; diff --git a/src/components/Sidebar/Copyright/Copyright.test.js b/src/components/Sidebar/Copyright/Copyright.test.js index dbc8fea..309492e 100644 --- a/src/components/Sidebar/Copyright/Copyright.test.js +++ b/src/components/Sidebar/Copyright/Copyright.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Copyright from './Copyright'; diff --git a/src/components/Sidebar/Copyright/index.js b/src/components/Sidebar/Copyright/index.js index 08dbf90..11fa644 100644 --- a/src/components/Sidebar/Copyright/index.js +++ b/src/components/Sidebar/Copyright/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Copyright'; diff --git a/src/components/Sidebar/Menu/Menu.js b/src/components/Sidebar/Menu/Menu.js index 474f6ba..0577dd0 100644 --- a/src/components/Sidebar/Menu/Menu.js +++ b/src/components/Sidebar/Menu/Menu.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { Link } from 'gatsby'; import styles from './Menu.module.scss'; diff --git a/src/components/Sidebar/Menu/Menu.test.js b/src/components/Sidebar/Menu/Menu.test.js index b00ecd0..5ac642c 100644 --- a/src/components/Sidebar/Menu/Menu.test.js +++ b/src/components/Sidebar/Menu/Menu.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import Menu from './Menu'; diff --git a/src/components/Sidebar/Menu/index.js b/src/components/Sidebar/Menu/index.js index af74c8e..51b11e5 100644 --- a/src/components/Sidebar/Menu/index.js +++ b/src/components/Sidebar/Menu/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Menu'; diff --git a/src/components/Sidebar/Sidebar.js b/src/components/Sidebar/Sidebar.js index d4d4cd9..433f78f 100644 --- a/src/components/Sidebar/Sidebar.js +++ b/src/components/Sidebar/Sidebar.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import Author from './Author'; import Contacts from './Contacts'; diff --git a/src/components/Sidebar/Sidebar.test.js b/src/components/Sidebar/Sidebar.test.js index 3fd7fa2..33d930e 100644 --- a/src/components/Sidebar/Sidebar.test.js +++ b/src/components/Sidebar/Sidebar.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { useStaticQuery, StaticQuery } from 'gatsby'; diff --git a/src/components/Sidebar/index.js b/src/components/Sidebar/index.js index b0619ed..ab5b9d0 100644 --- a/src/components/Sidebar/index.js +++ b/src/components/Sidebar/index.js @@ -1,2 +1,2 @@ -// @flow +// @flow strict export { default } from './Sidebar'; diff --git a/src/constants/icons.js b/src/constants/icons.js index b8b1248..224c9a4 100644 --- a/src/constants/icons.js +++ b/src/constants/icons.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict const ICONS = { TWITTER: { path: 'M25.312 6.375c-0.688 1-1.547 1.891-2.531 2.609 0.016 0.219 0.016 0.438 0.016 0.656 0 6.672-5.078 14.359-14.359 14.359-2.859 0-5.516-0.828-7.75-2.266 0.406 0.047 0.797 0.063 1.219 0.063 2.359 0 4.531-0.797 6.266-2.156-2.219-0.047-4.078-1.5-4.719-3.5 0.313 0.047 0.625 0.078 0.953 0.078 0.453 0 0.906-0.063 1.328-0.172-2.312-0.469-4.047-2.5-4.047-4.953v-0.063c0.672 0.375 1.453 0.609 2.281 0.641-1.359-0.906-2.25-2.453-2.25-4.203 0-0.938 0.25-1.797 0.688-2.547 2.484 3.062 6.219 5.063 10.406 5.281-0.078-0.375-0.125-0.766-0.125-1.156 0-2.781 2.25-5.047 5.047-5.047 1.453 0 2.766 0.609 3.687 1.594 1.141-0.219 2.234-0.641 3.203-1.219-0.375 1.172-1.172 2.156-2.219 2.781 1.016-0.109 2-0.391 2.906-0.781z', diff --git a/src/constants/index.js b/src/constants/index.js index 2523e9b..33f85fd 100644 --- a/src/constants/index.js +++ b/src/constants/index.js @@ -1,3 +1,3 @@ -// @flow +// @flow strict export { default as ICONS } from './icons'; export { default as PAGINATION } from './pagination'; diff --git a/src/constants/pagination.js b/src/constants/pagination.js index 59f06c0..cc165ad 100644 --- a/src/constants/pagination.js +++ b/src/constants/pagination.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict const PAGINATION = { PREV_PAGE: '← PREV', NEXT_PAGE: '→ NEXT' diff --git a/src/hooks/index.js b/src/hooks/index.js index bbdbfd7..9f072a4 100644 --- a/src/hooks/index.js +++ b/src/hooks/index.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict export { default as useSiteMetadata } from './use-site-metadata'; export { default as useCategoriesList } from './use-categories-list'; export { default as useTagsList } from './use-tags-list'; diff --git a/src/hooks/use-categories-list.js b/src/hooks/use-categories-list.js index 77dca3e..f43035e 100644 --- a/src/hooks/use-categories-list.js +++ b/src/hooks/use-categories-list.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import { useStaticQuery, graphql } from 'gatsby'; const useCategoriesList = () => { diff --git a/src/hooks/use-site-metadata.js b/src/hooks/use-site-metadata.js index 72ec1a2..1b0ca39 100644 --- a/src/hooks/use-site-metadata.js +++ b/src/hooks/use-site-metadata.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import { useStaticQuery, graphql } from 'gatsby'; const useSiteMetadata = () => { diff --git a/src/hooks/use-tags-list.js b/src/hooks/use-tags-list.js index a62a28c..45f1514 100644 --- a/src/hooks/use-tags-list.js +++ b/src/hooks/use-tags-list.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import { useStaticQuery, graphql } from 'gatsby'; const useTagsList = () => { diff --git a/src/templates/categories-list-template.js b/src/templates/categories-list-template.js index 1ec71a1..e37fbf2 100644 --- a/src/templates/categories-list-template.js +++ b/src/templates/categories-list-template.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { Link } from 'gatsby'; import kebabCase from 'lodash/kebabCase'; @@ -29,4 +29,4 @@ const CategoriesListTemplate = () => { ); }; -export default CategoriesListTemplate; \ No newline at end of file +export default CategoriesListTemplate; diff --git a/src/templates/categories-list-template.test.js b/src/templates/categories-list-template.test.js index 995a288..d1461aa 100644 --- a/src/templates/categories-list-template.test.js +++ b/src/templates/categories-list-template.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { useStaticQuery, StaticQuery } from 'gatsby'; diff --git a/src/templates/category-template.js b/src/templates/category-template.js index bc0ddd0..bca7e6f 100644 --- a/src/templates/category-template.js +++ b/src/templates/category-template.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { graphql } from 'gatsby'; import Layout from '../components/Layout'; diff --git a/src/templates/category-template.test.js b/src/templates/category-template.test.js index 121965e..e87bab8 100644 --- a/src/templates/category-template.test.js +++ b/src/templates/category-template.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { useStaticQuery, StaticQuery } from 'gatsby'; diff --git a/src/templates/index-template.js b/src/templates/index-template.js index 1d81311..29102f5 100644 --- a/src/templates/index-template.js +++ b/src/templates/index-template.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { graphql } from 'gatsby'; import Layout from '../components/Layout'; diff --git a/src/templates/index-template.test.js b/src/templates/index-template.test.js index 7473818..6a94f1d 100644 --- a/src/templates/index-template.test.js +++ b/src/templates/index-template.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { StaticQuery, useStaticQuery } from 'gatsby'; diff --git a/src/templates/not-found-template.js b/src/templates/not-found-template.js index 48fe87f..3bc4a83 100644 --- a/src/templates/not-found-template.js +++ b/src/templates/not-found-template.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import Sidebar from '../components/Sidebar'; import Layout from '../components/Layout'; diff --git a/src/templates/not-found-template.test.js b/src/templates/not-found-template.test.js index 6e0e0ec..a48cec1 100644 --- a/src/templates/not-found-template.test.js +++ b/src/templates/not-found-template.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { useStaticQuery, StaticQuery } from 'gatsby'; diff --git a/src/templates/page-template.js b/src/templates/page-template.js index a5f6b1f..abeaefd 100644 --- a/src/templates/page-template.js +++ b/src/templates/page-template.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { graphql } from 'gatsby'; import Layout from '../components/Layout'; diff --git a/src/templates/page-template.test.js b/src/templates/page-template.test.js index 63523ff..d49c099 100644 --- a/src/templates/page-template.test.js +++ b/src/templates/page-template.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { useStaticQuery, StaticQuery } from 'gatsby'; @@ -27,4 +27,4 @@ describe('PageTemplate', () => { const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); -}); \ No newline at end of file +}); diff --git a/src/templates/post-template.js b/src/templates/post-template.js index 0c1c697..593e64d 100644 --- a/src/templates/post-template.js +++ b/src/templates/post-template.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { graphql } from 'gatsby'; import Layout from '../components/Layout'; diff --git a/src/templates/post-template.test.js b/src/templates/post-template.test.js index 9bd8d54..c252cfa 100644 --- a/src/templates/post-template.test.js +++ b/src/templates/post-template.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { useStaticQuery, StaticQuery } from 'gatsby'; @@ -27,4 +27,4 @@ describe('PostTemplate', () => { const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); -}); \ No newline at end of file +}); diff --git a/src/templates/tag-template.js b/src/templates/tag-template.js index 6decf30..4ee9019 100644 --- a/src/templates/tag-template.js +++ b/src/templates/tag-template.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { graphql } from 'gatsby'; import Layout from '../components/Layout'; diff --git a/src/templates/tag-template.test.js b/src/templates/tag-template.test.js index fecd56e..33cb5ff 100644 --- a/src/templates/tag-template.test.js +++ b/src/templates/tag-template.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { useStaticQuery, StaticQuery } from 'gatsby'; @@ -29,4 +29,4 @@ describe('TagTemplate', () => { const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); -}); \ No newline at end of file +}); diff --git a/src/templates/tags-list-template.js b/src/templates/tags-list-template.js index 409312e..409be13 100644 --- a/src/templates/tags-list-template.js +++ b/src/templates/tags-list-template.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import { Link } from 'gatsby'; import kebabCase from 'lodash/kebabCase'; @@ -29,4 +29,4 @@ const TagsListTemplate = () => { ); }; -export default TagsListTemplate; \ No newline at end of file +export default TagsListTemplate; diff --git a/src/templates/tags-list-template.test.js b/src/templates/tags-list-template.test.js index d697644..9cd3fd8 100644 --- a/src/templates/tags-list-template.test.js +++ b/src/templates/tags-list-template.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import React from 'react'; import renderer from 'react-test-renderer'; import { useStaticQuery, StaticQuery } from 'gatsby'; diff --git a/src/types/index.js b/src/types/index.js index 76f8eec..c8835a1 100644 --- a/src/types/index.js +++ b/src/types/index.js @@ -1,7 +1,8 @@ -// @flow +// @flow strict import type { Node as ReactNode } from 'react'; export type RenderCallback = { + // $FlowFixMe render: (data: any) => ReactNode; } diff --git a/src/utils/get-contact-href.js b/src/utils/get-contact-href.js index 2114db8..d9ff2b7 100644 --- a/src/utils/get-contact-href.js +++ b/src/utils/get-contact-href.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict const getContactHref = (name: string, contact: string) => { let href; diff --git a/src/utils/get-contact-href.test.js b/src/utils/get-contact-href.test.js index 0787123..3c3e51a 100644 --- a/src/utils/get-contact-href.test.js +++ b/src/utils/get-contact-href.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import getContactHref from './get-contact-href'; test('getContactHref', () => { diff --git a/src/utils/get-icon.js b/src/utils/get-icon.js index 283cefa..533c853 100644 --- a/src/utils/get-icon.js +++ b/src/utils/get-icon.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import { ICONS } from '../constants'; const getIcon = (name: string) => { diff --git a/src/utils/get-icon.test.js b/src/utils/get-icon.test.js index 1c3d485..c6784f3 100644 --- a/src/utils/get-icon.test.js +++ b/src/utils/get-icon.test.js @@ -1,4 +1,4 @@ -// @flow +// @flow strict import getIcon from './get-icon'; import { ICONS } from '../constants'; diff --git a/src/utils/index.js b/src/utils/index.js index 22881dc..5bf459e 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,3 +1,3 @@ -// @flow +// @flow strict export { default as getIcon } from './get-icon'; export { default as getContactHref } from './get-contact-href';