Skip to content

Commit 90ca237

Browse files
committed
chore: add react native eslint enhancers and fix imports order
1 parent 11fba72 commit 90ca237

File tree

19 files changed

+269
-145
lines changed

19 files changed

+269
-145
lines changed

.eslintrc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"@moxy/eslint-config-base/esm",
88
"@moxy/eslint-config-babel",
99
"@moxy/eslint-config-jest",
10-
"@moxy/eslint-config-react"
10+
"@moxy/eslint-config-react",
11+
"@moxy/eslint-config-react-native",
12+
"@moxy/eslint-config-react-native-a11y/rn-061"
1113
]
1214
}

package-lock.json

Lines changed: 216 additions & 101 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@
5757
},
5858
"devDependencies": {
5959
"@commitlint/config-conventional": "^8.0.0",
60-
"@moxy/eslint-config-babel": "^11.0.3",
61-
"@moxy/eslint-config-base": "^11.0.0",
62-
"@moxy/eslint-config-jest": "^11.0.0",
63-
"@moxy/eslint-config-react": "^11.0.0",
60+
"@moxy/eslint-config-babel": "^12.3.0",
61+
"@moxy/eslint-config-base": "^12.2.0",
62+
"@moxy/eslint-config-jest": "^12.3.0",
63+
"@moxy/eslint-config-react": "^12.3.0",
64+
"@moxy/eslint-config-react-native": "^12.3.1",
65+
"@moxy/eslint-config-react-native-a11y": "^12.3.1",
6466
"@moxy/jest-config-base": "^5.0.0",
6567
"@moxy/jest-config-react-native": "^5.0.0",
6668
"@moxy/jest-config-testing-library": "^5.1.0",

src/navigation/profile-stack/header/ProfileStackHeader.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ const ProfileStackHeader = ({ navigation }) => {
2121
<View style={ styles.header }>
2222
<Button
2323
accessibilityLabel="back button"
24+
accessibilityHint="back button"
2425
title={ <FormattedMessage id="profile.header.buttons.back" /> }
2526
textStyle={ styles.goBack }
2627
onPress={ handlePress } />
2728
<Text
2829
accessibilityLabel="title"
30+
accessibilityHint="title"
2931
style={ styles.title }>
3032
<FormattedMessage id="profile.header.title" />
3133
</Text>

src/navigation/profile-stack/header/ProfileStackHeader.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { StatusBar } from 'react-native';
3-
import { render, fireEvent } from '../../../shared/test-utils';
43
import SafeAreaView from 'react-native-safe-area-view';
4+
import { render, fireEvent } from '../../../shared/test-utils';
55
import { createNavigationProp } from '../../../shared/test-utils/react-navigation';
66
import ProfileHeader from './';
77

src/navigation/profile-stack/header/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Default from '.';
21
import ProfileStackHeader from './ProfileStackHeader';
2+
import Default from '.';
33

44
it('should default export ProfileStackHeader', () => {
55
expect(ProfileStackHeader).toBe(Default);

src/navigation/profile-stack/header/styles/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { StyleSheet } from 'react-native';
22

33
export default ({ typography, colors, layout }) => StyleSheet.create({
4+
goBack: {
5+
...typography.bold,
6+
color: colors.secondary,
7+
},
48
header: {
5-
height: 50,
6-
flexDirection: 'row',
79
alignItems: 'center',
10+
flexDirection: 'row',
11+
height: 50,
812
justifyContent: 'space-between',
913
paddingHorizontal: layout.gutter,
1014
},
11-
goBack: {
12-
...typography.bold,
13-
color: colors.secondary,
14-
},
1515
title: {
1616
...typography.regular,
1717
color: colors.terciary,

src/navigation/profile-stack/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
22
import { createStackNavigator } from '@react-navigation/stack';
3-
import ProfileHeader from './header';
43
import ProfileScreen1 from '../../screens/profile/1/ProfileScreen1';
54
import ProfileScreen2 from '../../screens/profile/2/ProfileScreen2';
5+
import ProfileHeader from './header';
66

77
const Stack = createStackNavigator();
88

src/navigation/root/index.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { navigationRef, navigate } from './';
21
import { createNavigationProp } from '../../shared/test-utils/react-navigation';
2+
import { navigationRef, navigate } from './';
33

44
beforeEach(() => {
55
navigationRef.current = createNavigationProp();

src/screens/home/HomeScreen.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ const HomeScreen = ({ navigation }) => {
2828
<View style={ styles.container }>
2929
<Text
3030
accessibilityLabel="title"
31+
accessibilityHint="title"
3132
style={ styles.text }>
3233
<FormattedMessage id="home.title" />
3334
</Text>
3435
<Button
35-
accessibilityLabel="navigate to profile button"
36+
accessibilityLabel="navigate to profile screen"
37+
accessibilityHint="navigate to profile screen"
3638
type="highlight"
3739
title={ <FormattedMessage id="home.buttons.navigate-to-profile" /> }
3840
style={ styles.button }
@@ -41,6 +43,7 @@ const HomeScreen = ({ navigation }) => {
4143
underlayColor={ themeStyles.colors.terciary } />
4244
<Button
4345
accessibilityLabel="switch language button"
46+
accessibilityHint="switch language button"
4447
type="highlight"
4548
title={ <FormattedMessage id="home.buttons.switch-language" values={ { localeId: locale.id } } /> }
4649
style={ styles.button }

0 commit comments

Comments
 (0)