From c9f5d4c0c900e76f3518506e6fc4e184eeb5c236 Mon Sep 17 00:00:00 2001 From: alduzy Date: Wed, 17 Jul 2024 15:39:42 +0200 Subject: [PATCH 1/6] Copy prettier configs --- FabricExample/.prettierrc.js | 3 +-- FabricExample/index.js | 4 ++-- TVOSExample/index.js | 8 ++------ apps/App.tsx | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/FabricExample/.prettierrc.js b/FabricExample/.prettierrc.js index 2b540746a7..50bff15e6c 100644 --- a/FabricExample/.prettierrc.js +++ b/FabricExample/.prettierrc.js @@ -1,7 +1,6 @@ module.exports = { arrowParens: 'avoid', bracketSameLine: true, - bracketSpacing: false, singleQuote: true, - trailingComma: 'all', + jsxBracketSameLine: true, }; diff --git a/FabricExample/index.js b/FabricExample/index.js index 7cd584caf0..ab0ecbf4f8 100644 --- a/FabricExample/index.js +++ b/FabricExample/index.js @@ -1,5 +1,5 @@ -import {AppRegistry} from 'react-native'; +import { AppRegistry } from 'react-native'; import App from './App'; -import {name as appName} from './app.json'; +import { name as appName } from './app.json'; AppRegistry.registerComponent(appName, () => App); diff --git a/TVOSExample/index.js b/TVOSExample/index.js index a850d031de..ab0ecbf4f8 100644 --- a/TVOSExample/index.js +++ b/TVOSExample/index.js @@ -1,9 +1,5 @@ -/** - * @format - */ - -import {AppRegistry} from 'react-native'; +import { AppRegistry } from 'react-native'; import App from './App'; -import {name as appName} from './app.json'; +import { name as appName } from './app.json'; AppRegistry.registerComponent(appName, () => App); diff --git a/apps/App.tsx b/apps/App.tsx index f0a2e8ad76..23a9af9c45 100644 --- a/apps/App.tsx +++ b/apps/App.tsx @@ -7,5 +7,5 @@ enableFreeze(true); export default function App() { return ; - // return + // return ; } From 3e06990a4900c256bf327e88d81566609ed029ab Mon Sep 17 00:00:00 2001 From: alduzy Date: Wed, 17 Jul 2024 15:40:05 +0200 Subject: [PATCH 2/6] fix example eslint syntax --- Example/.eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Example/.eslintrc.js b/Example/.eslintrc.js index 15cca67849..187894b6af 100644 --- a/Example/.eslintrc.js +++ b/Example/.eslintrc.js @@ -1,4 +1,4 @@ -module.export = { +module.exports = { root: true, extends: '@react-native', }; From 41c8f40252e5ba21eebe78def500a76c9c6c0a17 Mon Sep 17 00:00:00 2001 From: alduzy Date: Wed, 17 Jul 2024 15:41:24 +0200 Subject: [PATCH 3/6] removed root prettier overrides --- Example/.prettierrc.js | 6 ------ FabricExample/.prettierrc.js | 6 ------ TVOSExample/.prettierrc.js | 6 ------ apps/.prettierrc.js | 6 ------ 4 files changed, 24 deletions(-) delete mode 100644 Example/.prettierrc.js delete mode 100644 FabricExample/.prettierrc.js delete mode 100644 TVOSExample/.prettierrc.js delete mode 100644 apps/.prettierrc.js diff --git a/Example/.prettierrc.js b/Example/.prettierrc.js deleted file mode 100644 index 50bff15e6c..0000000000 --- a/Example/.prettierrc.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - arrowParens: 'avoid', - bracketSameLine: true, - singleQuote: true, - jsxBracketSameLine: true, -}; diff --git a/FabricExample/.prettierrc.js b/FabricExample/.prettierrc.js deleted file mode 100644 index 50bff15e6c..0000000000 --- a/FabricExample/.prettierrc.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - arrowParens: 'avoid', - bracketSameLine: true, - singleQuote: true, - jsxBracketSameLine: true, -}; diff --git a/TVOSExample/.prettierrc.js b/TVOSExample/.prettierrc.js deleted file mode 100644 index 50bff15e6c..0000000000 --- a/TVOSExample/.prettierrc.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - arrowParens: 'avoid', - bracketSameLine: true, - singleQuote: true, - jsxBracketSameLine: true, -}; diff --git a/apps/.prettierrc.js b/apps/.prettierrc.js deleted file mode 100644 index 50bff15e6c..0000000000 --- a/apps/.prettierrc.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - arrowParens: 'avoid', - bracketSameLine: true, - singleQuote: true, - jsxBracketSameLine: true, -}; From a9e0e09ee93f20dcf5a21a21894c2129a0dc3757 Mon Sep 17 00:00:00 2001 From: alduzy Date: Wed, 17 Jul 2024 15:50:02 +0200 Subject: [PATCH 4/6] Format files with prettier --- apps/src/screens/Gestures.tsx | 4 +++- apps/src/screens/HeaderOptions.tsx | 4 +++- apps/src/shared/SettingsMultiInput.tsx | 5 +++- apps/src/shared/Square.tsx | 5 +++- apps/src/tests/Test1072.tsx | 2 +- apps/src/tests/Test1209.tsx | 2 +- apps/src/tests/Test1296.tsx | 2 +- apps/src/tests/Test1463.tsx | 2 +- apps/src/tests/Test1476.tsx | 6 ++--- apps/src/tests/Test1539.tsx | 2 +- apps/src/tests/Test1645.js | 20 ++++++++-------- apps/src/tests/Test1802.tsx | 2 +- apps/src/tests/Test1844.tsx | 2 +- apps/src/tests/Test1981.tsx | 11 +++++++-- apps/src/tests/Test2028.tsx | 1 - apps/src/tests/Test2223.tsx | 1 - apps/src/tests/Test2227.tsx | 12 +++++----- apps/src/tests/Test263.js | 2 +- apps/src/tests/Test432.tsx | 2 +- apps/src/tests/Test593.tsx | 32 +++++++++++++------------- apps/src/tests/Test645.js | 5 +++- apps/src/tests/Test860.tsx | 8 +++---- apps/src/tests/Test887.tsx | 6 ++--- apps/src/tests/Test898.tsx | 14 +++++------ apps/src/tests/TestHeader.tsx | 31 +++++++++++++++++++++---- apps/src/tests/TestScreenAnimation.tsx | 17 ++++++++------ 26 files changed, 121 insertions(+), 79 deletions(-) diff --git a/apps/src/screens/Gestures.tsx b/apps/src/screens/Gestures.tsx index be785c35c0..4e7cd4d96e 100644 --- a/apps/src/screens/Gestures.tsx +++ b/apps/src/screens/Gestures.tsx @@ -46,7 +46,9 @@ interface DetailsScreenProps { navigation: NativeStackNavigationProp; } -const DetailsScreen = ({ navigation }: DetailsScreenProps): React.JSX.Element => { +const DetailsScreen = ({ + navigation, +}: DetailsScreenProps): React.JSX.Element => { const headerHeight = useHeaderHeight(); const [gestureEnabled, setGestureEnabled] = useState(true); const [fullScreenGestureEnabled, setFullScreenGestureEnabled] = diff --git a/apps/src/screens/HeaderOptions.tsx b/apps/src/screens/HeaderOptions.tsx index afabf73f48..d07305a0ee 100644 --- a/apps/src/screens/HeaderOptions.tsx +++ b/apps/src/screens/HeaderOptions.tsx @@ -47,7 +47,9 @@ interface SettingsScreenProps { navigation: NativeStackNavigationProp; } -const SettingsScreen = ({ navigation }: SettingsScreenProps): React.JSX.Element => { +const SettingsScreen = ({ + navigation, +}: SettingsScreenProps): React.JSX.Element => { const toast = useToast(); const [headerTitle, setHeaderTitle] = useState('Settings'); diff --git a/apps/src/shared/SettingsMultiInput.tsx b/apps/src/shared/SettingsMultiInput.tsx index 8936f32d01..b1368e88fe 100644 --- a/apps/src/shared/SettingsMultiInput.tsx +++ b/apps/src/shared/SettingsMultiInput.tsx @@ -10,7 +10,10 @@ type Props = { }[]; }; -export function SettingsMultiInput({ label, handlers }: Props): React.JSX.Element { +export function SettingsMultiInput({ + label, + handlers, +}: Props): React.JSX.Element { return ( diff --git a/apps/src/shared/Square.tsx b/apps/src/shared/Square.tsx index 246eda36a6..480c1d740e 100644 --- a/apps/src/shared/Square.tsx +++ b/apps/src/shared/Square.tsx @@ -6,6 +6,9 @@ interface Props { size?: number; } -export const Square = ({ size = 100, color = 'red' }: Props): React.JSX.Element => ( +export const Square = ({ + size = 100, + color = 'red', +}: Props): React.JSX.Element => ( ); diff --git a/apps/src/tests/Test1072.tsx b/apps/src/tests/Test1072.tsx index f6a3b1403c..3499db7f7f 100644 --- a/apps/src/tests/Test1072.tsx +++ b/apps/src/tests/Test1072.tsx @@ -80,7 +80,7 @@ function Post({ onPress }: { onPress?: () => void }) { function generatePhotos( amount: number, width: number, - height: number, + height: number ): JSX.Element[] { const startFrom = Math.floor(Math.random() * 20) + 10; return Array.from({ length: amount }, (_, index) => { diff --git a/apps/src/tests/Test1209.tsx b/apps/src/tests/Test1209.tsx index cdfd981899..315170123e 100644 --- a/apps/src/tests/Test1209.tsx +++ b/apps/src/tests/Test1209.tsx @@ -88,7 +88,7 @@ function TabAStack() { } export const maybePopToTop = ( - navigation: StackNavigationProp, + navigation: StackNavigationProp ) => { const state = navigation.getState().routes; diff --git a/apps/src/tests/Test1296.tsx b/apps/src/tests/Test1296.tsx index 75846053be..643a786883 100644 --- a/apps/src/tests/Test1296.tsx +++ b/apps/src/tests/Test1296.tsx @@ -105,7 +105,7 @@ function Post({ onPress }: { onPress?: () => void }) { function generatePhotos( amount: number, width: number, - height: number, + height: number ): JSX.Element[] { const startFrom = Math.floor(Math.random() * 20) + 10; return Array.from({ length: amount }, (_, index) => { diff --git a/apps/src/tests/Test1463.tsx b/apps/src/tests/Test1463.tsx index 30d833fc2d..fc3cdbe332 100644 --- a/apps/src/tests/Test1463.tsx +++ b/apps/src/tests/Test1463.tsx @@ -95,7 +95,7 @@ function Post({ onPress }: { onPress?: () => void }) { function generatePhotos( amount: number, width: number, - height: number, + height: number ): JSX.Element[] { const startFrom = Math.floor(Math.random() * 20) + 10; return Array.from({ length: amount }, (_, index) => { diff --git a/apps/src/tests/Test1476.tsx b/apps/src/tests/Test1476.tsx index 3334d21e53..61048e7681 100644 --- a/apps/src/tests/Test1476.tsx +++ b/apps/src/tests/Test1476.tsx @@ -71,7 +71,7 @@ function ModalA(props: Props) { const StackBuilder = ( configs: any, - groupOptions?: NativeStackNavigationOptions, + groupOptions?: NativeStackNavigationOptions ) => { return () => ( @@ -113,7 +113,7 @@ const ScreenGroup = StackBuilder( gestureEnabled: true, contentStyle: { backgroundColor: 'white' }, fullScreenGestureEnabled: true, - }, + } ); const ModalGroup = StackBuilder( @@ -130,7 +130,7 @@ const ModalGroup = StackBuilder( presentation: 'containedTransparentModal', fullScreenGestureEnabled: true, animationMatchesGesture: true, - }, + } ); export default function TestModalPresentation() { diff --git a/apps/src/tests/Test1539.tsx b/apps/src/tests/Test1539.tsx index 332f4a9510..e3440a3973 100644 --- a/apps/src/tests/Test1539.tsx +++ b/apps/src/tests/Test1539.tsx @@ -33,7 +33,7 @@ function RootScreen() { () => (reaProgress.progress.value < 0.5 ? reaProgress.progress.value * 50 - : (1 - reaProgress.progress.value) * 50) + 50, + : (1 - reaProgress.progress.value) * 50) + 50 ); const reaStyle = useAnimatedStyle(() => { return { diff --git a/apps/src/tests/Test1645.js b/apps/src/tests/Test1645.js index ec4a508944..fc4d10ea6a 100644 --- a/apps/src/tests/Test1645.js +++ b/apps/src/tests/Test1645.js @@ -1,12 +1,12 @@ /* eslint-disable react-native/no-inline-styles */ -import React, {useEffect, useState} from 'react'; -import {Text, View} from 'react-native'; +import React, { useEffect, useState } from 'react'; +import { Text, View } from 'react-native'; -import {createBottomTabNavigator} from '@react-navigation/bottom-tabs'; -import {createNativeStackNavigator} from '@react-navigation/native-stack'; -import {createStackNavigator} from '@react-navigation/stack'; -import {NavigationContainer} from '@react-navigation/native'; +import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; +import { createStackNavigator } from '@react-navigation/stack'; +import { NavigationContainer } from '@react-navigation/native'; const TestBottomTabBar = createBottomTabNavigator(); const TestNativeStack1 = createNativeStackNavigator(); @@ -28,8 +28,8 @@ const TestScreen1 = () => { flex: 1, backgroundColor: '#000', }}> - {Array.from({length: 100}).map((e, idx) => ( - + {Array.from({ length: 100 }).map((e, idx) => ( + T{idx}: {t} ))} @@ -54,8 +54,8 @@ const TestScreen2 = () => { flex: 1, backgroundColor: '#000', }}> - {Array.from({length: 100}).map((e, idx) => ( - + {Array.from({ length: 100 }).map((e, idx) => ( + T{idx}: {t} ))} diff --git a/apps/src/tests/Test1802.tsx b/apps/src/tests/Test1802.tsx index a82e59e036..9714100e2c 100644 --- a/apps/src/tests/Test1802.tsx +++ b/apps/src/tests/Test1802.tsx @@ -136,7 +136,7 @@ function Post({ onPress }: { onPress?: () => void }) { function generatePhotos( amount: number, width: number, - height: number, + height: number ): JSX.Element[] { const startFrom = Math.floor(Math.random() * 20) + 10; return Array.from({ length: amount }, (_, index) => { diff --git a/apps/src/tests/Test1844.tsx b/apps/src/tests/Test1844.tsx index 4a9ffa2d4f..1dc72293b8 100644 --- a/apps/src/tests/Test1844.tsx +++ b/apps/src/tests/Test1844.tsx @@ -104,7 +104,7 @@ function Post({ onPress }: { onPress?: () => void }) { function generatePhotos( amount: number, width: number, - height: number, + height: number ): JSX.Element[] { const startFrom = Math.floor(Math.random() * 20) + 10; return Array.from({ length: amount }, (_, index) => { diff --git a/apps/src/tests/Test1981.tsx b/apps/src/tests/Test1981.tsx index 511c2b6a8c..9bbd3bfee7 100644 --- a/apps/src/tests/Test1981.tsx +++ b/apps/src/tests/Test1981.tsx @@ -1,6 +1,13 @@ import React from 'react'; -import { NavigationContainer, NavigationContext, ParamListBase } from '@react-navigation/native'; -import { createNativeStackNavigator, NativeStackNavigationProp } from '@react-navigation/native-stack'; +import { + NavigationContainer, + NavigationContext, + ParamListBase, +} from '@react-navigation/native'; +import { + createNativeStackNavigator, + NativeStackNavigationProp, +} from '@react-navigation/native-stack'; import { View, StyleSheet, Button, Pressable, Text } from 'react-native'; type NavProp = { diff --git a/apps/src/tests/Test2028.tsx b/apps/src/tests/Test2028.tsx index 81c1f1aa3f..2c80ab4539 100644 --- a/apps/src/tests/Test2028.tsx +++ b/apps/src/tests/Test2028.tsx @@ -1,4 +1,3 @@ - import React from 'react'; import { Button, SafeAreaView, View } from 'react-native'; diff --git a/apps/src/tests/Test2223.tsx b/apps/src/tests/Test2223.tsx index 587fbf38da..e5c2ae557d 100644 --- a/apps/src/tests/Test2223.tsx +++ b/apps/src/tests/Test2223.tsx @@ -85,4 +85,3 @@ const styles = StyleSheet.create({ color: 'black', }, }); - diff --git a/apps/src/tests/Test2227.tsx b/apps/src/tests/Test2227.tsx index 301254e2f5..f7e60c5fd5 100644 --- a/apps/src/tests/Test2227.tsx +++ b/apps/src/tests/Test2227.tsx @@ -1,10 +1,10 @@ import * as React from 'react'; -import {NavigationContainer} from '@react-navigation/native'; +import { NavigationContainer } from '@react-navigation/native'; import { createNativeStackNavigator, NativeStackScreenProps, } from '@react-navigation/native-stack'; -import {Button, View, Text} from 'react-native'; +import { Button, View, Text } from 'react-native'; type RootStackParamList = { Home: undefined; @@ -16,9 +16,9 @@ type DetailsScreenProps = NativeStackScreenProps; const Stack = createNativeStackNavigator(); -function HomeScreen({navigation}: HomeScreenProps) { +function HomeScreen({ navigation }: HomeScreenProps) { return ( - + Home Screen