Skip to content

Commit c0efa94

Browse files
fix(sonar): expected curly after if condition
1 parent 5969428 commit c0efa94

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = {
1919
ignore: ['/android', '/ios'],
2020
},
2121
],
22+
curly: [2, 'all'],
2223
},
2324
overrides: [
2425
// Configuration for TypeScript files
@@ -72,6 +73,7 @@ module.exports = {
7273
caughtErrorsIgnorePattern: '^_',
7374
},
7475
],
76+
curly: [2, 'all'],
7577
},
7678
},
7779
// Configuration for translations files (i18next)
@@ -106,6 +108,7 @@ module.exports = {
106108
endOfLine: 'auto',
107109
},
108110
],
111+
curly: [2, 'all'],
109112
},
110113
},
111114
{

src/components/colors.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export const Colors = () => {
1818
};
1919

2020
const Color = ({ name }: { name: ColorName }) => {
21-
if (typeof colors[name] === 'string') return null;
21+
if (typeof colors[name] === 'string') {
22+
return null;
23+
}
2224
return (
2325
<View className="pt-2">
2426
<Text className="font-medium">{name.toUpperCase()}</Text>

src/core/i18n/utils.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ export const changeLanguage = (lang: Language) => {
3232
I18nManager.forceRTL(false);
3333
}
3434
if (Platform.OS === 'ios' || Platform.OS === 'android') {
35-
if (__DEV__) NativeModules.DevSettings.reload();
36-
else RNRestart.restart();
35+
if (__DEV__) {
36+
NativeModules.DevSettings.reload();
37+
} else {
38+
RNRestart.restart();
39+
}
3740
} else if (Platform.OS === 'web') {
3841
window.location.reload();
3942
}
@@ -45,7 +48,9 @@ export const useSelectedLanguage = () => {
4548
const setLanguage = useCallback(
4649
(lang: Language) => {
4750
setLang(lang);
48-
if (lang !== undefined) changeLanguage(lang as Language);
51+
if (lang !== undefined) {
52+
changeLanguage(lang as Language);
53+
}
4954
},
5055
[setLang]
5156
);

src/core/use-theme-config.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ const LightTheme: Theme = {
3131
export function useThemeConfig() {
3232
const { colorScheme } = useColorScheme();
3333

34-
if (colorScheme === 'dark') return DarkTheme;
34+
if (colorScheme === 'dark') {
35+
return DarkTheme;
36+
}
3537

3638
return LightTheme;
3739
}

0 commit comments

Comments
 (0)