From 9be58080291c4a2013e8ec9507af4f342a13638c Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Tue, 15 Aug 2017 17:42:39 +0200 Subject: [PATCH] Made pre-commit hook only lint Flow code --- package.json | 9 +++++++-- src/providers/aws/get-aws.js | 2 ++ src/util/copy-to-clipboard.js | 2 ++ yarn.lock | 8 +++++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index cd74e52..fae2365 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "8.0.0-beta.2", "license": "Apache-2.0", "scripts": { - "test": "eslint . && webpack", + "test": "eslint .", "prepublish": "webpack", "lint:staged": "lint-staged", "dev": "webpack -w", @@ -34,7 +34,11 @@ }, "parser": "babel-eslint", "extends": [ - "eslint:recommended" + "eslint:recommended", + "plugin:flowtype/recommended" + ], + "plugins": [ + "flowtype" ], "env": { "es6": true, @@ -102,6 +106,7 @@ "babel-loader": "7.1.1", "babel-plugin-transform-flow-comments": "6.22.0", "eslint": "4.4.1", + "eslint-plugin-flowtype": "^2.35.0", "flow-babel-webpack-plugin": "1.1.0", "lint-staged": "4.0.3", "pre-commit": "1.2.2", diff --git a/src/providers/aws/get-aws.js b/src/providers/aws/get-aws.js index 5fc581f..861b323 100644 --- a/src/providers/aws/get-aws.js +++ b/src/providers/aws/get-aws.js @@ -1,3 +1,5 @@ +// @flow + const aws = require('aws-sdk') const getAWS = authConfig => { diff --git a/src/util/copy-to-clipboard.js b/src/util/copy-to-clipboard.js index e780fbf..75a5097 100644 --- a/src/util/copy-to-clipboard.js +++ b/src/util/copy-to-clipboard.js @@ -1,3 +1,5 @@ +// @flow + const { write } = require('clipboardy') const copyToClipboard = async ( diff --git a/yarn.lock b/yarn.lock index 6b62bca..817bad4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1270,6 +1270,12 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-plugin-flowtype@^2.35.0: + version "2.35.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.35.0.tgz#d17494f0ae8b727c632d8b9d4b4a848e7e0c04af" + dependencies: + lodash "^4.15.0" + eslint-scope@^3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" @@ -2292,7 +2298,7 @@ lodash.merge@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.0.tgz#69884ba144ac33fe699737a6086deffadd0f89c5" -lodash@^4.0.0, lodash@^4.14.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.8.0: +lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.8.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"