Skip to content

Commit 9bf1820

Browse files
author
Petr Konecny
committed
chore: linter global fix
1 parent 07df8c1 commit 9bf1820

28 files changed

+362
-233
lines changed

eslint.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,14 @@ module.exports = defineConfig([
88
eslintPluginPrettierRecommended,
99
{
1010
ignores: ['dist/*'],
11+
settings: {
12+
'import/resolver': {
13+
typescript: {
14+
project: ['tsconfig.json', 'example/tsconfig.json'],
15+
alwaysTryTypes: true,
16+
bun: true,
17+
},
18+
},
19+
},
1120
},
1221
])

example/app/(tabs)/_layout.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { Tabs } from 'expo-router';
2-
import React from 'react';
3-
import { Platform } from 'react-native';
1+
import { Tabs } from 'expo-router'
2+
import React from 'react'
3+
import { Platform } from 'react-native'
44

5-
import { HapticTab } from '@/components/HapticTab';
6-
import { IconSymbol } from '@/components/ui/IconSymbol';
7-
import TabBarBackground from '@/components/ui/TabBarBackground';
8-
import { Colors } from '@/constants/Colors';
9-
import { useColorScheme } from '@/hooks/useColorScheme';
5+
import { HapticTab } from '@/components/HapticTab'
6+
import { IconSymbol } from '@/components/ui/IconSymbol'
7+
import TabBarBackground from '@/components/ui/TabBarBackground'
8+
import { Colors } from '@/constants/Colors'
9+
import { useColorScheme } from '@/hooks/useColorScheme'
1010

1111
export default function TabLayout() {
12-
const colorScheme = useColorScheme();
12+
const colorScheme = useColorScheme()
1313

1414
return (
1515
<Tabs
@@ -25,7 +25,8 @@ export default function TabLayout() {
2525
},
2626
default: {},
2727
}),
28-
}}>
28+
}}
29+
>
2930
<Tabs.Screen
3031
name="index"
3132
options={{
@@ -41,5 +42,5 @@ export default function TabLayout() {
4142
}}
4243
/>
4344
</Tabs>
44-
);
45+
)
4546
}

example/app/(tabs)/explore.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { ThemedView } from "@/components/ThemedView";
2-
import { Carousel } from "@strv/react-native-hero-carousel";
3-
import { SafeAreaView } from "react-native";
1+
import { ThemedView } from '@/components/ThemedView'
2+
import { Carousel } from '@strv/react-native-hero-carousel'
3+
import { SafeAreaView } from 'react-native'
44
export default function TabTwoScreen() {
55
return (
66
<SafeAreaView style={{ flex: 1 }}>
77
<ThemedView style={{ flex: 1 }}>
88
<Carousel />
99
</ThemedView>
1010
</SafeAreaView>
11-
);
12-
}
11+
)
12+
}

example/app/(tabs)/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { ThemedView } from "@/components/ThemedView";
2-
import { Carousel } from "@strv/react-native-hero-carousel";
3-
import { SafeAreaView } from "react-native";
1+
import { ThemedView } from '@/components/ThemedView'
2+
import { Carousel } from '@strv/react-native-hero-carousel'
3+
import { SafeAreaView } from 'react-native'
44
export default function HomeScreen() {
55
return (
66
<SafeAreaView style={{ flex: 1 }}>
77
<ThemedView style={{ flex: 1 }}>
88
<Carousel />
99
</ThemedView>
1010
</SafeAreaView>
11-
);
12-
}
11+
)
12+
}

example/app/+not-found.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React from 'react';
2-
import { Link, Stack } from 'expo-router';
3-
import { StyleSheet } from 'react-native';
1+
import React from 'react'
2+
import { Link, Stack } from 'expo-router'
3+
import { StyleSheet } from 'react-native'
44

5-
import { ThemedText } from '@/components/ThemedText';
6-
import { ThemedView } from '@/components/ThemedView';
5+
import { ThemedText } from '@/components/ThemedText'
6+
import { ThemedView } from '@/components/ThemedView'
77

88
export default function NotFoundScreen() {
99
return (
@@ -16,7 +16,7 @@ export default function NotFoundScreen() {
1616
</Link>
1717
</ThemedView>
1818
</>
19-
);
19+
)
2020
}
2121

2222
const styles = StyleSheet.create({
@@ -30,4 +30,4 @@ const styles = StyleSheet.create({
3030
marginTop: 15,
3131
paddingVertical: 15,
3232
},
33-
});
33+
})

example/app/_layout.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native';
2-
import { useFonts } from 'expo-font';
3-
import { Stack } from 'expo-router';
4-
import { StatusBar } from 'expo-status-bar';
5-
import 'react-native-reanimated';
1+
import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native'
2+
import { useFonts } from 'expo-font'
3+
import { Stack } from 'expo-router'
4+
import { StatusBar } from 'expo-status-bar'
5+
import 'react-native-reanimated'
66

7-
import { useColorScheme } from '@/hooks/useColorScheme';
7+
import { useColorScheme } from '@/hooks/useColorScheme'
88

99
export default function RootLayout() {
10-
const colorScheme = useColorScheme();
10+
const colorScheme = useColorScheme()
1111
const [loaded] = useFonts({
1212
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
13-
});
13+
})
1414

1515
if (!loaded) {
1616
// Async font loading only occurs in development.
17-
return null;
17+
return null
1818
}
1919

2020
return (
@@ -25,5 +25,5 @@ export default function RootLayout() {
2525
</Stack>
2626
<StatusBar style="auto" />
2727
</ThemeProvider>
28-
);
28+
)
2929
}

example/components/Collapsible.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
import { PropsWithChildren, useState } from 'react';
2-
import { StyleSheet, TouchableOpacity } from 'react-native';
1+
import { PropsWithChildren, useState } from 'react'
2+
import { StyleSheet, TouchableOpacity } from 'react-native'
33

4-
import { ThemedText } from '@/components/ThemedText';
5-
import { ThemedView } from '@/components/ThemedView';
6-
import { IconSymbol } from '@/components/ui/IconSymbol';
7-
import { Colors } from '@/constants/Colors';
8-
import { useColorScheme } from '@/hooks/useColorScheme';
4+
import { ThemedText } from '@/components/ThemedText'
5+
import { ThemedView } from '@/components/ThemedView'
6+
import { IconSymbol } from '@/components/ui/IconSymbol'
7+
import { Colors } from '@/constants/Colors'
8+
import { useColorScheme } from '@/hooks/useColorScheme'
99

1010
export function Collapsible({ children, title }: PropsWithChildren & { title: string }) {
11-
const [isOpen, setIsOpen] = useState(false);
12-
const theme = useColorScheme() ?? 'light';
11+
const [isOpen, setIsOpen] = useState(false)
12+
const theme = useColorScheme() ?? 'light'
1313

1414
return (
1515
<ThemedView>
1616
<TouchableOpacity
1717
style={styles.heading}
1818
onPress={() => setIsOpen((value) => !value)}
19-
activeOpacity={0.8}>
19+
activeOpacity={0.8}
20+
>
2021
<IconSymbol
2122
name="chevron.right"
2223
size={18}
@@ -29,7 +30,7 @@ export function Collapsible({ children, title }: PropsWithChildren & { title: st
2930
</TouchableOpacity>
3031
{isOpen && <ThemedView style={styles.content}>{children}</ThemedView>}
3132
</ThemedView>
32-
);
33+
)
3334
}
3435

3536
const styles = StyleSheet.create({
@@ -42,4 +43,4 @@ const styles = StyleSheet.create({
4243
marginTop: 6,
4344
marginLeft: 24,
4445
},
45-
});
46+
})
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Href, Link } from 'expo-router';
2-
import { openBrowserAsync } from 'expo-web-browser';
3-
import { type ComponentProps } from 'react';
4-
import { Platform } from 'react-native';
1+
import { Href, Link } from 'expo-router'
2+
import { openBrowserAsync } from 'expo-web-browser'
3+
import { type ComponentProps } from 'react'
4+
import { Platform } from 'react-native'
55

6-
type Props = Omit<ComponentProps<typeof Link>, 'href'> & { href: Href & string };
6+
type Props = Omit<ComponentProps<typeof Link>, 'href'> & { href: Href & string }
77

88
export function ExternalLink({ href, ...rest }: Props) {
99
return (
@@ -14,11 +14,11 @@ export function ExternalLink({ href, ...rest }: Props) {
1414
onPress={async (event) => {
1515
if (Platform.OS !== 'web') {
1616
// Prevent the default behavior of linking to the default browser on native.
17-
event.preventDefault();
17+
event.preventDefault()
1818
// Open the link in an in-app browser.
19-
await openBrowserAsync(href);
19+
await openBrowserAsync(href)
2020
}
2121
}}
2222
/>
23-
);
23+
)
2424
}

example/components/HapticTab.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { BottomTabBarButtonProps } from '@react-navigation/bottom-tabs';
2-
import { PlatformPressable } from '@react-navigation/elements';
3-
import * as Haptics from 'expo-haptics';
1+
import { BottomTabBarButtonProps } from '@react-navigation/bottom-tabs'
2+
import { PlatformPressable } from '@react-navigation/elements'
3+
import * as Haptics from 'expo-haptics'
44

55
export function HapticTab(props: BottomTabBarButtonProps) {
66
return (
@@ -9,10 +9,10 @@ export function HapticTab(props: BottomTabBarButtonProps) {
99
onPressIn={(ev) => {
1010
if (process.env.EXPO_OS === 'ios') {
1111
// Add a soft haptic feedback when pressing down on the tabs.
12-
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
12+
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light)
1313
}
14-
props.onPressIn?.(ev);
14+
props.onPressIn?.(ev)
1515
}}
1616
/>
17-
);
17+
)
1818
}

example/components/HelloWave.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
import { useEffect } from 'react';
2-
import { StyleSheet } from 'react-native';
1+
import { useEffect } from 'react'
2+
import { StyleSheet } from 'react-native'
33
import Animated, {
44
useAnimatedStyle,
55
useSharedValue,
66
withRepeat,
77
withSequence,
88
withTiming,
9-
} from 'react-native-reanimated';
9+
} from 'react-native-reanimated'
1010

11-
import { ThemedText } from '@/components/ThemedText';
11+
import { ThemedText } from '@/components/ThemedText'
1212

1313
export function HelloWave() {
14-
const rotationAnimation = useSharedValue(0);
14+
const rotationAnimation = useSharedValue(0)
1515

1616
useEffect(() => {
1717
rotationAnimation.value = withRepeat(
1818
withSequence(withTiming(25, { duration: 150 }), withTiming(0, { duration: 150 })),
19-
4 // Run the animation 4 times
20-
);
21-
}, [rotationAnimation]);
19+
4, // Run the animation 4 times
20+
)
21+
}, [rotationAnimation])
2222

2323
const animatedStyle = useAnimatedStyle(() => ({
2424
transform: [{ rotate: `${rotationAnimation.value}deg` }],
25-
}));
25+
}))
2626

2727
return (
2828
<Animated.View style={animatedStyle}>
2929
<ThemedText style={styles.text}>👋</ThemedText>
3030
</Animated.View>
31-
);
31+
)
3232
}
3333

3434
const styles = StyleSheet.create({
@@ -37,4 +37,4 @@ const styles = StyleSheet.create({
3737
lineHeight: 32,
3838
marginTop: -6,
3939
},
40-
});
40+
})

0 commit comments

Comments
 (0)