Skip to content

Commit c2fa6db

Browse files
committed
🎨 add semi-colons
1 parent 5f7e4cd commit c2fa6db

File tree

107 files changed

+1686
-1470
lines changed

Some content is hidden

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

107 files changed

+1686
-1470
lines changed

.prettierrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ filepath: ''
99
printWidth: 120
1010
tabWidth: 2
1111
useTabs: false
12-
semi: false
12+
semi: true
1313
singleQuote: true
1414
quoteProps: as-needed
1515
trailingComma: all
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from '@react-native-community/async-storage/jest/async-storage-mock'
1+
export { default } from '@react-native-community/async-storage/jest/async-storage-mock';
+12-12
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
const Collection = {
22
doc(_: string) {
3-
return Document
3+
return Document;
44
},
55
get(_: string) {
6-
return new Promise(resolve => resolve())
6+
return new Promise(resolve => resolve());
77
},
8-
}
8+
};
99

1010
const Document = {
1111
collection(_: string) {
12-
return Collection
12+
return Collection;
1313
},
1414
get<T>(_: string) {
15-
return new Promise(resolve => resolve({} as T))
15+
return new Promise(resolve => resolve({} as T));
1616
},
1717
set<T>(_: T) {
18-
return new Promise(resolve => resolve())
18+
return new Promise(resolve => resolve());
1919
},
2020
delete(_: string) {
21-
return new Promise(resolve => resolve())
21+
return new Promise(resolve => resolve());
2222
},
2323
update<T>(_: T) {
24-
return new Promise(resolve => resolve())
24+
return new Promise(resolve => resolve());
2525
},
26-
}
26+
};
2727

2828
export default function createInstance() {
2929
return {
3030
collection(_: string) {
31-
return Collection
31+
return Collection;
3232
},
3333
doc(_: string) {
34-
return Document
34+
return Document;
3535
},
36-
}
36+
};
3737
}

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
22
presets: ['module:metro-react-native-babel-preset'],
3-
}
3+
};

e2e/firstTest.spec.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import testIDs from "../src/constants/testIDs";
1+
import testIDs from '../src/constants/testIDs';
22
import { elementById, pressBack, elementByLabel } from './lib/utils';
33

44
describe('All', () => {
@@ -32,7 +32,7 @@ describe('All', () => {
3232
});
3333

3434
it('カルーセルの表示は一度きり', async () => {
35-
await device.launchApp({newInstance: true});
35+
await device.launchApp({ newInstance: true });
3636

3737
await expect(elementById(testIDs.INITIAL)).toBeNotVisible();
3838
await expect(elementById(testIDs.CHOOSE_LOGIN)).toBeVisible();
@@ -73,11 +73,12 @@ describe('All', () => {
7373
await elementById(testIDs.SIGN_UP_PASSWORD).typeText(password);
7474
await elementById(testIDs.SIGN_UP_REGISTER_BUTTON).tap();
7575

76-
await waitFor(elementById(testIDs.HOME)).toBeVisible().withTimeout(10000);
76+
await waitFor(elementById(testIDs.HOME))
77+
.toBeVisible()
78+
.withTimeout(10000);
7779
await expect(elementById(testIDs.HOME)).toBeVisible();
7880
});
7981

80-
8182
it('サインアウトできる', async () => {
8283
await elementById(testIDs.MENU_HEADER_LEFT_BUTTON).tap();
8384
await elementByLabel('USER_INFO').tap();
@@ -95,12 +96,13 @@ describe('All', () => {
9596
await elementById(testIDs.SIGN_IN_PASSWORD).typeText(password);
9697
await elementById(testIDs.SIGN_IN_EMAIL_BUTTON).tap();
9798

98-
await waitFor(elementById(testIDs.HOME)).toBeVisible().withTimeout(10000);
99+
await waitFor(elementById(testIDs.HOME))
100+
.toBeVisible()
101+
.withTimeout(10000);
99102
await expect(elementById(testIDs.HOME)).toBeVisible();
100103
});
101104
});
102105

103-
104106
describe('Todo', function() {
105107
it('todoを追加できる', async () => {
106108
await expect(elementById(testIDs.TODO_OPEN_INPUT_BUTTON)).toBeVisible();

e2e/lib/utils.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
module.exports = {
2-
elementByLabel: (label) => {
2+
elementByLabel: label => {
33
return element(by.text(label));
44
},
5-
elementById: (id) => {
5+
elementById: id => {
66
return element(by.id(id));
77
},
88
pressBack: () => {
99
if (device.getPlatform() === 'android') {
1010
return device.pressBack();
1111
} else {
1212
// react-navigationの戻るボタン
13-
return element(by.id("header-back")).tap();
13+
return element(by.id('header-back')).tap();
1414
}
1515
},
1616
};

index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { AppRegistry } from 'react-native'
2-
import App from './src/App'
3-
import { name as appName } from './app.json'
1+
import { AppRegistry } from 'react-native';
2+
import App from './src/App';
3+
import { name as appName } from './app.json';
44

5-
AppRegistry.registerComponent(appName, () => App)
5+
AppRegistry.registerComponent(appName, () => App);

metro.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ module.exports = {
1414
},
1515
}),
1616
},
17-
}
17+
};

scripts/test-e2e.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,22 @@ const { execSync } = require('shell-utils').exec;
22

33
const android = process.argv.includes('--android');
44
const release = process.argv.includes('--release');
5-
const skipBuild = process.argv.includes( '--skipBuild');
6-
const headless = process.argv.includes( '--headless');
7-
const multi = process.argv.includes( '--multi');
5+
const skipBuild = process.argv.includes('--skipBuild');
6+
const headless = process.argv.includes('--headless');
7+
const multi = process.argv.includes('--multi');
88

99
console.log({
1010
release,
11-
skipBuild
11+
skipBuild,
1212
});
1313

1414
function run() {
1515
const prefix = android ? `android.emu` : `ios.sim`;
1616
const suffix = release ? `release` : `debug`;
1717
const configuration = `${prefix}.${suffix}`;
18-
const headless$ = android ? headless ? `--headless` : `` : ``;
18+
const headless$ = android ? (headless ? `--headless` : ``) : ``;
1919
const workers = multi ? 3 : 1;
2020

21-
2221
if (!skipBuild) {
2322
execSync(`detox build --configuration ${configuration}`);
2423
}

src/@types/Navigation/index.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { NavigationParams, NavigationScreenProp, NavigationState } from '@react-navigation/native'
1+
import { NavigationParams, NavigationScreenProp, NavigationState } from '@react-navigation/native';
22

3-
declare type Navigation = NavigationScreenProp<NavigationState, NavigationParams>
3+
declare type Navigation = NavigationScreenProp<NavigationState, NavigationParams>;

src/@types/image.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
declare module '*.png'
2-
declare module '*.jpg'
1+
declare module '*.png';
2+
declare module '*.jpg';

src/App.tsx

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import React from 'react'
2-
import { Provider } from 'react-redux'
3-
import { SafeAreaProvider } from 'react-native-safe-area-context'
4-
import { Snackbar } from 'react-native-paper'
5-
import store from './store'
6-
import * as UiContext from './contexts/ui'
7-
import * as NetworkContext from './contexts/network'
8-
import * as UserContext from './contexts/user'
9-
import Routes from './routes'
10-
import NetworkPanel from './components/molecules/NetworkPanel'
11-
import ErrorPanel from './components/molecules/ErrorPanel'
1+
import React from 'react';
2+
import { Provider } from 'react-redux';
3+
import { SafeAreaProvider } from 'react-native-safe-area-context';
4+
import { Snackbar } from 'react-native-paper';
5+
import store from './store';
6+
import * as UiContext from './contexts/ui';
7+
import * as NetworkContext from './contexts/network';
8+
import * as UserContext from './contexts/user';
9+
import Routes from './routes';
10+
import NetworkPanel from './components/molecules/NetworkPanel';
11+
import ErrorPanel from './components/molecules/ErrorPanel';
1212

1313
export default function App() {
14-
const [error, setError] = React.useState(UiContext.createErrorInitialState())
15-
const [snackbar, setSnackbar] = React.useState(UiContext.createSnackbarInitialState())
16-
const [applicationState, setApplicationState] = React.useState(UiContext.createApplicationInitialState())
14+
const [error, setError] = React.useState(UiContext.createErrorInitialState());
15+
const [snackbar, setSnackbar] = React.useState(UiContext.createSnackbarInitialState());
16+
const [applicationState, setApplicationState] = React.useState(UiContext.createApplicationInitialState());
1717
const onDismiss = React.useCallback(() => {
18-
setSnackbar(UiContext.createSnackbarInitialState())
19-
}, [])
18+
setSnackbar(UiContext.createSnackbarInitialState());
19+
}, []);
2020

2121
const [networkState, dispatchNetworkActions] = React.useReducer(
2222
NetworkContext.reducer,
2323
NetworkContext.createInitialState(),
24-
)
24+
);
2525

26-
const [userState, setUserState] = React.useState(UserContext.createInitialState())
26+
const [userState, setUserState] = React.useState(UserContext.createInitialState());
2727

2828
return (
2929
<Provider store={store}>
@@ -48,5 +48,5 @@ export default function App() {
4848
</UiContext.Context.Provider>
4949
</SafeAreaProvider>
5050
</Provider>
51-
)
51+
);
5252
}

src/components/atoms/Avatar.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React from 'react'
2-
import { Avatar as PaperAvatar } from 'react-native-paper'
3-
import { ImageSourcePropType, ViewStyle } from 'react-native'
1+
import React from 'react';
2+
import { Avatar as PaperAvatar } from 'react-native-paper';
3+
import { ImageSourcePropType, ViewStyle } from 'react-native';
44

55
interface Props {
6-
size?: number
7-
source: ImageSourcePropType
8-
style?: ViewStyle | ViewStyle[]
6+
size?: number;
7+
source: ImageSourcePropType;
8+
style?: ViewStyle | ViewStyle[];
99
}
1010

1111
export default function Avatar(props: Props) {
12-
const { size = 220, source, style } = props
13-
return <PaperAvatar.Image size={size} source={source} style={style} />
12+
const { size = 220, source, style } = props;
13+
return <PaperAvatar.Image size={size} source={source} style={style} />;
1414
}

src/components/atoms/Button.tsx

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
import * as React from 'react'
2-
import { StyleSheet, Text, TextStyle, ViewStyle } from 'react-native'
3-
import { Button as PaperButton } from 'react-native-paper'
4-
import { COLOR } from '../../constants/theme'
1+
import * as React from 'react';
2+
import { StyleSheet, Text, TextStyle, ViewStyle } from 'react-native';
3+
import { Button as PaperButton } from 'react-native-paper';
4+
import { COLOR } from '../../constants/theme';
55

66
const styles = StyleSheet.create({
77
text: {
88
fontSize: 18,
99
fontWeight: '900',
1010
color: COLOR.WHITE,
1111
},
12-
})
12+
});
1313

1414
interface Props {
15-
onPress: () => void
16-
style?: ViewStyle | ViewStyle[]
17-
textStyle?: TextStyle
18-
label?: string
19-
color?: string
20-
disabled?: boolean
21-
disabledColor?: string
22-
testID?: string
23-
icon?: string
15+
onPress: () => void;
16+
style?: ViewStyle | ViewStyle[];
17+
textStyle?: TextStyle;
18+
label?: string;
19+
color?: string;
20+
disabled?: boolean;
21+
disabledColor?: string;
22+
testID?: string;
23+
icon?: string;
2424
}
2525

2626
export default function Button(props: Props) {
@@ -34,7 +34,7 @@ export default function Button(props: Props) {
3434
disabledColor = COLOR.MAIN_LIGHT,
3535
testID,
3636
icon,
37-
} = props
37+
} = props;
3838
return (
3939
<PaperButton
4040
mode="contained"
@@ -49,5 +49,5 @@ export default function Button(props: Props) {
4949
>
5050
{label && <Text style={[styles.text, textStyle]}>{label}</Text>}
5151
</PaperButton>
52-
)
52+
);
5353
}

src/components/atoms/HeaderText.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import React from 'react'
2-
import { Text, StyleSheet } from 'react-native'
3-
import { COLOR } from '../../constants/theme'
1+
import React from 'react';
2+
import { Text, StyleSheet } from 'react-native';
3+
import { COLOR } from '../../constants/theme';
44

55
const styles = StyleSheet.create({
66
headerText: {
77
color: COLOR.WHITE,
88
fontSize: 24,
99
},
10-
})
10+
});
1111

1212
interface Props {
13-
text: string
13+
text: string;
1414
}
1515

1616
export default function HeaderText(props: Props) {
17-
const { text } = props
18-
return <Text style={styles.headerText}>{text}</Text>
17+
const { text } = props;
18+
return <Text style={styles.headerText}>{text}</Text>;
1919
}

src/components/atoms/IconButton.tsx

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react'
2-
import { IconButton as PaperIconButton } from 'react-native-paper'
3-
import { StyleSheet, ViewStyle } from 'react-native'
4-
import { COLOR } from '../../constants/theme'
1+
import React from 'react';
2+
import { IconButton as PaperIconButton } from 'react-native-paper';
3+
import { StyleSheet, ViewStyle } from 'react-native';
4+
import { COLOR } from '../../constants/theme';
55

66
const styles = StyleSheet.create({
77
button: {
@@ -12,19 +12,19 @@ const styles = StyleSheet.create({
1212
borderRadius: 0,
1313
margin: 0,
1414
},
15-
})
15+
});
1616

1717
interface Props {
18-
icon: string
19-
onPress: () => void
20-
style?: ViewStyle | ViewStyle[]
21-
testID?: string
22-
iconColor?: string
23-
size?: number
18+
icon: string;
19+
onPress: () => void;
20+
style?: ViewStyle | ViewStyle[];
21+
testID?: string;
22+
iconColor?: string;
23+
size?: number;
2424
}
2525

2626
export default function IconButton(props: Props) {
27-
const { icon, onPress, style, testID, iconColor = COLOR.WHITE, size = 18 } = props
27+
const { icon, onPress, style, testID, iconColor = COLOR.WHITE, size = 18 } = props;
2828

2929
return (
3030
<PaperIconButton
@@ -35,5 +35,5 @@ export default function IconButton(props: Props) {
3535
icon={icon}
3636
testID={testID}
3737
/>
38-
)
38+
);
3939
}

0 commit comments

Comments
 (0)