From 7a3bad2fcb7362f67d551b7eabe72e63a4baa312 Mon Sep 17 00:00:00 2001 From: Niklas von Hertzen Date: Tue, 1 Aug 2017 18:51:59 +0800 Subject: [PATCH] Add missing Flow tags --- .eslintrc | 7 +++++++ package.json | 3 ++- src/BezierCurve.js | 2 ++ src/Feature.js | 4 ++++ src/Logger.js | 1 + src/index.js | 1 - 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index 024de94..468af03 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,9 +1,16 @@ { "parser": "babel-eslint", "plugins": [ + "flowtype", "prettier" ], "rules": { + "flowtype/boolean-style": [ + 2, + "boolean" + ], + "flowtype/no-weak-types": 2, + "flowtype/delimiter-dangle": 2, "prettier/prettier": ["error", { "singleQuote": true, "bracketSpacing": false, diff --git a/package.json b/package.json index 4b1f543..b815494 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "babel-preset-flow": "6.23.0", "base64-arraybuffer": "0.1.5", "eslint": "4.2.0", - "eslint-plugin-prettier": "^2.1.2", + "eslint-plugin-flowtype": "2.35.0", + "eslint-plugin-prettier": "2.1.2", "flow-bin": "0.50.0", "prettier": "1.5.3", "rimraf": "2.6.1", diff --git a/src/BezierCurve.js b/src/BezierCurve.js index 458125d..c7ec69a 100644 --- a/src/BezierCurve.js +++ b/src/BezierCurve.js @@ -1,3 +1,5 @@ +/* @flow */ +'use strict'; import Vector from './Vector'; export default class BezierCurve { diff --git a/src/Feature.js b/src/Feature.js index b85a36b..b4af35f 100644 --- a/src/Feature.js +++ b/src/Feature.js @@ -1,3 +1,6 @@ +/* @flow */ +'use strict'; + const testRangeBounds = document => { const TEST_HEIGHT = 123; @@ -23,6 +26,7 @@ const testRangeBounds = document => { }; const FEATURES = { + // $FlowFixMe - get/set properties not yet supported get SUPPORT_RANGE_BOUNDS() { 'use strict'; const value = testRangeBounds(document); diff --git a/src/Logger.js b/src/Logger.js index 18d48a7..f75d60c 100644 --- a/src/Logger.js +++ b/src/Logger.js @@ -8,6 +8,7 @@ export default class Logger { this.start = Date.now(); } + // eslint-disable-next-line flowtype/no-weak-types log(...args: any) { Function.prototype.bind .call(window.console.log, window.console) diff --git a/src/index.js b/src/index.js index 9f2ed23..314a4a9 100644 --- a/src/index.js +++ b/src/index.js @@ -10,7 +10,6 @@ import Color from './Color'; export type Options = { async: boolean, imageTimeout: number, - renderer: Function, proxy: string, canvas: HTMLCanvasElement, allowTaint: true