Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'] : []),
],
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -47,7 +48,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",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/Counter.test.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 1 addition & 0 deletions src/errors/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/* eslint-disable max-classes-per-file */
export class BaseError extends Error {}
export class ParseError extends BaseError {}
1 change: 1 addition & 0 deletions src/hoc/withDelay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface WithDelayOptions {
const withDelay = ({ delay }: WithDelayOptions) => <T extends {}>(Comp: React.ComponentType<T>) => {
const Delay = (props: T) => {
const delayComplete = useDelay(delay);
// eslint-disable-next-line react/jsx-props-no-spreading
return delayComplete ? <Comp {...props} /> : null;
};
return Delay;
Expand Down
9 changes: 2 additions & 7 deletions src/hoc/withErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ interface ErrorBoundaryState {

const errorBoundary = () => <T extends {}>(Component: React.ComponentType<T>) => {
return class ErrorBoundary extends React.Component<T, ErrorBoundaryState> {
constructor(props: T) {
super(props);
this.state = {
hasError: false,
};
}
public state: ErrorBoundaryState = { hasError: false };

static getDerivedStateFromError(error: Error) {
let state: ErrorBoundaryState = { hasError: true };
Expand All @@ -33,7 +28,7 @@ const errorBoundary = () => <T extends {}>(Component: React.ComponentType<T>) =>
render() {
const { hasError, message } = this.state;
return !hasError ? (
<Component {...this.props} />
<Component {...this.props} /> // eslint-disable-line react/jsx-props-no-spreading
) : (
<ErrorMessage>{message || 'Something went wrong'}</ErrorMessage>
);
Expand Down
1 change: 1 addition & 0 deletions src/state/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const createHook = <State, Actions>(
currentState,
dispatch,
]);
// eslint-disable-next-line react/jsx-props-no-spreading
return <Context.Provider value={value} {...props} />;
};

Expand Down
48 changes: 34 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -2384,10 +2404,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"
Expand Down Expand Up @@ -3238,21 +3258,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"

Expand Down