Removed lints

This commit is contained in:
Viktor Sarström 2021-03-29 13:42:49 +02:00
parent 8e931c314b
commit f44e6cb932
10 changed files with 26 additions and 25 deletions

View File

@ -6,6 +6,5 @@
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid"
"jsxBracketSameLine": false
}

View File

@ -39,7 +39,7 @@ interface AbsenceFormValues {
const AbsenceSchema = Yup.object().shape({
socialSecurityNumber: Yup.string()
.required('Personnummer saknas')
.test('is-valid', 'Personnumret är ogiltigt', value =>
.test('is-valid', 'Personnumret är ogiltigt', (value) =>
value ? Personnummer.valid(value) : true
),
isFullDay: Yup.bool().required(),
@ -93,7 +93,7 @@ const Absence = () => {
enableReinitialize
validationSchema={AbsenceSchema}
initialValues={initialValues}
onSubmit={async values => {
onSubmit={async (values) => {
const ssn = Personnummer.parse(values.socialSecurityNumber).format()
if (values.isFullDay) {
@ -147,7 +147,7 @@ const Absence = () => {
<View style={styles.field}>
<CheckBox
checked={values.isFullDay}
onChange={checked => setFieldValue('isFullDay', checked)}
onChange={(checked) => setFieldValue('isFullDay', checked)}
>
Heldag
</CheckBox>
@ -175,7 +175,7 @@ const Absence = () => {
minimumDate={minumumDate.toDate()}
minuteInterval={10}
mode="time"
onConfirm={date => {
onConfirm={(date) => {
setFieldValue('startTime', date)
setFieldValue('displayStartTimePicker', false)
}}
@ -206,7 +206,7 @@ const Absence = () => {
minimumDate={minumumDate.toDate()}
minuteInterval={10}
mode="time"
onConfirm={date => {
onConfirm={(date) => {
setFieldValue('endTime', date)
setFieldValue('displayEndTimePicker', false)
}}

View File

@ -85,22 +85,22 @@ const BottomTabBar = ({
}: BottomTabBarProps<BottomTabBarOptions>) => (
<BottomNavigation
selectedIndex={state.index}
onSelect={index => navigation.navigate(state.routeNames[index])}
onSelect={(index) => navigation.navigate(state.routeNames[index])}
>
<BottomNavigationTab
title={props => <TabTitle {...props}>Nyheter</TabTitle>}
title={(props) => <TabTitle {...props}>Nyheter</TabTitle>}
icon={NewsIcon}
/>
<BottomNavigationTab
title={props => <TabTitle {...props}>Aviseringar</TabTitle>}
title={(props) => <TabTitle {...props}>Aviseringar</TabTitle>}
icon={NotificationsIcon}
/>
<BottomNavigationTab
title={props => <TabTitle {...props}>Kalender</TabTitle>}
title={(props) => <TabTitle {...props}>Kalender</TabTitle>}
icon={CalendarOutlineIcon}
/>
<BottomNavigationTab
title={props => <TabTitle {...props}>Klassen</TabTitle>}
title={(props) => <TabTitle {...props}>Klassen</TabTitle>}
icon={ClassIcon}
/>
</BottomNavigation>
@ -109,7 +109,7 @@ const BottomTabBar = ({
const TabNavigator = ({ initialRouteName = 'Nyheter' }) => (
<Navigator
initialRouteName={initialRouteName}
tabBar={props => <BottomTabBar {...props} />}
tabBar={(props) => <BottomTabBar {...props} />}
>
<Screen name="Nyheter" component={NewsScreen} />
<Screen name="Notifieringar" component={NotificationsScreen} />

View File

@ -49,14 +49,14 @@ export const ChildListItem = ({ child, color }: ChildListItemProps) => {
DateTime.local().plus({ days: 7 }).toISO()
)
const notificationsThisWeek = notifications.filter(n =>
const notificationsThisWeek = notifications.filter((n) =>
moment(n.dateCreated).isSame('week')
)
const scheduleAndCalendarThisWeek = [
...(calendar ?? []),
...(schedule ?? []),
].filter(a => moment(a.startDate).isSame('week'))
].filter((a) => moment(a.startDate).isSame('week'))
const getClassName = () => {
// hack: we can find the class name (ex. 8C) from the classmates. let's pick the first one and select theirs class
@ -74,7 +74,7 @@ export const ChildListItem = ({ child, color }: ChildListItemProps) => {
return child.status
? child.status
.split(';')
.map(status => {
.map((status) => {
const statusAsAbbreviation = status as keyof typeof abbrevations
return abbrevations[statusAsAbbreviation] || status
@ -155,7 +155,7 @@ export const ChildListItem = ({ child, color }: ChildListItemProps) => {
style={styles.card}
appearance="filled"
status={color}
header={props => (
header={(props) => (
<View {...props} style={styles.cardHeader}>
<View style={styles.cardAvatar}>
<Avatar source={require('../assets/avatar.png')} shape="square" />

View File

@ -52,7 +52,7 @@ export const ContactMenu = ({
backdropStyle={styles.backdrop}
onBackdropPress={handleBackdropPress}
>
{contact.guardians.map(guardian => {
{contact.guardians.map((guardian) => {
const { address, email, mobile } = guardian
return (

View File

@ -150,15 +150,15 @@ export const Login = () => {
value={socialSecurityNumber}
style={styles.pnrInput}
accessoryLeft={PersonIcon}
accessoryRight={props => (
accessoryRight={(props) => (
<TouchableWithoutFeedback onPress={() => handleInput('')}>
<CloseOutlineIcon {...props} />
</TouchableWithoutFeedback>
)}
keyboardType="numeric"
onSubmitEditing={event => startLogin(event.nativeEvent.text)}
onSubmitEditing={(event) => startLogin(event.nativeEvent.text)}
caption={error || ''}
onChangeText={text => handleInput(text)}
onChangeText={(text) => handleInput(text)}
placeholder="Ditt personnr"
/>
)}

View File

@ -10,7 +10,7 @@ interface MarkdownProps {
}
const rules: RenderRules = {
image: node => {
image: (node) => {
const { src } = node.attributes
const url = src.startsWith('/')
? `https://elevstockholm.sharepoint.com${src}`

View File

@ -15,7 +15,7 @@ export const NewsList = () => {
style={styles.container}
contentContainerStyle={styles.contentContainer}
data={data}
renderItem={info => (
renderItem={(info) => (
<NewsListItem key={info.item.id} item={info.item} />
)}
/>

View File

@ -23,7 +23,7 @@ export const Notification = ({ item }: NotificationProps) => {
<Card
style={styles.card}
onPress={open}
header={headerProps => (
header={(headerProps) => (
<View {...headerProps}>
<Text style={styles.title}>{item.sender}</Text>
<Text style={styles.subtitle}>

View File

@ -14,7 +14,9 @@ export const NotificationsList = () => {
style={styles.container}
contentContainerStyle={styles.contentContainer}
data={data}
renderItem={info => <Notification key={info.item.id} item={info.item} />}
renderItem={(info) => (
<Notification key={info.item.id} item={info.item} />
)}
/>
)
}