Client - lint fix after Prettier upgrade
This commit is contained in:
parent
34be1885c0
commit
24598453e1
@ -199,12 +199,12 @@
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
(appData[key] = getFileSizeInMB(appConfig[key]))
|
(appData[key] = getFileSizeInMB(appConfig[key]))
|
||||||
: ['about', 'privacy_policy'].includes(key)
|
: ['about', 'privacy_policy'].includes(key)
|
||||||
? // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
? // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
(appData[key] = appConfig[key] !== null ? appConfig[key] : '')
|
(appData[key] = appConfig[key] !== null ? appConfig[key] : '')
|
||||||
: // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
: // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
(appData[key] = appConfig[key])
|
(appData[key] = appConfig[key])
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
function onCancel() {
|
function onCancel() {
|
||||||
|
@ -98,10 +98,10 @@
|
|||||||
return fullStats.value && context.chart.chartArea.width < 300
|
return fullStats.value && context.chart.chartArea.width < 300
|
||||||
? false
|
? false
|
||||||
: displayedData.value === 'average_speed'
|
: displayedData.value === 'average_speed'
|
||||||
? displayedSportIds.value.length == 1
|
? displayedSportIds.value.length == 1
|
||||||
? 'auto'
|
? 'auto'
|
||||||
: false
|
: false
|
||||||
: true
|
: true
|
||||||
},
|
},
|
||||||
formatter: function (value, context) {
|
formatter: function (value, context) {
|
||||||
if (displayedData.value === 'average_speed') {
|
if (displayedData.value === 'average_speed') {
|
||||||
|
@ -64,8 +64,8 @@
|
|||||||
return authUser.value.timezone
|
return authUser.value.timezone
|
||||||
? authUser.value.timezone
|
? authUser.value.timezone
|
||||||
: Intl.DateTimeFormat().resolvedOptions().timeZone
|
: Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||||
? Intl.DateTimeFormat().resolvedOptions().timeZone
|
? Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||||
: 'Europe/Paris'
|
: 'Europe/Paris'
|
||||||
}
|
}
|
||||||
function getDateFormat() {
|
function getDateFormat() {
|
||||||
return dateStringFormats[language.value]
|
return dateStringFormats[language.value]
|
||||||
|
@ -212,8 +212,8 @@
|
|||||||
sportPayload.color = sport.color
|
sportPayload.color = sport.color
|
||||||
? sport.color
|
? sport.color
|
||||||
: sportColors
|
: sportColors
|
||||||
? sportColors[sport.label]
|
? sportColors[sport.label]
|
||||||
: defaultColor
|
: defaultColor
|
||||||
sportPayload.is_active = sport.is_active_for_user
|
sportPayload.is_active = sport.is_active_for_user
|
||||||
sportPayload.stopped_speed_threshold = sport.stopped_speed_threshold
|
sportPayload.stopped_speed_threshold = sport.stopped_speed_threshold
|
||||||
} else {
|
} else {
|
||||||
|
@ -189,12 +189,12 @@
|
|||||||
return tooltipItems.length === 0
|
return tooltipItems.length === 0
|
||||||
? ''
|
? ''
|
||||||
: displayDistance.value
|
: displayDistance.value
|
||||||
? `${t('workouts.DISTANCE')}: ${
|
? `${t('workouts.DISTANCE')}: ${
|
||||||
tooltipItems[0].label
|
tooltipItems[0].label
|
||||||
} ${fromKmUnit}`
|
} ${fromKmUnit}`
|
||||||
: `${t('workouts.DURATION')}: ${formatDuration(
|
: `${t('workouts.DURATION')}: ${formatDuration(
|
||||||
tooltipItems[0].label.replace(',', '')
|
tooltipItems[0].label.replace(',', '')
|
||||||
)}`
|
)}`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -100,14 +100,14 @@
|
|||||||
displaySegment && segmentId && segmentId !== 1
|
displaySegment && segmentId && segmentId !== 1
|
||||||
? `/workouts/${workout.id}/segment/${segmentId - 1}`
|
? `/workouts/${workout.id}/segment/${segmentId - 1}`
|
||||||
: !displaySegment && workout.previous_workout
|
: !displaySegment && workout.previous_workout
|
||||||
? `/workouts/${workout.previous_workout}`
|
? `/workouts/${workout.previous_workout}`
|
||||||
: null
|
: null
|
||||||
const nextUrl =
|
const nextUrl =
|
||||||
displaySegment && segmentId && segmentId < workout.segments.length
|
displaySegment && segmentId && segmentId < workout.segments.length
|
||||||
? `/workouts/${workout.id}/segment/${segmentId + 1}`
|
? `/workouts/${workout.id}/segment/${segmentId + 1}`
|
||||||
: !displaySegment && workout.next_workout
|
: !displaySegment && workout.next_workout
|
||||||
? `/workouts/${workout.next_workout}`
|
? `/workouts/${workout.next_workout}`
|
||||||
: null
|
: null
|
||||||
return {
|
return {
|
||||||
previousUrl,
|
previousUrl,
|
||||||
nextUrl,
|
nextUrl,
|
||||||
|
@ -444,14 +444,14 @@
|
|||||||
workoutForm.workoutAscent === ''
|
workoutForm.workoutAscent === ''
|
||||||
? null
|
? null
|
||||||
: authUser.value.imperial_units
|
: authUser.value.imperial_units
|
||||||
? convertDistance(+workoutForm.workoutAscent, 'ft', 'm', 3)
|
? convertDistance(+workoutForm.workoutAscent, 'ft', 'm', 3)
|
||||||
: +workoutForm.workoutAscent
|
: +workoutForm.workoutAscent
|
||||||
payload.descent =
|
payload.descent =
|
||||||
workoutForm.workoutDescent === ''
|
workoutForm.workoutDescent === ''
|
||||||
? null
|
? null
|
||||||
: authUser.value.imperial_units
|
: authUser.value.imperial_units
|
||||||
? convertDistance(+workoutForm.workoutDescent, 'ft', 'm', 3)
|
? convertDistance(+workoutForm.workoutDescent, 'ft', 'm', 3)
|
||||||
: +workoutForm.workoutDescent
|
: +workoutForm.workoutDescent
|
||||||
if (
|
if (
|
||||||
(payload.ascent !== null && payload.descent === null) ||
|
(payload.ascent !== null && payload.descent === null) ||
|
||||||
(payload.ascent === null && payload.descent !== null)
|
(payload.ascent === null && payload.descent !== null)
|
||||||
|
@ -47,14 +47,14 @@ export const handleError = (
|
|||||||
const errorMessages = !error
|
const errorMessages = !error
|
||||||
? msg
|
? msg
|
||||||
: error.response
|
: error.response
|
||||||
? error.response.status === 413
|
? error.response.status === 413
|
||||||
? 'file size is greater than the allowed size'
|
? 'file size is greater than the allowed size'
|
||||||
: errorInfo?.message
|
: errorInfo?.message
|
||||||
? errorInfo.message
|
? errorInfo.message
|
||||||
: msg
|
: msg
|
||||||
: error.message
|
: error.message
|
||||||
? error.message
|
? error.message
|
||||||
: msg
|
: msg
|
||||||
context.commit(
|
context.commit(
|
||||||
ROOT_STORE.MUTATIONS.SET_ERROR_MESSAGES,
|
ROOT_STORE.MUTATIONS.SET_ERROR_MESSAGES,
|
||||||
errorMessages.includes('\n')
|
errorMessages.includes('\n')
|
||||||
|
@ -35,8 +35,8 @@ const sortSports = (a: ITranslatedSport, b: ITranslatedSport): number => {
|
|||||||
return sportATranslatedLabel > sportBTranslatedLabel
|
return sportATranslatedLabel > sportBTranslatedLabel
|
||||||
? 1
|
? 1
|
||||||
: sportATranslatedLabel < sportBTranslatedLabel
|
: sportATranslatedLabel < sportBTranslatedLabel
|
||||||
? -1
|
? -1
|
||||||
: 0
|
: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
export const translateSports = (
|
export const translateSports = (
|
||||||
|
@ -174,8 +174,8 @@ export const formatStats = (
|
|||||||
useImperialUnits
|
useImperialUnits
|
||||||
)
|
)
|
||||||
: datasetKey === 'average_speed'
|
: datasetKey === 'average_speed'
|
||||||
? null
|
? null
|
||||||
: 0
|
: 0
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -196,14 +196,14 @@ export const getStatsDateParams = (
|
|||||||
timeFrame === 'year'
|
timeFrame === 'year'
|
||||||
? startOfYear(subYears(date, 9))
|
? startOfYear(subYears(date, 9))
|
||||||
: timeFrame === 'week'
|
: timeFrame === 'week'
|
||||||
? startOfWeek(subMonths(date, 2), { weekStartsOn })
|
? startOfWeek(subMonths(date, 2), { weekStartsOn })
|
||||||
: startOfMonth(subMonths(date, 11)) // month
|
: startOfMonth(subMonths(date, 11)) // month
|
||||||
const end =
|
const end =
|
||||||
timeFrame === 'year'
|
timeFrame === 'year'
|
||||||
? endOfYear(date)
|
? endOfYear(date)
|
||||||
: timeFrame === 'week'
|
: timeFrame === 'week'
|
||||||
? endOfWeek(date, { weekStartsOn })
|
? endOfWeek(date, { weekStartsOn })
|
||||||
: endOfMonth(date) // month
|
: endOfMonth(date) // month
|
||||||
return {
|
return {
|
||||||
duration: timeFrame,
|
duration: timeFrame,
|
||||||
end,
|
end,
|
||||||
@ -224,17 +224,17 @@ export const updateChartParams = (
|
|||||||
duration === 'year'
|
duration === 'year'
|
||||||
? endOfYear(backward ? subYears(end, 1) : addYears(end, 1))
|
? endOfYear(backward ? subYears(end, 1) : addYears(end, 1))
|
||||||
: duration === 'week'
|
: duration === 'week'
|
||||||
? endOfWeek(backward ? subWeeks(end, 1) : addWeeks(end, 1), {
|
? endOfWeek(backward ? subWeeks(end, 1) : addWeeks(end, 1), {
|
||||||
weekStartsOn,
|
weekStartsOn,
|
||||||
})
|
})
|
||||||
: endOfMonth(backward ? subMonths(end, 1) : addMonths(end, 1)),
|
: endOfMonth(backward ? subMonths(end, 1) : addMonths(end, 1)),
|
||||||
start:
|
start:
|
||||||
duration === 'year'
|
duration === 'year'
|
||||||
? startOfYear(backward ? subYears(start, 1) : addYears(start, 1))
|
? startOfYear(backward ? subYears(start, 1) : addYears(start, 1))
|
||||||
: duration === 'week'
|
: duration === 'week'
|
||||||
? startOfWeek(backward ? subWeeks(start, 1) : addWeeks(start, 1), {
|
? startOfWeek(backward ? subWeeks(start, 1) : addWeeks(start, 1), {
|
||||||
weekStartsOn,
|
weekStartsOn,
|
||||||
})
|
})
|
||||||
: startOfMonth(backward ? subMonths(start, 1) : addMonths(start, 1)),
|
: startOfMonth(backward ? subMonths(start, 1) : addMonths(start, 1)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user