Skip to content

Commit

Permalink
Fixed linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Saperstein committed Aug 20, 2024
1 parent 503848f commit 4137d2b
Show file tree
Hide file tree
Showing 15 changed files with 2,163 additions and 1,386 deletions.
8 changes: 4 additions & 4 deletions frontend/constants/Colors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
white: '#fff',
black: '#000'
}
export default {
white: '#fff',
black: '#000',
}
22 changes: 12 additions & 10 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import globals from 'globals'
import pluginJs from '@eslint/js'
import tseslint from 'typescript-eslint'
import pluginReact from 'eslint-plugin-react'
import jsEslint from '@eslint/js'
import typescriptEslint from 'typescript-eslint'
import eslintPluginReact from 'eslint-plugin-react'
import eslintConfigPrettier from 'eslint-config-prettier'

export default [
{ files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] },
{ languageOptions: { globals: globals.browser, parser: '@typescript-eslint/parser' } },
{ ignores: ['.eslintrc.js', '.prettierrc.json', 'babel.config.js', '**/node_modules/', '.git/'] },
{ languageOptions: { globals: globals.browser } },
jsEslint.configs.recommended,
...typescriptEslint.configs.recommended,
eslintPluginReact.configs.flat.recommended,
eslintConfigPrettier,
{
rules: {
'no-duplicate-imports': 'error',
Expand All @@ -21,17 +27,13 @@ export default [
'default-case-last': 'error',
eqeqeq: 'error',
'no-else-return': 'error',
'no-magic-numbers': 'error',
'no-unneeded-ternary': 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-destructuring': 'warn',
'prefer-exponentiation-operator': 'warn',
'require-await': 'error',
'react/prop-types': 'off',
'@typescript-eslint/no-require-imports': 'off',
},
},
{ ignores: ['.eslintrc.js', '.prettierrc.json', 'babel.config.js', '**/node_modules/', '.git/'] },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
]
88 changes: 44 additions & 44 deletions frontend/navigation/BottomTabs.tsx
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
import React from 'react';
import FontAwesome5 from '@expo/vector-icons/FontAwesome5';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import SecondScreen from '../screens/secondScreen/secondScreen';
import StackNavigator from './StackNavigator';

const Tab = createBottomTabNavigator();

function TabBarIcon(props: {name: string, color: string}) {
return (
<FontAwesome5
name={props.name}
size={26}
style={{ marginBottom: -3 }}
color={props.color}
/>
);
}

export default function TabNavigator() {
return(
<Tab.Navigator initialRouteName="Home">
<Tab.Screen name="Stack" component={StackNavigator}
options={{tabBarIcon: ({ focused }) => (
<TabBarIcon
color={focused ? 'blue' : 'black'}
name='circle'
/>
),
tabBarLabel: 'Home',
title: '',
headerShown: false,
}} />
<Tab.Screen name="secondScreen" component={SecondScreen}
options={{ tabBarIcon: ({ focused }) => (
<TabBarIcon color={focused ? 'blue' : 'black'} name='square' />
),
tabBarLabel: 'Second screen',
title: '',
headerShown: false,
}} />
</Tab.Navigator>
)
}
import React from 'react'
import FontAwesome5 from '@expo/vector-icons/FontAwesome5'
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
import SecondScreen from '../screens/secondScreen/secondScreen'
import StackNavigator from './StackNavigator'

const Tab = createBottomTabNavigator()

function TabBarIcon(props: { name: string; color: string }) {
return (
<FontAwesome5 name={props.name} size={26} style={{ marginBottom: -3 }} color={props.color} />
)
}

export default function TabNavigator() {
return (
<Tab.Navigator initialRouteName='Home'>
<Tab.Screen
name='Stack'
component={StackNavigator}
options={{
tabBarIcon: ({ focused }) => (
<TabBarIcon color={focused ? 'blue' : 'black'} name='circle' />
),
tabBarLabel: 'Home',
title: '',
headerShown: false,
}}
/>
<Tab.Screen
name='secondScreen'
component={SecondScreen}
options={{
tabBarIcon: ({ focused }) => (
<TabBarIcon color={focused ? 'blue' : 'black'} name='square' />
),
tabBarLabel: 'Second screen',
title: '',
headerShown: false,
}}
/>
</Tab.Navigator>
)
}
44 changes: 20 additions & 24 deletions frontend/navigation/StackNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import React from 'react';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

import HomeScreen from '../screens/home/home';
import SecondScreen from '../screens/secondScreen/secondScreen';

const Stack = createNativeStackNavigator();

export default function StackNavigator() {
return (
<Stack.Navigator initialRouteName="homeScreen">
<Stack.Screen
name="homeScreen"
component={HomeScreen}
options={{ title: '', headerShown: false }}
/>
<Stack.Screen
name="secondScreen"
component={SecondScreen}
options={{ title: '' }}
/>
</Stack.Navigator>
)
}
import React from 'react'
import { createNativeStackNavigator } from '@react-navigation/native-stack'

import HomeScreen from '../screens/home/home'
import SecondScreen from '../screens/secondScreen/secondScreen'

const Stack = createNativeStackNavigator()

export default function StackNavigator() {
return (
<Stack.Navigator initialRouteName='homeScreen'>
<Stack.Screen
name='homeScreen'
component={HomeScreen}
options={{ title: '', headerShown: false }}
/>
<Stack.Screen name='secondScreen' component={SecondScreen} options={{ title: '' }} />
</Stack.Navigator>
)
}
Loading

0 comments on commit 4137d2b

Please sign in to comment.