Skip to content

Commit f1f5232

Browse files
committed
prettier changes
1 parent 66444a5 commit f1f5232

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+250
-265
lines changed

src/__fixtures__/releases/0.59.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ export default {
44
links: [
55
{
66
title: 'This is a very cool link to a blog post about 0.59',
7-
url:
8-
'https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059'
9-
}
10-
]
11-
}
7+
url: 'https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059',
8+
},
9+
],
10+
},
1211
}

src/__tests__/Home.e2e.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ describe('Home', () => {
1616

1717
afterAll(closeBrowser)
1818

19-
const selectVersion = async targetVersion => {
20-
await page.evaluate(pageTargetVersion => {
19+
const selectVersion = async (targetVersion) => {
20+
await page.evaluate((pageTargetVersion) => {
2121
const element = [
2222
...document.querySelectorAll(
2323
'.ant-select-dropdown.ant-select-dropdown-placement-bottomLeft:not(.ant-select-dropdown-hidden) .ant-select-item-option-content'
24-
)
24+
),
2525
].find(({ innerText: version }) => version === pageTargetVersion)
2626

2727
element.click()
@@ -113,7 +113,7 @@ describe('Home', () => {
113113
})
114114

115115
it('9. should scroll to the first file in diff', async () => {
116-
await page.evaluate(testID => {
116+
await page.evaluate((testID) => {
117117
document
118118
.querySelector(`[data-testid="${testID}"]`)
119119
.querySelector('div')

src/__tests__/utils.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('getVersionsContentInDiff', () => {
77
const versions = getVersionsContentInDiff({
88
packageName: PACKAGE_NAMES.RN,
99
fromVersion: '0.57.0',
10-
toVersion: '0.59.0'
10+
toVersion: '0.59.0',
1111
})
1212

1313
expect(versions).toEqual([{ version: '0.59' }, { version: '0.58' }])
@@ -17,21 +17,21 @@ describe('getVersionsContentInDiff', () => {
1717
const versions = getVersionsContentInDiff({
1818
packageName: PACKAGE_NAMES.RN,
1919
fromVersion: '0.56.0',
20-
toVersion: '0.59.0-rc.1'
20+
toVersion: '0.59.0-rc.1',
2121
})
2222

2323
expect(versions).toEqual([
2424
{ version: '0.59' },
2525
{ version: '0.58' },
26-
{ version: '0.57' }
26+
{ version: '0.57' },
2727
])
2828
})
2929

3030
it('returns the versions in the provided range with patches specified', () => {
3131
const versions = getVersionsContentInDiff({
3232
packageName: PACKAGE_NAMES.RN,
3333
fromVersion: '0.57.2',
34-
toVersion: '0.59.9'
34+
toVersion: '0.59.9',
3535
})
3636

3737
expect(versions).toEqual([{ version: '0.59' }, { version: '0.58' }])

src/components/common/BinaryDownload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const BinaryDownload = ({
5353
fromVersion,
5454
toVersion,
5555
appName,
56-
packageName
56+
packageName,
5757
}) => {
5858
const binaryFiles = diff.filter(
5959
({ hunks, type }) => hunks.length === 0 && type !== 'delete'

src/components/common/CompletedFilesCounter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const CompletedFilesCounter = styled(
3434
trigger="hover"
3535
placement="right"
3636
overlayStyle={{
37-
position: 'fixed'
37+
position: 'fixed',
3838
}}
3939
>
4040
<span className="completedAmount">
@@ -47,7 +47,7 @@ const CompletedFilesCounter = styled(
4747
config={{
4848
elementCount: 200,
4949
angle: 130,
50-
startVelocity: 30
50+
startVelocity: 30,
5151
}}
5252
/>
5353
</div>

src/components/common/Diff/Diff.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import {
55
Hunk,
66
markEdits,
77
tokenize,
8-
Decoration as DiffDecoration
8+
Decoration as DiffDecoration,
99
} from 'react-diff-view'
1010
import DiffHeader from './DiffHeader'
1111
import { getComments } from './DiffComment'
1212
import { replaceWithProvidedAppName } from '../../../utils'
1313

1414
const copyPathPopoverContentOpts = {
1515
default: 'Click to copy file path',
16-
copied: 'File path copied!'
16+
copied: 'File path copied!',
1717
}
1818

1919
const Container = styled.div`
@@ -101,7 +101,7 @@ const Diff = ({
101101
areAllCollapsed,
102102
setAllCollapsed,
103103
diffViewStyle,
104-
appName
104+
appName,
105105
}) => {
106106
const [isDiffCollapsed, setIsDiffCollapsed] = useState(
107107
isDiffCollapsedByDefault({ type, hunks })
@@ -122,17 +122,17 @@ const Diff = ({
122122
}
123123

124124
const getHunksWithAppName = useCallback(
125-
originalHunks => {
125+
(originalHunks) => {
126126
if (!appName) {
127127
return originalHunks
128128
}
129129

130-
return originalHunks.map(hunk => ({
130+
return originalHunks.map((hunk) => ({
131131
...hunk,
132-
changes: hunk.changes.map(change => ({
132+
changes: hunk.changes.map((change) => ({
133133
...change,
134-
content: replaceWithProvidedAppName(change.content, appName)
135-
}))
134+
content: replaceWithProvidedAppName(change.content, appName),
135+
})),
136136
}))
137137
},
138138
[appName]
@@ -149,7 +149,7 @@ const Diff = ({
149149
newPath,
150150
fromVersion,
151151
toVersion,
152-
appName
152+
appName,
153153
})
154154

155155
return (
@@ -189,16 +189,16 @@ const Diff = ({
189189
optimizeSelection={true}
190190
selectedChanges={selectedChanges}
191191
>
192-
{originalHunks => {
192+
{(originalHunks) => {
193193
const updatedHunks = getHunksWithAppName(originalHunks)
194194

195195
const options = {
196-
enhancers: [markEdits(updatedHunks)]
196+
enhancers: [markEdits(updatedHunks)],
197197
}
198198

199199
const tokens = tokenize(updatedHunks, options)
200200

201-
return updatedHunks.map(hunk => [
201+
return updatedHunks.map((hunk) => [
202202
<Decoration key={'decoration-' + hunk.content}>
203203
<More>{hunk.content}</More>
204204
</Decoration>,
@@ -207,7 +207,7 @@ const Diff = ({
207207
hunk={hunk}
208208
tokens={tokens}
209209
gutterEvents={{ onClick: onToggleChangeSelection }}
210-
/>
210+
/>,
211211
])
212212
}}
213213
</DiffView>

src/components/common/Diff/DiffComment.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ import Markdown from '../Markdown'
77
const lineColors = {
88
add: '#d6fedb',
99
delete: '#fdeff0',
10-
neutral: '#ffffff'
10+
neutral: '#ffffff',
1111
}
1212

1313
const Container = styled(({ isCommentVisible, children, ...props }) => (
1414
<motion.div
1515
{...props}
1616
variants={{
1717
visible: {
18-
height: 'auto'
18+
height: 'auto',
1919
},
20-
hidden: { height: 10 }
20+
hidden: { height: 10 },
2121
}}
2222
initial={isCommentVisible ? 'visible' : 'hidden'}
2323
animate={isCommentVisible ? 'visible' : 'hidden'}
2424
transition={{
25-
duration: 0.5
25+
duration: 0.5,
2626
}}
2727
inherit={false}
2828
>
@@ -53,17 +53,17 @@ const ShowButton = styled(({ isCommentVisible, ...props }) => (
5353
{...props}
5454
variants={{
5555
visible: {
56-
scaleX: 1
56+
scaleX: 1,
5757
},
58-
hidden: { scaleX: 10 }
58+
hidden: { scaleX: 10 },
5959
}}
6060
whileHover={{
61-
scale: 2
61+
scale: 2,
6262
}}
6363
initial={isCommentVisible ? 'visible' : 'hidden'}
6464
animate={isCommentVisible ? 'visible' : 'hidden'}
6565
transition={{
66-
duration: 0.25
66+
duration: 0.25,
6767
}}
6868
/>
6969
))`
@@ -86,7 +86,7 @@ const Content = styled(Markdown)`
8686
const LINE_CHANGE_TYPES = {
8787
ADD: 'I',
8888
DELETE: 'D',
89-
NEUTRAL: 'N'
89+
NEUTRAL: 'N',
9090
}
9191

9292
const getLineNumberWithType = ({ lineChangeType, lineNumber }) =>
@@ -98,7 +98,7 @@ const getComments = ({ packageName, newPath, fromVersion, toVersion }) => {
9898
const versionsInDiff = getVersionsContentInDiff({
9999
packageName,
100100
fromVersion,
101-
toVersion
101+
toVersion,
102102
}).filter(
103103
({ comments }) =>
104104
comments &&
@@ -117,15 +117,15 @@ const getComments = ({ packageName, newPath, fromVersion, toVersion }) => {
117117
...versionComments,
118118
[getLineNumberWithType({ lineChangeType, lineNumber })]: (
119119
<DiffComment content={content} lineChangeType={lineChangeType} />
120-
)
120+
),
121121
}
122122
},
123123
{}
124124
)
125125

126126
return {
127127
...allComments,
128-
...comments
128+
...comments,
129129
}
130130
}, {})
131131
}

src/components/common/Diff/DiffCommentReminder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ const DiffCommentReminder = styled(
1414
{...props}
1515
variants={{
1616
visible: { opacity: 1, cursor: 'pointer' },
17-
invisible: { opacity: 0, cursor: 'initial' }
17+
invisible: { opacity: 0, cursor: 'initial' },
1818
}}
1919
animate={isVisible > 0 ? 'visible' : 'invisible'}
2020
transition={{
21-
duration: getTransitionDuration(0.5)
21+
duration: getTransitionDuration(0.5),
2222
}}
2323
onClick={uncollapseDiff}
2424
>

src/components/common/Diff/DiffHeader.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
DownOutlined,
77
RightOutlined,
88
CopyOutlined,
9-
RollbackOutlined
9+
RollbackOutlined,
1010
} from '@ant-design/icons'
1111
import { getFilePathsToShow } from '../../../utils'
1212
import { CopyToClipboard } from 'react-copy-to-clipboard'
@@ -15,7 +15,7 @@ import DownloadFileButton from '../DownloadFileButton'
1515
import ViewFileButton from '../ViewFileButton'
1616

1717
export const testIDs = {
18-
collapseClickableArea: 'collapseClickableArea'
18+
collapseClickableArea: 'collapseClickableArea',
1919
}
2020

2121
const Wrapper = styled.div`
@@ -38,7 +38,7 @@ const Wrapper = styled.div`
3838
const FileRenameArrow = styled(RightOutlined)({
3939
fontSize: '10px',
4040
margin: '0 5px',
41-
color: '#f78206'
41+
color: '#f78206',
4242
})
4343

4444
const FileName = ({ oldPath, newPath, type, appName }) => {
@@ -62,14 +62,14 @@ const FileStatus = ({ type, ...props }) => {
6262
add: 'blue',
6363
modify: 'green',
6464
delete: 'red',
65-
rename: 'orange'
65+
rename: 'orange',
6666
}
6767

6868
const labels = {
6969
add: 'ADDED',
7070
modify: 'MODIFIED',
7171
delete: 'DELETED',
72-
rename: 'RENAMED'
72+
rename: 'RENAMED',
7373
}
7474

7575
return (
@@ -138,7 +138,7 @@ const CopyPathToClipboardButton = styled(
138138
trigger="hover"
139139
overlayStyle={{
140140
width: '175px',
141-
textAlign: 'center'
141+
textAlign: 'center',
142142
}}
143143
>
144144
<Button

src/components/common/Diff/DiffLoading.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const Header = styled.div({
4242
color: '#24292e',
4343
backgroundColor: '#fafbfc',
4444
padding: '10px',
45-
height: '40px'
45+
height: '40px',
4646
})
4747

4848
const DiffLoading = () => (
@@ -56,7 +56,7 @@ const DiffLoading = () => (
5656
</Header>
5757
<div
5858
css={{
59-
padding: '5px 10px'
59+
padding: '5px 10px',
6060
}}
6161
>
6262
<DiffLoader />

0 commit comments

Comments
 (0)