Skip to content

Commit ce82653

Browse files
committed
🐞 Bug Fixes: EsLinter
1 parent e89c8dd commit ce82653

37 files changed

+648
-468
lines changed

.eslintrc

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,47 @@
11
{
22
"extends": "airbnb",
3-
"parser": "babel-eslint",
3+
"plugins": [
4+
"import"
5+
],
6+
"parser": "@babel/eslint-parser",
47
"parserOptions": {
8+
"requireConfigFile": false,
59
"ecmaFeatures": {
610
"jsx": true,
711
"classes": true
8-
}
12+
},
13+
"sourceType": "module"
14+
},
15+
"env": {
16+
"browser": true,
17+
"es6": true
918
},
1019
"rules": {
11-
"react/jsx-filename-extension": ["error", { "extensions": [".js", ".jsx"] }]
20+
"react/jsx-filename-extension": [
21+
"error",
22+
{
23+
"extensions": [
24+
".js",
25+
".jsx"
26+
]
27+
}
28+
],
29+
"import/extensions": [
30+
"error",
31+
"ignorePackages",
32+
{
33+
"js": "always",
34+
"jsx": "always"
35+
}
36+
],
37+
"import/no-unresolved": [
38+
"error",
39+
{
40+
"ignore": [
41+
"^react$",
42+
"^react-native$"
43+
]
44+
}
45+
]
1246
}
13-
}
47+
}

app/_layout.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
import { Stack } from 'expo-router'
2-
import { useCallback } from 'react'
3-
import { useFonts } from 'expo-font'
1+
import { Stack } from 'expo-router';
2+
import { useCallback } from 'react';
3+
import { useFonts } from 'expo-font';
44
import * as SplashScreen from 'expo-splash-screen';
55

6-
SplashScreen.preventAutoHideAsync()
6+
SplashScreen.preventAutoHideAsync();
77

8-
const Layout = () => {
8+
function Layout() {
99
const [fontLoaded] = useFonts({
1010
DMBold: require('../assets/fonts/DMSans-Bold.ttf'),
1111
DMMedium: require('../assets/fonts/DMSans-Medium.ttf'),
12-
DMRegular: require('../assets/fonts/DMSans-Regular.ttf')
13-
})
12+
DMRegular: require('../assets/fonts/DMSans-Regular.ttf'),
13+
});
1414

1515
const onLayoutRootView = useCallback(async () => {
1616
if (fontLoaded) {
17-
await SplashScreen.hideAsync()
17+
await SplashScreen.hideAsync();
1818
}
19-
}, [fontLoaded])
19+
}, [fontLoaded]);
2020
if (!fontLoaded) return null;
21-
return <Stack onLayout={onLayoutRootView}/>;
21+
return <Stack onLayout={onLayoutRootView} />;
2222
}
2323

2424
export default Layout;

app/index.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
import { View, Text, ScrollView, SafeAreaView } from 'react-native'
1+
import {
2+
View, Text, ScrollView, SafeAreaView,
3+
} from 'react-native';
24

3-
import { COLORS, icons, images, SIZES } from '../constants'
4-
import { Nearbyjobs, Popularjobs, ScreenHeaderBtn, Welcome } from '../components'
5-
import { Stack, useRouter } from 'expo-router'
5+
import { Stack, useRouter } from 'expo-router';
6+
import {
7+
COLORS, icons, images, SIZES,
8+
} from '../constants';
9+
import {
10+
Nearbyjobs, Popularjobs, ScreenHeaderBtn, Welcome,
11+
} from '../components';
612

7-
const Home = () => {
8-
const router = useRouter()
13+
function Home() {
14+
const router = useRouter();
915
return (
1016
<SafeAreaView style={{ flex: 1, backgroundColor: COLORS.lightWhite }}>
1117
<Stack.Screen options={{
@@ -17,13 +23,15 @@ const Home = () => {
1723
headerRight: () => (
1824
<ScreenHeaderBtn iconUrl={images.profile} dimension="100%" />
1925
),
20-
headerTitle: ""
21-
}} />
26+
headerTitle: '',
27+
}}
28+
/>
2229
<ScrollView showsVerticalScrollIndicator={false}>
2330
<View style={{
2431
flex: 1,
2532
padding: SIZES.medium,
26-
}}>
33+
}}
34+
>
2735
<Welcome />
2836
<Popularjobs />
2937
<Nearbyjobs />

babel.config.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module.exports = function (api) {
22
api.cache(true);
33
return {
4-
presets: ["babel-preset-expo"],
4+
presets: ['babel-preset-expo'],
55
plugins: [
6-
"@babel/plugin-proposal-export-namespace-from",
7-
"react-native-reanimated/plugin",
8-
require.resolve("expo-router/babel"),
6+
'@babel/plugin-proposal-export-namespace-from',
7+
'react-native-reanimated/plugin',
8+
require.resolve('expo-router/babel'),
99
[
10-
"module:react-native-dotenv",
10+
'module:react-native-dotenv',
1111
{
12-
envName: "APP_ENV",
13-
moduleName: "@env",
14-
path: ".env",
12+
envName: 'APP_ENV',
13+
moduleName: '@env',
14+
path: '.env',
1515
blocklist: null,
1616
allowlist: null,
1717
safe: false,
Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import React from 'react'
2-
import { View, Text, TouchableOpacity, Image } from 'react-native'
3-
import { checkImageURL } from '../../../../utils'
1+
import React from 'react';
2+
import {
3+
View, Text, TouchableOpacity, Image,
4+
} from 'react-native';
5+
import { checkImageURL } from '../../../../utils';
46

5-
import styles from './nearbyjobcard.style'
6-
7-
const NearbyJobCard = ({ job, handleNavigate }) => {
7+
import styles from './nearbyjobcard.style';
88

9+
function NearbyJobCard({ job, handleNavigate }) {
910
return (
1011
<TouchableOpacity
1112
style={styles.container}
@@ -16,19 +17,21 @@ const NearbyJobCard = ({ job, handleNavigate }) => {
1617
source={{
1718
uri: checkImageURL(job.employer_logo) ? job.employer_logo : 'https://dummyimage.com/600x400/000/fff',
1819
}}
19-
resizeMode='contain'
20+
resizeMode="contain"
2021
style={styles.logImage}
2122
/>
2223
</TouchableOpacity>
2324
<View style={styles.textContainer}>
2425
<Text
2526
style={styles.jobName}
2627
numberOfLines={1}
27-
>{job?.job_title}</Text>
28+
>
29+
{job?.job_title}
30+
</Text>
2831
<Text style={styles.jobType}>{job?.job_employment_type}</Text>
2932
</View>
3033
</TouchableOpacity>
31-
)
34+
);
3235
}
3336

34-
export default NearbyJobCard
37+
export default NearbyJobCard;

components/common/cards/nearby/nearbyjobcard.style.js

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

3-
import { COLORS, SHADOWS, SIZES } from "../../../../constants";
3+
import { COLORS, SHADOWS, SIZES } from '../../../../constants';
44

55
const styles = StyleSheet.create({
66
container: {
77
flex: 1,
8-
justifyContent: "space-between",
9-
alignItems: "center",
10-
flexDirection: "row",
8+
justifyContent: 'space-between',
9+
alignItems: 'center',
10+
flexDirection: 'row',
1111
padding: SIZES.medium,
1212
borderRadius: SIZES.small,
13-
backgroundColor: "#FFF",
13+
backgroundColor: '#FFF',
1414
...SHADOWS.medium,
1515
shadowColor: COLORS.white,
1616
},
@@ -19,28 +19,28 @@ const styles = StyleSheet.create({
1919
height: 50,
2020
backgroundColor: COLORS.white,
2121
borderRadius: SIZES.medium,
22-
justifyContent: "center",
23-
alignItems: "center",
22+
justifyContent: 'center',
23+
alignItems: 'center',
2424
},
2525
logImage: {
26-
width: "70%",
27-
height: "70%",
26+
width: '70%',
27+
height: '70%',
2828
},
2929
textContainer: {
3030
flex: 1,
3131
marginHorizontal: SIZES.medium,
3232
},
3333
jobName: {
3434
fontSize: SIZES.medium,
35-
fontFamily: "DMBold",
35+
fontFamily: 'DMBold',
3636
color: COLORS.primary,
3737
},
3838
jobType: {
3939
fontSize: SIZES.small + 2,
40-
fontFamily: "DMRegular",
40+
fontFamily: 'DMRegular',
4141
color: COLORS.gray,
4242
marginTop: 3,
43-
textTransform: "capitalize",
43+
textTransform: 'capitalize',
4444
},
4545
});
4646

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import React from 'react'
2-
import { View, Text, TouchableOpacity, Image } from 'react-native'
3-
import { checkImageURL } from '../../../../utils'
1+
import React from 'react';
2+
import {
3+
View, Text, TouchableOpacity, Image,
4+
} from 'react-native';
5+
import { checkImageURL } from '../../../../utils';
46

5-
import styles from './popularjobcard.style'
7+
import styles from './popularjobcard.style';
68

7-
const PopularJobCard = ({ item, selectedJob, handleCardPress }) => {
9+
function PopularJobCard({ item, selectedJob, handleCardPress }) {
810
return (
911
<TouchableOpacity
1012
style={styles.container(selectedJob, item)}
@@ -15,23 +17,27 @@ const PopularJobCard = ({ item, selectedJob, handleCardPress }) => {
1517
source={{
1618
uri: checkImageURL(item.employer_logo) ? item.employer_logo : 'https://dummyimage.com/600x400/000/fff',
1719
}}
18-
resizeMode='contain'
20+
resizeMode="contain"
1921
style={styles.logoImage}
2022
/>
2123
</TouchableOpacity>
2224
<Text
2325
style={styles.companyName}
2426
numberOfLines={1}
25-
>{item?.employer_name}</Text>
27+
>
28+
{item?.employer_name}
29+
</Text>
2630
<View style={styles.infoContainer}>
2731
<Text
2832
style={styles.jobName(selectedJob, item)}
2933
numberOfLines={1}
30-
>{item?.job_title}</Text>
34+
>
35+
{item?.job_title}
36+
</Text>
3137
<Text style={styles.location}>{item?.job_country}</Text>
3238
</View>
3339
</TouchableOpacity>
34-
)
40+
);
3541
}
3642

37-
export default PopularJobCard
43+
export default PopularJobCard;

components/common/cards/popular/popularjobcard.style.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
1-
import { StyleSheet } from "react-native";
1+
import { StyleSheet } from 'react-native';
22

3-
import { COLORS, FONT, SHADOWS, SIZES } from "../../../../constants";
3+
import {
4+
COLORS, FONT, SHADOWS, SIZES,
5+
} from '../../../../constants';
46

57
const styles = StyleSheet.create({
68
container: (selectedJob, item) => ({
79
width: 250,
810
padding: SIZES.xLarge,
9-
backgroundColor: selectedJob === item.job_id ? COLORS.primary : "#FFF",
11+
backgroundColor: selectedJob === item.job_id ? COLORS.primary : '#FFF',
1012
borderRadius: SIZES.medium,
11-
justifyContent: "space-between",
13+
justifyContent: 'space-between',
1214
...SHADOWS.medium,
1315
shadowColor: COLORS.white,
1416
}),
1517
logoContainer: (selectedJob, item) => ({
1618
width: 50,
1719
height: 50,
18-
backgroundColor: selectedJob === item.job_id ? "#FFF" : COLORS.white,
20+
backgroundColor: selectedJob === item.job_id ? '#FFF' : COLORS.white,
1921
borderRadius: SIZES.medium,
20-
justifyContent: "center",
21-
alignItems: "center",
22+
justifyContent: 'center',
23+
alignItems: 'center',
2224
}),
2325
logoImage: {
24-
width: "70%",
25-
height: "70%",
26+
width: '70%',
27+
height: '70%',
2628
},
2729
companyName: {
2830
fontSize: SIZES.medium,
2931
fontFamily: FONT.regular,
30-
color: "#B3AEC6",
32+
color: '#B3AEC6',
3133
marginTop: SIZES.small / 1.5,
3234
},
3335
infoContainer: {
@@ -39,10 +41,10 @@ const styles = StyleSheet.create({
3941
color: selectedJob === item.job_id ? COLORS.white : COLORS.primary,
4042
}),
4143
infoWrapper: {
42-
flexDirection: "row",
44+
flexDirection: 'row',
4345
marginTop: 5,
44-
justifyContent: "flex-start",
45-
alignItems: "center",
46+
justifyContent: 'flex-start',
47+
alignItems: 'center',
4648
},
4749
publisher: (selectedJob) => ({
4850
fontSize: SIZES.medium - 2,
@@ -52,7 +54,7 @@ const styles = StyleSheet.create({
5254
location: {
5355
fontSize: SIZES.medium - 2,
5456
fontFamily: FONT.regular,
55-
color: "#B3AEC6",
57+
color: '#B3AEC6',
5658
},
5759
});
5860

0 commit comments

Comments
 (0)