diff --git a/.eslintrc b/.eslintrc index 0dac066..71bf1a1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,7 +5,7 @@ "browser": true, "node": true, "mocha": true, - "jest/globals": true + "jest": true }, "plugins": ["flowtype", "jest"], "settings": { diff --git a/__tests__/components/transaction-item.test.js b/__tests__/components/transaction-item.test.js index e8f921d..cbb7601 100644 --- a/__tests__/components/transaction-item.test.js +++ b/__tests__/components/transaction-item.test.js @@ -27,6 +27,7 @@ beforeAll(() => { }); afterAll(() => { global.Date = originalDate; + // $FlowFixMe dateFns.format.mockRestore(); cleanup(); }); diff --git a/__tests__/components/transactions-daily.test.js b/__tests__/components/transactions-daily.test.js index 573f708..01954fa 100644 --- a/__tests__/components/transactions-daily.test.js +++ b/__tests__/components/transactions-daily.test.js @@ -27,6 +27,7 @@ beforeAll(() => { }); afterAll(() => { global.Date = originalDate; + // $FlowFixMe dateFns.format.mockRestore(); cleanup(); }); diff --git a/app/theme/docz.js b/app/theme/docz.js index a5d0b5e..4734702 100644 --- a/app/theme/docz.js +++ b/app/theme/docz.js @@ -5,7 +5,7 @@ import { ThemeProvider } from 'styled-components'; import { appTheme } from './theme'; import { GlobalStyle } from './global'; -export const DoczWrapper = ({ children }: { children: () => Node<*> }) => ( +export const DoczWrapper = ({ children }: { children: () => Node }) => ( diff --git a/app/types/redux.js b/app/types/redux.js index 79d2f12..831cbf3 100644 --- a/app/types/redux.js +++ b/app/types/redux.js @@ -2,7 +2,7 @@ import type { AppState } from './app-state'; -export type Action = { type: $Subtype, payload: Object }; +export type Action = { type: string, payload: Object }; export type GetState = () => AppState; export type Dispatch = (action: Action) => void; export type Middleware = ({ dispatch: Dispatch, getState: GetState }) => ( diff --git a/flow-custom-typedefs/find-process.js b/flow-custom-typedefs/find-process.js new file mode 100644 index 0000000..3e3a15e --- /dev/null +++ b/flow-custom-typedefs/find-process.js @@ -0,0 +1,15 @@ +declare module 'find-process' { + declare type searchType = 'pid' | 'port' | 'name'; + declare type searchValue = string | number; + declare type process = { + pid: number, + ppid: number, + uid: string, + gid: string, + name: string, + bin: string, + cmd: string, + }; + + declare module.exports: (type: searchType, value: searchValue) => Array; +} diff --git a/flow-custom-typedefs/styled-components.js b/flow-custom-typedefs/styled-components.js index 6e977b9..9d1a7ba 100644 --- a/flow-custom-typedefs/styled-components.js +++ b/flow-custom-typedefs/styled-components.js @@ -98,7 +98,7 @@ declare module 'styled-components' { declare type InjectedProps = { theme: Theme | void }; declare export function withTheme>( WrappedComponent: Component, - ): React$ComponentType<$Diff>, InjectedProps>>; + ): React$ComponentType<$Diff, InjectedProps>>; // @HACK This is a cheat to hide that the underlying type is "just a string" // once we know of a better way, we should be able to update this accordingly. @@ -350,7 +350,7 @@ declare module 'styled-components/native' { declare type InjectedProps = { theme: Theme | void }; declare export function withTheme>( WrappedComponent: Component, - ): React$ComponentType<$Diff>, InjectedProps>>; + ): React$ComponentType<$Diff, InjectedProps>>; // @HACK This is a cheat to hide that the underlying type is "just a string" // once we know of a better way, we should be able to update this accordingly. diff --git a/package.json b/package.json index bcb3962..a9aeda3 100644 --- a/package.json +++ b/package.json @@ -159,7 +159,7 @@ "eslint-plugin-jsx-a11y": "^6.0.3", "eslint-plugin-react": "^7.12.4", "file-loader": "^2.0.0", - "flow-bin": "^0.95.1", + "flow-bin": "^0.99.1", "flow-coverage-report": "^0.6.1", "flow-typed": "^2.5.1", "glow": "^1.2.2", diff --git a/yarn.lock b/yarn.lock index 7fdc9f1..65ae53b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6795,10 +6795,10 @@ flow-annotation-check@1.8.1: glob "7.1.1" load-pkg "^3.0.1" -flow-bin@^0.95.1: - version "0.95.1" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.95.1.tgz#633113831ccff4b7ee70a2730f63fc43b69ba85f" - integrity sha512-06IOC/pqPMNRYtC6AMZEWYR9Fi6UdBC7gImGinPuNUpPZFnP5E9/0cBCl3DWrH4zz/gSM2HdDilU7vPGpYIr2w== +flow-bin@^0.99.1: + version "0.99.1" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.99.1.tgz#0d4f413ca84a3a95d0aa64214178684dd7c6a4c5" + integrity sha512-dipNwJlb4MsVt3IuDgPTymCNL4GFoq3pG+GbY6DmBbl0dJPWFSA383rCTmgbfFhoeJ1XCfYBan0BPryToSxiiQ== flow-coverage-report@^0.6.1: version "0.6.1"