Skip to content

Commit f202d3b

Browse files
committed
chore: Apply latest version of prettier
1 parent c3b4362 commit f202d3b

File tree

8 files changed

+44
-39
lines changed

8 files changed

+44
-39
lines changed

examples/basic-example/app.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,7 @@ class App extends Component {
216216
return (
217217
<div>
218218
<section className={styles['page-header']}>
219-
<h1 className={styles['project-name']}>
220-
{projectName}
221-
</h1>
219+
<h1 className={styles['project-name']}>{projectName}</h1>
222220

223221
<h2 className={styles['project-tagline']}>
224222
Drag-and-drop sortable representation of hierarchical data

examples/basic-example/stylesheets/app.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@import "./vendor/stylesheet";
2-
@import "./vendor/github-light";
1+
@import './vendor/stylesheet';
2+
@import './vendor/github-light';
33

44
.page-header {
55
padding: 1rem 6rem;

examples/storybooks/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import TreeDataIOExample from './tree-data-io';
1515
import TreeToTreeExample from './tree-to-tree';
1616
import styles from './generic.scss';
1717

18-
const wrapWithSource = (node, src) =>
18+
const wrapWithSource = (node, src) => (
1919
<div>
2020
{node}
2121

@@ -28,7 +28,8 @@ const wrapWithSource = (node, src) =>
2828
>
2929
VIEW SOURCE →
3030
</a>
31-
</div>;
31+
</div>
32+
);
3233

3334
storiesOf('Basics', module)
3435
.add('Minimal implementation', () =>

examples/storybooks/tree-data-io.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ export default class App extends Component {
5151
<hr />
5252
↓This flat data is generated from the modified tree data↓
5353
<ul>
54-
{flatData.map(({ id, name, parent }) =>
54+
{flatData.map(({ id, name, parent }) => (
5555
<li key={id}>
5656
id: {id}, name: {name}, parent: {parent || 'null'}
5757
</li>
58-
)}
58+
))}
5959
</ul>
6060
</div>
6161
);

src/node-renderer-default.js

+29-22
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ class NodeRendererDefault extends Component {
8282
return (
8383
<div style={{ height: '100%' }} {...otherProps}>
8484
{toggleChildrenVisibility &&
85-
node.children &&
86-
(node.children.length > 0 || typeof node.children === 'function') &&
85+
node.children &&
86+
(node.children.length > 0 || typeof node.children === 'function') && (
8787
<div>
8888
<button
8989
type="button"
@@ -101,12 +101,14 @@ class NodeRendererDefault extends Component {
101101
/>
102102

103103
{node.expanded &&
104-
!isDragging &&
104+
!isDragging && (
105105
<div
106106
style={{ width: scaffoldBlockPxWidth }}
107107
className={styles.lineChildren}
108-
/>}
109-
</div>}
108+
/>
109+
)}
110+
</div>
111+
)}
110112

111113
<div className={styles.rowWrapper}>
112114
{/* Set the row preview to be used during drag and drop */}
@@ -142,36 +144,41 @@ class NodeRendererDefault extends Component {
142144
(node.subtitle ? ` ${styles.rowTitleWithSubtitle}` : '')
143145
}
144146
>
145-
{typeof nodeTitle === 'function'
146-
? nodeTitle({
147+
{typeof nodeTitle === 'function' ? (
148+
nodeTitle({
149+
node,
150+
path,
151+
treeIndex,
152+
})
153+
) : (
154+
nodeTitle
155+
)}
156+
</span>
157+
158+
{nodeSubtitle && (
159+
<span className={styles.rowSubtitle}>
160+
{typeof nodeSubtitle === 'function' ? (
161+
nodeSubtitle({
147162
node,
148163
path,
149164
treeIndex,
150165
})
151-
: nodeTitle}
152-
</span>
153-
154-
{nodeSubtitle &&
155-
<span className={styles.rowSubtitle}>
156-
{typeof nodeSubtitle === 'function'
157-
? nodeSubtitle({
158-
node,
159-
path,
160-
treeIndex,
161-
})
162-
: nodeSubtitle}
163-
</span>}
166+
) : (
167+
nodeSubtitle
168+
)}
169+
</span>
170+
)}
164171
</div>
165172

166173
<div className={styles.rowToolbar}>
167-
{buttons.map((btn, index) =>
174+
{buttons.map((btn, index) => (
168175
<div
169176
key={index} // eslint-disable-line react/no-array-index-key
170177
className={styles.toolbarButton}
171178
>
172179
{btn}
173180
</div>
174-
)}
181+
))}
175182
</div>
176183
</div>
177184
</div>

src/placeholder-renderer-default.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import styles from './placeholder-renderer-default.scss';
44

5-
const PlaceholderRendererDefault = ({ isOver, canDrop }) =>
5+
const PlaceholderRendererDefault = ({ isOver, canDrop }) => (
66
<div
77
className={
88
styles.placeholder +
99
(canDrop ? ` ${styles.placeholderLandingPad}` : '') +
1010
(canDrop && !isOver ? ` ${styles.placeholderCancelPad}` : '')
1111
}
12-
/>;
12+
/>
13+
);
1314

1415
PlaceholderRendererDefault.defaultProps = {
1516
isOver: false,

src/react-sortable-tree.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ class ReactSortableTree extends Component {
516516
// Render list with react-virtualized
517517
list = (
518518
<AutoSizer>
519-
{({ height, width }) =>
519+
{({ height, width }) => (
520520
<ScrollZoneVirtualList
521521
{...scrollToInfo}
522522
verticalStrength={this.vStrength}
@@ -544,7 +544,8 @@ class ReactSortableTree extends Component {
544544
matchKeys
545545
)}
546546
{...this.props.reactVirtualizedListProps}
547-
/>}
547+
/>
548+
)}
548549
</AutoSizer>
549550
);
550551
} else {

src/react-sortable-tree.test.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,7 @@ describe('<SortableTree />', () => {
249249
});
250250

251251
it('should render with a custom `nodeContentRenderer`', () => {
252-
const FakeNode = ({ node }) =>
253-
<div>
254-
{node.title}
255-
</div>;
252+
const FakeNode = ({ node }) => <div>{node.title}</div>;
256253
FakeNode.propTypes = { node: PropTypes.shape({}).isRequired };
257254

258255
const wrapper = mount(

0 commit comments

Comments
 (0)