Skip to content

Commit fd361bc

Browse files
committed
Lint fixes
1 parent 745f94c commit fd361bc

File tree

11 files changed

+36
-32
lines changed

11 files changed

+36
-32
lines changed

client/src/api/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ const client = axios.create({
3030
});
3131

3232
client.interceptors.response.use(
33-
(response) => response,
33+
response => response,
3434
(error) => {
3535
if (error.response.status === 401) {
3636
window.location.href = '/#/login';
3737
}
3838
return Promise.reject(error);
39-
}
39+
},
4040
);
4141

4242
client.interceptors.request.use(

client/src/components/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class App extends Component {
1515
this.props.logout(this.props.user);
1616
};
1717

18-
toggle = () => this.setState({isOpen: !this.state.isOpen});
18+
toggle = () => this.setState({ isOpen: !this.state.isOpen });
1919

2020
render() {
2121
const { user } = this.props;

client/src/components/Auth/Login.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { login } from '../../store/api';
1010
export class Login extends Component {
1111
onSubmit = values => this.props.login(values)
1212
.then(this.props.redirect)
13-
.catch(({response}) => {
14-
throw new SubmissionError({_error: response.data.errors.join()});
13+
.catch(({ response }) => {
14+
throw new SubmissionError({ _error: response.data.errors.join() });
1515
});
1616

1717
render() {

client/src/components/Dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class Dashobard extends Component {
2929
<Link to={`/posts/${post.id}`}>{post.title}</Link>
3030
({this.getCategoryForPost(post).name})
3131
{formatDate(post.createdAt)}
32-
</div>
32+
</div>,
3333
)}
3434
</div>
3535
);

client/src/components/Posts/PostList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class PostList extends Component {
5151
<Button tag={Link} to={'/posts/new'}>New Post</Button>
5252

5353
<PostListFilter
54-
initialValues={{category: '', ...resourceList.params.filter}}
54+
initialValues={{ category: '', ...resourceList.params.filter }}
5555
onSubmit={onFilter}
5656
categories={categories}>
5757
</PostListFilter>

client/src/components/UI/CardSingle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React, { Component } from 'react';
22

33
import { Card, CardBlock } from 'reactstrap';
44

5-
export default (props) => (
6-
<Card className="mx-auto" style={{maxWidth: '400px', marginTop: '50px'}}>
5+
export default props => (
6+
<Card className="mx-auto" style={{ maxWidth: '400px', marginTop: '50px' }}>
77
<CardBlock>{props.children}</CardBlock>
88
</Card>
99
);

client/src/components/UI/EditHeader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export default (props) => {
1010
{ !isNew && <Badge color="danger" onClick={onDelete}>X</Badge> }
1111
</h2>
1212
);
13-
}
13+
};

client/src/components/UI/ListTable.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export default (props) => {
1010
const { sort } = resourceList.params;
1111
const sortedAsc = sort && sort[0] !== '-';
1212

13-
const sorted = (attribute) => attribute === sort || `-${attribute}` === sort;
13+
const sorted = attribute => attribute === sort || `-${attribute}` === sort;
1414

15-
const toggleSort = (attribute) => (e) => {
15+
const toggleSort = attribute => (e) => {
1616
if (attribute === sort) {
1717
onSort(sortedAsc ? `-${attribute}` : attribute);
1818
} else {
@@ -28,26 +28,26 @@ export default (props) => {
2828
{columns.map(column =>
2929
<th
3030
key={columnKey(column, 'header')}
31-
style={{minWidth: column.minWidth}}
31+
style={{ minWidth: column.minWidth }}
3232
onClick={column.sortable && toggleSort(column.attribute)}
3333
>
3434
{column.header}&nbsp;
3535
{column.sortable && !sorted(column.attribute) && <i className="fa fa-sort"></i>}
3636
{column.sortable && sorted(column.attribute) && !sortedAsc && <i className="fa fa-sort-desc"></i>}
3737
{column.sortable && sorted(column.attribute) && sortedAsc && <i className="fa fa-sort-asc"></i>}
38-
</th>
38+
</th>,
3939
)}
4040
</tr>
4141
</thead>
4242
<tbody>
4343
{resourceList.data.map(item =>
4444
<tr key={item.id}>
4545
{columns.map(column =>
46-
<td key={columnKey(column, 'row')} style={{minWidth: column.minWidth}}>
46+
<td key={columnKey(column, 'row')} style={{ minWidth: column.minWidth }}>
4747
{column.rowRender ? column.rowRender(item) : item[column.attribute]}
48-
</td>
48+
</td>,
4949
)}
50-
</tr>
50+
</tr>,
5151
)}
5252
</tbody>
5353
</Table>
@@ -61,4 +61,4 @@ export default (props) => {
6161
{resourceList.empty && resourceList.loading && <p>Loading...</p>}
6262
</div>
6363
);
64-
}
64+
};

client/src/components/UI/Pagination.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import React, { Component } from 'react';
2-
import {createUltimatePagination, ITEM_TYPES} from 'react-ultimate-pagination';
2+
import { createUltimatePagination, ITEM_TYPES } from 'react-ultimate-pagination';
33
import { Input, Label } from 'reactstrap';
44

5-
const WrapperComponent = ({children}) => (
5+
const WrapperComponent = ({ children }) => (
66
<ul className="pagination">{children}</ul>
77
);
88

9-
const withPreventDefault = (fn) => (event) => {
9+
const withPreventDefault = fn => (event) => {
1010
event.preventDefault();
1111
fn();
1212
};
1313

14-
const Page = ({value, isActive, onClick}) => (
14+
const Page = ({ value, isActive, onClick }) => (
1515
<li className={isActive ? 'page-item active' : 'page-item'}>
1616
<a className="page-link" href="#" onClick={withPreventDefault(onClick)}>{value}</a>
1717
</li>
1818
);
1919

20-
const createPageLink = children => ({onClick}) => (
20+
const createPageLink = children => ({ onClick }) => (
2121
<li className="page-item">
2222
<a className="page-link" href="#" onClick={withPreventDefault(onClick)}>{children}</a>
2323
</li>
@@ -32,7 +32,10 @@ const itemTypeToComponent = {
3232
[ITEM_TYPES.LAST_PAGE_LINK]: createPageLink(<span>&raquo;</span>),
3333
};
3434

35-
const UltimatePaginationBootstrap4 = createUltimatePagination({itemTypeToComponent, WrapperComponent});
35+
const UltimatePaginationBootstrap4 = createUltimatePagination({
36+
itemTypeToComponent,
37+
WrapperComponent,
38+
});
3639

3740
export default (props) => {
3841
const { resourceList, onPageSize, onPageNumber } = props;
@@ -47,7 +50,7 @@ export default (props) => {
4750
}
4851

4952
return (
50-
<div className="d-flex justify-content-center" style={{height: '50px'}}>
53+
<div className="d-flex justify-content-center" style={{ height: '50px' }}>
5154
<UltimatePaginationBootstrap4
5255
currentPage={currentPage}
5356
totalPages={totalPages}
@@ -56,13 +59,13 @@ export default (props) => {
5659
<Label
5760
for="perPage"
5861
className="align-self-center"
59-
style={{marginLeft: '20px', padding: '8px'}}>Per Page</Label>
60-
<Input type="select" name="perPage" value={size} onChange={onPageSize} style={{width: '60px'}}>
62+
style={{ marginLeft: '20px', padding: '8px' }}>Per Page</Label>
63+
<Input type="select" name="perPage" value={size} onChange={onPageSize} style={{ width: '60px' }}>
6164
<option value="10">10</option>
6265
<option value="20">20</option>
6366
<option value="50">50</option>
6467
<option value="100">100</option>
6568
</Input>
6669
</div>
6770
);
68-
}
71+
};

client/src/hocs/withResourceList.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const withResourceList = resourceKey => (WrappedComponent) => {
3232
const number = 1;
3333
fetchResourceList({ ...params, page: { number, size } });
3434
},
35-
onPageNumber: props => number => {
35+
onPageNumber: props => (number) => {
3636
const { resourceList: { params }, fetchResourceList } = props;
3737
const { page = {} } = params;
3838
fetchResourceList({ ...params, page: { ...page, number } });
@@ -42,7 +42,7 @@ const withResourceList = resourceKey => (WrappedComponent) => {
4242
return (values.id ? updateResource : createResource)(values)
4343
.catch((errors) => { throw new SubmissionError(errors); });
4444
},
45-
onDelete: props => (resource) => (e) => {
45+
onDelete: props => resource => (e) => {
4646
const { deleteResource } = props;
4747
e.preventDefault();
4848
deleteResource(resource);
@@ -56,7 +56,7 @@ const withResourceList = resourceKey => (WrappedComponent) => {
5656

5757
const mapDispatchToProps = dispatch => ({
5858
fetchResourceList: (params = {}) => dispatch(fetchList(resourceKey, params)),
59-
createResource: payload => dispatch(createResource(resourceKey, payload, {list: true})),
59+
createResource: payload => dispatch(createResource(resourceKey, payload, { list: true })),
6060
updateResource: payload => dispatch(updateResource(resourceKey, payload)),
6161
deleteResource: payload => dispatch(deleteResource(resourceKey, payload)),
6262
});

0 commit comments

Comments
 (0)