Skip to content

Commit c70f23b

Browse files
authored
refact: unified prettier config across repository (#2250)
## Description This PR intents to unify prettier config across example apps. Inititally I wanted to copy the configuration but It's more convenient to just use the one from the root (by not overriding it). ## Changes - removed per project `.prettierrc` files - fixed eslint export syntax in Example - formatted affected files <!-- ## Screenshots / GIFs Here you can add screenshots / GIFs documenting your change. You can add before / after section if you're changing some behavior. ### Before ### After --> <!-- ## Test code and steps to reproduce Please include code that can be used to test this change and short description how this example should work. This snippet should be as minimal as possible and ready to be pasted into editor (don't exclude exports or remove "not important" parts of reproduction example) --> ## Checklist - [x] Ensured that CI passes
1 parent 8013dc8 commit c70f23b

File tree

80 files changed

+422
-393
lines changed

Some content is hidden

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

80 files changed

+422
-393
lines changed

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ module.exports = {
2121
'react-native-screens/gesture-handler',
2222
],
2323
'import/ignore': [
24-
'node_modules/react-native/index\\.js$',
24+
'node_modules/react-native/index\\.js$',
2525
'react-native/Libraries/Utilities/codegenNativeComponent.*',
26-
'react-native/Libraries/Types/CodegenTypes.*'
26+
'react-native/Libraries/Types/CodegenTypes.*',
2727
],
2828
'import/resolver': {
2929
node: {

.github/workflows/check-archs-consistency.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Test consistency between Paper & Fabric
2-
on:
2+
on:
33
pull_request:
44
branches:
55
- main
6-
paths:
6+
paths:
77
- src/fabric/**
88
- android/src/paper/java/com/facebook/react/viewmanagers/**
99
jobs:

.prettierrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ module.exports = {
33
bracketSameLine: true,
44
bracketSpacing: true,
55
singleQuote: true,
6-
trailingComma: 'es5',
6+
trailingComma: 'all',
77
};

.watchmanconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

Example/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.export = {
1+
module.exports = {
22
root: true,
33
extends: '@react-native',
44
};

Example/.prettierrc.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

Example/.watchmanconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

Example/app.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
"name": "ScreensExample",
33
"displayName": "ScreensExample"
44
}
5-

Example/e2e/examplesTests/bottomTabs.e2e.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,36 @@ describe('Bottom tabs and native stack', () => {
77

88
it('should go to main screen and back', async () => {
99
await expect(
10-
element(by.id('root-screen-example-BottomTabsAndStack'))
10+
element(by.id('root-screen-example-BottomTabsAndStack')),
1111
).toBeVisible();
1212
await element(by.id('root-screen-example-BottomTabsAndStack')).tap();
1313

1414
await expect(
15-
element(by.id('bottom-tabs-A-more-details-button'))
15+
element(by.id('bottom-tabs-A-more-details-button')),
1616
).toBeVisible();
1717
});
1818

1919
it('should go to details screen', async () => {
2020
await element(by.id('root-screen-example-BottomTabsAndStack')).tap();
2121
await element(by.id('bottom-tabs-A-more-details-button')).tap();
2222
await expect(
23-
element(by.id('bottom-tabs-A-more-details-button'))
23+
element(by.id('bottom-tabs-A-more-details-button')),
2424
).toHaveLabel('More details 1');
2525
});
2626

2727
it('should go to details screen and back', async () => {
2828
await element(by.id('root-screen-example-BottomTabsAndStack')).tap();
2929
await element(by.id('bottom-tabs-A-more-details-button')).tap();
3030
await expect(
31-
element(by.id('bottom-tabs-A-more-details-button'))
31+
element(by.id('bottom-tabs-A-more-details-button')),
3232
).toHaveLabel('More details 1');
3333
if (device.getPlatform() === 'ios') {
3434
await element(by.type('_UIButtonBarButton')).tap();
3535
} else {
3636
await device.pressBack();
3737
}
3838
await expect(
39-
element(by.id('bottom-tabs-A-more-details-button'))
39+
element(by.id('bottom-tabs-A-more-details-button')),
4040
).toHaveLabel('More details 0');
4141
});
4242

@@ -45,12 +45,12 @@ describe('Bottom tabs and native stack', () => {
4545

4646
await element(by.id('bottom-tabs-B-tab')).tap();
4747
await expect(element(by.id('bottom-tabs-B-header-right-id'))).toHaveText(
48-
'B'
48+
'B',
4949
);
5050

5151
await element(by.id('bottom-tabs-A-tab')).tap();
5252
await expect(element(by.id('bottom-tabs-A-header-right-id'))).toHaveText(
53-
'A'
53+
'A',
5454
);
5555
});
5656

@@ -59,12 +59,12 @@ describe('Bottom tabs and native stack', () => {
5959

6060
await element(by.id('bottom-tabs-A-more-details-button')).tap();
6161
await expect(
62-
element(by.id('bottom-tabs-A-more-details-button'))
62+
element(by.id('bottom-tabs-A-more-details-button')),
6363
).toHaveLabel('More details 1');
6464

6565
await element(by.id('bottom-tabs-A-tab')).multiTap(2);
6666
await expect(
67-
element(by.id('bottom-tabs-A-more-details-button'))
67+
element(by.id('bottom-tabs-A-more-details-button')),
6868
).toHaveLabel('More details 0');
6969
});
7070

@@ -74,17 +74,17 @@ describe('Bottom tabs and native stack', () => {
7474
await element(by.id('bottom-tabs-A-more-details-button')).tap();
7575
await element(by.id('bottom-tabs-A-more-details-button')).tap();
7676
await expect(
77-
element(by.id('bottom-tabs-A-more-details-button'))
77+
element(by.id('bottom-tabs-A-more-details-button')),
7878
).toHaveLabel('More details 2');
7979

8080
await element(by.id('bottom-tabs-B-tab')).tap();
8181
await expect(
82-
element(by.id('bottom-tabs-B-more-details-button'))
82+
element(by.id('bottom-tabs-B-more-details-button')),
8383
).toHaveLabel('More details 0');
8484
await element(by.id('bottom-tabs-A-tab')).tap();
8585

8686
await expect(
87-
element(by.id('bottom-tabs-A-more-details-button'))
87+
element(by.id('bottom-tabs-A-more-details-button')),
8888
).toHaveLabel('More details 2');
8989
});
9090
});

Example/e2e/examplesTests/events.e2e.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,33 @@ const pressBack = async () => {
1313
const awaitClassicalEventBehavior = async () => {
1414
if (device.getPlatform() === 'ios') {
1515
await expect(
16-
element(by.text('9. Chats | transitionStart | closing'))
16+
element(by.text('9. Chats | transitionStart | closing')),
1717
).toExist();
1818
await expect(
19-
element(by.text('10. Privacy | transitionStart | closing'))
19+
element(by.text('10. Privacy | transitionStart | closing')),
2020
).toExist();
2121
await expect(
22-
element(by.text('11. Main | transitionStart | opening'))
22+
element(by.text('11. Main | transitionStart | opening')),
2323
).toExist();
2424
await expect(
25-
element(by.text('12. Chats | transitionEnd | closing'))
25+
element(by.text('12. Chats | transitionEnd | closing')),
2626
).toExist();
2727
await expect(
28-
element(by.text('13. Privacy | transitionEnd | closing'))
28+
element(by.text('13. Privacy | transitionEnd | closing')),
2929
).toExist();
3030
await expect(element(by.text('14. Privacy | beforeRemove'))).toExist();
3131
await expect(element(by.text('15. Chats | beforeRemove'))).toExist();
3232
await expect(
33-
element(by.text('16. Main | transitionEnd | opening'))
33+
element(by.text('16. Main | transitionEnd | opening')),
3434
).toExist();
3535
} else {
3636
await expect(element(by.text('9. Privacy | beforeRemove'))).toExist();
3737
await expect(element(by.text('10. Chats | beforeRemove'))).toExist();
3838
await expect(
39-
element(by.text('11. Main | transitionStart | opening'))
39+
element(by.text('11. Main | transitionStart | opening')),
4040
).toExist();
4141
await expect(
42-
element(by.text('12. Main | transitionEnd | opening'))
42+
element(by.text('12. Main | transitionEnd | opening')),
4343
).toExist();
4444
}
4545
};
@@ -64,10 +64,10 @@ describe('Events', () => {
6464
await element(by.id('root-screen-playground-Events')).tap();
6565

6666
await expect(
67-
element(by.text('1. Main | transitionStart | opening'))
67+
element(by.text('1. Main | transitionStart | opening')),
6868
).toExist();
6969
await expect(
70-
element(by.text('2. Main | transitionEnd | opening'))
70+
element(by.text('2. Main | transitionEnd | opening')),
7171
).toExist();
7272
});
7373

@@ -79,7 +79,7 @@ describe('Events', () => {
7979
await element(by.type('_UIButtonBarButton')).tap();
8080
} else {
8181
await element(
82-
by.type('androidx.appcompat.widget.AppCompatImageButton')
82+
by.type('androidx.appcompat.widget.AppCompatImageButton'),
8383
).tap();
8484
}
8585

@@ -98,7 +98,7 @@ describe('Events', () => {
9898
await element(by.type('_UIButtonBarButton')).tap();
9999
} else {
100100
await element(
101-
by.type('androidx.appcompat.widget.AppCompatImageButton')
101+
by.type('androidx.appcompat.widget.AppCompatImageButton'),
102102
).tap();
103103
}
104104

@@ -114,22 +114,22 @@ describe('Events', () => {
114114
await element(by.id('events-go-to-chats')).tap();
115115

116116
await expect(
117-
element(by.text('3. Main | transitionStart | closing'))
117+
element(by.text('3. Main | transitionStart | closing')),
118118
).toExist();
119119
await expect(
120-
element(by.text('4. Chats | transitionStart | opening'))
120+
element(by.text('4. Chats | transitionStart | opening')),
121121
).toExist();
122122
await expect(
123-
element(by.text('5. Privacy | transitionStart | opening'))
123+
element(by.text('5. Privacy | transitionStart | opening')),
124124
).toExist();
125125
await expect(
126-
element(by.text('6. Main | transitionEnd | closing'))
126+
element(by.text('6. Main | transitionEnd | closing')),
127127
).toExist();
128128
await expect(
129-
element(by.text('7. Chats | transitionEnd | opening'))
129+
element(by.text('7. Chats | transitionEnd | opening')),
130130
).toExist();
131131
await expect(
132-
element(by.text('8. Privacy | transitionEnd | opening'))
132+
element(by.text('8. Privacy | transitionEnd | opening')),
133133
).toExist();
134134
});
135135

@@ -145,7 +145,7 @@ describe('Events', () => {
145145
await element(by.type('_UIButtonBarButton')).tap();
146146
} else {
147147
await element(
148-
by.type('androidx.appcompat.widget.AppCompatImageButton')
148+
by.type('androidx.appcompat.widget.AppCompatImageButton'),
149149
).tap();
150150
}
151151

0 commit comments

Comments
 (0)