Skip to content

Commit 27c6c1a

Browse files
sisisinlstkz
authored andcommitted
Bump create-react-app (#3)
* update: bump up cra * fix: remove tslint and fix eslint warnings
1 parent de84a6a commit 27c6c1a

File tree

8 files changed

+2141
-1942
lines changed

8 files changed

+2141
-1942
lines changed

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,19 @@
1414
"react": "16.8.4",
1515
"react-app-rewired": "2.1.1",
1616
"react-dom": "16.8.4",
17-
"react-scripts": "2.1.8",
17+
"react-scripts": "3.0.1",
1818
"redux": "4.0.1",
1919
"redux-logger": "^3.0.6",
2020
"remeda": "^0.0.11",
2121
"rxjs": "6.2.2",
2222
"styled-components": "^4.1.3",
23-
"tslint": "^5.14.0",
24-
"tslint-config-prettier": "^1.18.0",
2523
"typeless": "0.0.18",
2624
"typescript": "^3.3.3333"
2725
},
2826
"scripts": {
2927
"prettier": "prettier --write 'src/**/*.{ts,tsx}'",
3028
"tsc": "tsc",
31-
"lint": "tslint 'src/**/*.{ts,tsx}'",
29+
"lint": "eslint --ext ts,tsx src",
3230
"start": "react-app-rewired start",
3331
"build": "react-app-rewired build",
3432
"test": "react-app-rewired test --env=jsdom",
@@ -43,5 +41,8 @@
4341
"prettier": {
4442
"singleQuote": true,
4543
"trailingComma": "es5"
44+
},
45+
"eslintConfig": {
46+
"extends": "react-app"
4647
}
4748
}

src/components/Link.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { RouterActions } from 'src/features/router/interface';
33
import { useActions } from 'typeless';
44

55
interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
6+
children: any;
67
//
78
}
89

9-
export const Link = (props: LinkProps) => {
10-
const { href, onClick } = props;
10+
export const Link = ({ href, onClick, children, ...others }: LinkProps) => {
1111
const { push } = useActions(RouterActions);
1212
return (
1313
<a
14-
{...props}
14+
{...others}
1515
onClick={e => {
1616
e.preventDefault();
1717
if (href) {
@@ -21,6 +21,8 @@ export const Link = (props: LinkProps) => {
2121
onClick(e);
2222
}
2323
}}
24-
/>
24+
>
25+
{children}
26+
</a>
2527
);
2628
};

src/components/RouteResolver.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export const RouteResolver = () => {
5454
// not found route
5555
// you can display 404 or redirect to default routes
5656
push(user ? '/' : '/login');
57+
58+
// eslint-disable-next-line react-hooks/exhaustive-deps
5759
}, [location, user]);
5860

5961
return component;

src/form/createForm.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ export interface FormResult<TData, TState> {
5959
) => { payload: { field: keyof TData }; meta: { form: string } };
6060
change: (
6161
field: keyof TData,
62+
// eslint-disable-next-line no-undef
6263
value: TData[typeof field]
6364
) => {
65+
// eslint-disable-next-line no-undef
6466
payload: { field: keyof TData; value: TData[typeof field] };
6567
meta: { form: string };
6668
};

src/form/createFormProvider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export function createFormProvider<
1818
Object.assign({}, form, {
1919
actions: { blur, change },
2020
}),
21+
// eslint-disable-next-line react-hooks/exhaustive-deps
2122
[form]
2223
);
2324

src/hooks/usePrevious.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export function usePrevious<T>(value: T) {
55

66
useEffect(() => {
77
ref.current = value;
8+
9+
// eslint-disable-next-line react-hooks/exhaustive-deps
810
}, [value]);
911

1012
return ref.current;

tslint.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)