From a2a36e13632e2a81f5a6b9a3dd577d4cd1105cfa Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 10 Aug 2019 16:13:37 +0000 Subject: [PATCH 1/3] Update dependency eslint-config-airbnb to v18 --- package.json | 2 +- yarn.lock | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 98625d13..4281d45a 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "cross-env": "5.2.0", "css-loader": "3.2.0", "eslint": "6.1.0", - "eslint-config-airbnb": "17.1.1", + "eslint-config-airbnb": "18.0.0", "eslint-config-prettier": "6.0.0", "eslint-plugin-import": "2.18.2", "eslint-plugin-jsx-a11y": "6.2.3", diff --git a/yarn.lock b/yarn.lock index 40137061..5a3e1096 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2384,10 +2384,10 @@ concat-stream@^1.5.0: readable-stream "^2.2.2" typedarray "^0.0.6" -confusing-browser-globals@^1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.7.tgz#5ae852bd541a910e7ffb2dbb864a2d21a36ad29b" - integrity sha512-cgHI1azax5ATrZ8rJ+ODDML9Fvu67PimB6aNxBrc/QwSaDaM9eTfIEUHx3bBLJJ82ioSb+/5zfsMCCEJax3ByQ== +confusing-browser-globals@^1.0.7: + version "1.0.8" + resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.8.tgz#93ffec1f82a6e2bf2bc36769cc3a92fa20e502f3" + integrity sha512-lI7asCibVJ6Qd3FGU7mu4sfG4try4LX3+GVS+Gv8UlrEf2AeW57piecapnog2UHZSbcX/P/1UDWVaTsblowlZg== connect-history-api-fallback@^1.6.0: version "1.6.0" @@ -3238,21 +3238,21 @@ escodegen@^1.9.1: optionalDependencies: source-map "~0.6.1" -eslint-config-airbnb-base@^13.2.0: - version "13.2.0" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.2.0.tgz#f6ea81459ff4dec2dda200c35f1d8f7419d57943" - integrity sha512-1mg/7eoB4AUeB0X1c/ho4vb2gYkNH8Trr/EgCT/aGmKhhG+F6vF5s8+iRBlWAzFIAphxIdp3YfEKgEl0f9Xg+w== +eslint-config-airbnb-base@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.0.0.tgz#8a7bcb9643d13c55df4dd7444f138bf4efa61e17" + integrity sha512-2IDHobw97upExLmsebhtfoD3NAKhV4H0CJWP3Uprd/uk+cHuWYOczPVxQ8PxLFUAw7o3Th1RAU8u1DoUpr+cMA== dependencies: - confusing-browser-globals "^1.0.5" + confusing-browser-globals "^1.0.7" object.assign "^4.1.0" object.entries "^1.1.0" -eslint-config-airbnb@17.1.1: - version "17.1.1" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-17.1.1.tgz#2272e0b86bb1e2b138cdf88d07a3b6f4cda3d626" - integrity sha512-xCu//8a/aWqagKljt+1/qAM62BYZeNq04HmdevG5yUGWpja0I/xhqd6GdLRch5oetEGFiJAnvtGuTEAese53Qg== +eslint-config-airbnb@18.0.0: + version "18.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.0.0.tgz#47a50107484b7776b7541fcac4308abbeee1c102" + integrity sha512-C9p7TGMuefhUWPuiObkfF9pytgAA2293bk1n0h7FdazazHNtzATTGkVv7V0gZt1/FTzdCfwWhjGSbRz/KR89og== dependencies: - eslint-config-airbnb-base "^13.2.0" + eslint-config-airbnb-base "^14.0.0" object.assign "^4.1.0" object.entries "^1.1.0" From 08c864e6a0fe41d8a660e3696e1afcf710d474cb Mon Sep 17 00:00:00 2001 From: Drew Schrauf Date: Sun, 11 Aug 2019 14:23:06 +1000 Subject: [PATCH 2/3] Fix linting issues --- src/__tests__/Counter.test.tsx | 2 +- src/errors/index.ts | 1 + src/hoc/withDelay.tsx | 1 + src/hoc/withErrorBoundary.tsx | 9 ++------- src/state/util.tsx | 1 + 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/__tests__/Counter.test.tsx b/src/__tests__/Counter.test.tsx index a3133565..f8c87751 100644 --- a/src/__tests__/Counter.test.tsx +++ b/src/__tests__/Counter.test.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-console */ +/* eslint-disable no-console, react/jsx-props-no-spreading */ import React from 'react'; import { render, fireEvent } from '@testing-library/react'; import set from 'lodash/fp/set'; diff --git a/src/errors/index.ts b/src/errors/index.ts index 8c2b4883..78254e7d 100644 --- a/src/errors/index.ts +++ b/src/errors/index.ts @@ -1,2 +1,3 @@ +/* eslint-disable max-classes-per-file */ export class BaseError extends Error {} export class ParseError extends BaseError {} diff --git a/src/hoc/withDelay.tsx b/src/hoc/withDelay.tsx index f559ba40..988ddb83 100644 --- a/src/hoc/withDelay.tsx +++ b/src/hoc/withDelay.tsx @@ -22,6 +22,7 @@ interface WithDelayOptions { const withDelay = ({ delay }: WithDelayOptions) => (Comp: React.ComponentType) => { const Delay = (props: T) => { const delayComplete = useDelay(delay); + // eslint-disable-next-line react/jsx-props-no-spreading return delayComplete ? : null; }; return Delay; diff --git a/src/hoc/withErrorBoundary.tsx b/src/hoc/withErrorBoundary.tsx index c096981b..b7e37522 100644 --- a/src/hoc/withErrorBoundary.tsx +++ b/src/hoc/withErrorBoundary.tsx @@ -15,12 +15,7 @@ interface ErrorBoundaryState { const errorBoundary = () => (Component: React.ComponentType) => { return class ErrorBoundary extends React.Component { - constructor(props: T) { - super(props); - this.state = { - hasError: false, - }; - } + public state: ErrorBoundaryState = { hasError: false }; static getDerivedStateFromError(error: Error) { let state: ErrorBoundaryState = { hasError: true }; @@ -33,7 +28,7 @@ const errorBoundary = () => (Component: React.ComponentType) => render() { const { hasError, message } = this.state; return !hasError ? ( - + // eslint-disable-line react/jsx-props-no-spreading ) : ( {message || 'Something went wrong'} ); diff --git a/src/state/util.tsx b/src/state/util.tsx index 54942203..48a53470 100644 --- a/src/state/util.tsx +++ b/src/state/util.tsx @@ -39,6 +39,7 @@ export const createHook = ( currentState, dispatch, ]); + // eslint-disable-next-line react/jsx-props-no-spreading return ; }; From 3a47cb1b2c3dbf387edb29bed52648a1a42e79b3 Mon Sep 17 00:00:00 2001 From: Drew Schrauf Date: Sun, 11 Aug 2019 14:33:32 +1000 Subject: [PATCH 3/3] Fix transpilation --- babel.config.js | 1 + package.json | 1 + yarn.lock | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/babel.config.js b/babel.config.js index 50b47c69..79f861fd 100644 --- a/babel.config.js +++ b/babel.config.js @@ -12,6 +12,7 @@ module.exports = { '@babel/preset-typescript', ], plugins: [ + '@babel/plugin-proposal-class-properties', '@babel/plugin-syntax-dynamic-import', ...(process.env.NODE_ENV !== 'production' ? ['babel-plugin-styled-components'] : []), ], diff --git a/package.json b/package.json index 4281d45a..6ee666a6 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ }, "devDependencies": { "@babel/core": "7.5.5", + "@babel/plugin-proposal-class-properties": "^7.5.5", "@babel/plugin-syntax-dynamic-import": "7.2.0", "@babel/preset-env": "7.5.5", "@babel/preset-react": "7.0.0", diff --git a/yarn.lock b/yarn.lock index 5a3e1096..ad89e78d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -122,6 +122,18 @@ "@babel/helper-replace-supers" "^7.4.4" "@babel/helper-split-export-declaration" "^7.4.4" +"@babel/helper-create-class-features-plugin@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.5.5.tgz#401f302c8ddbc0edd36f7c6b2887d8fa1122e5a4" + integrity sha512-ZsxkyYiRA7Bg+ZTRpPvB6AbOFKTFFK4LrvTet8lInm0V468MWCaSYJE+I7v2z2r8KNLtYiV+K5kTCnR7dvyZjg== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-member-expression-to-functions" "^7.5.5" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.5.5" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/helper-define-map@^7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz#3dec32c2046f37e09b28c93eb0b103fd2a25d369" @@ -316,6 +328,14 @@ "@babel/helper-remap-async-to-generator" "^7.1.0" "@babel/plugin-syntax-async-generators" "^7.2.0" +"@babel/plugin-proposal-class-properties@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.5.tgz#a974cfae1e37c3110e71f3c6a2e48b8e71958cd4" + integrity sha512-AF79FsnWFxjlaosgdi421vmYG6/jg79bVD0dpD44QdgobzHKuLZ6S3vl8la9qIeSwGi8i1fS0O1mfuDAAdo1/A== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.5.5" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-proposal-dynamic-import@^7.5.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz#e532202db4838723691b10a67b8ce509e397c506"