Client - eslint fix

This commit is contained in:
Sam 2022-06-22 17:53:59 +02:00
parent d1e2d01e19
commit a8ed6dcdfa
18 changed files with 23 additions and 23 deletions

View File

@ -61,7 +61,7 @@
}
function scroll() {
window.onscroll = () => {
let bottom = document.querySelector('#bottom')
const bottom = document.querySelector('#bottom')
displayScrollButton.value = bottom !== null && isScrolledToBottom(bottom)
}
}

View File

@ -31,7 +31,7 @@
const emit = defineEmits(['updateValue'])
let text = ref('')
const text = ref('')
function updateText(event: Event & { target: HTMLInputElement }) {
emit('updateValue', event.target.value)

View File

@ -33,8 +33,8 @@
})
const route = useRoute()
let isOpen = ref(false)
let dropdownOptions = props.options.map((option) => option)
const isOpen = ref(false)
const dropdownOptions = props.options.map((option) => option)
function toggleDropdown() {
isOpen.value = !isOpen.value

View File

@ -63,7 +63,7 @@
onBeforeMount(async () => await setZxcvbnOptions(language.value))
function calculatePasswordStrength(password: string) {
let zxcvbnResult = zxcvbn(password)
const zxcvbnResult = zxcvbn(password)
passwordScore.value = zxcvbnResult.score
passwordStrength.value = getPasswordStrength(passwordScore.value)
passwordSuggestions.value = zxcvbnResult.feedback.suggestions

View File

@ -55,7 +55,7 @@
function getSum(total: any, value: any): number {
return getNumber(total) + getNumber(value)
}
let chartData: ComputedRef<ChartData<'bar'>> = computed(() => ({
const chartData: ComputedRef<ChartData<'bar'>> = computed(() => ({
labels: props.labels,
// workaround to avoid dataset modification
datasets: JSON.parse(JSON.stringify(props.datasets)),

View File

@ -134,7 +134,7 @@
setup(props) {
const store = useStore()
let displayedData: Ref<TStatisticsDatasetKeys> = ref('total_distance')
const displayedData: Ref<TStatisticsDatasetKeys> = ref('total_distance')
const statistics: ComputedRef<TStatisticsFromApi> = computed(
() => store.getters[STATS_STORE.GETTERS.USER_STATS]
)

View File

@ -53,7 +53,7 @@
const store = useStore()
const { sports, user } = toRefs(props)
let page = ref(1)
const page = ref(1)
const per_page = 5
const initWorkoutsCount =
props.user.nb_workouts >= per_page ? per_page : props.user.nb_workouts

View File

@ -49,8 +49,8 @@
const { sports, user } = toRefs(props)
const dateFormat = 'yyyy-MM-dd'
let day = ref(new Date())
let calendarDates = ref(getCalendarStartAndEnd(day.value, props.user.weekm))
const day = ref(new Date())
const calendarDates = ref(getCalendarStartAndEnd(day.value, props.user.weekm))
const calendarWorkouts: ComputedRef<IWorkout[]> = computed(
() => store.getters[WORKOUTS_STORE.GETTERS.CALENDAR_WORKOUTS]
)

View File

@ -102,7 +102,7 @@
const language: ComputedRef<string> = computed(
() => store.getters[ROOT_STORE.GETTERS.LANGUAGE]
)
let isMenuOpen = ref(false)
const isMenuOpen = ref(false)
function openMenu() {
isMenuOpen.value = true

View File

@ -42,7 +42,7 @@
const emit = defineEmits(['arrowClick', 'timeFrameUpdate'])
let selectedTimeFrame = ref('month')
const selectedTimeFrame = ref('month')
const timeFrames = ['week', 'month', 'year']
function onUpdateTimeFrame(timeFrame: string) {

View File

@ -41,7 +41,7 @@
const { t } = useI18n()
const { sports, user } = toRefs(props)
let selectedTimeFrame = ref('month')
const selectedTimeFrame = ref('month')
const chartParams: Ref<IStatisticsDateParams> = ref(
getChartParams(selectedTimeFrame.value)
)

View File

@ -164,7 +164,7 @@
const appConfig: ComputedRef<TAppConfig> = computed(
() => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]
)
let displayModal: Ref<string> = ref('')
const displayModal: Ref<string> = ref('')
const formErrors = ref(false)
const displayUserEmailForm: Ref<boolean> = ref(false)
const newUserEmail: Ref<string> = ref('')

View File

@ -59,7 +59,7 @@
const fileSizeLimit = appConfig.value.max_single_file_size
? getReadableFileSize(appConfig.value.max_single_file_size)
: ''
let pictureFile: Ref<File | null> = ref(null)
const pictureFile: Ref<File | null> = ref(null)
function deleteUserPicture() {
store.dispatch(AUTH_USER_STORE.ACTIONS.DELETE_PICTURE)

View File

@ -77,14 +77,14 @@
const { t } = useI18n()
let displayDistance = ref(true)
let beginElevationAtZero = ref(true)
const displayDistance = ref(true)
const beginElevationAtZero = ref(true)
const datasets: ComputedRef<IWorkoutChartData> = computed(() =>
getDatasets(props.workoutData.chartData, t, props.authUser.imperial_units)
)
const fromKmUnit = getUnitTo('km')
const fromMUnit = getUnitTo('m')
let chartData: ComputedRef<ChartData<'line'>> = computed(() => ({
const chartData: ComputedRef<ChartData<'line'>> = computed(() => ({
labels: displayDistance.value
? datasets.value.distance_labels
: datasets.value.duration_labels,

View File

@ -75,7 +75,7 @@
const workout: ComputedRef<IWorkout> = computed(
() => props.workoutData.workout
)
let segmentId: Ref<number | null> = ref(
const segmentId: Ref<number | null> = ref(
route.params.workoutId ? +route.params.segmentId : null
)
const segment: ComputedRef<IWorkoutSegment | null> = computed(() =>
@ -83,7 +83,7 @@
? workout.value.segments[+segmentId.value - 1]
: null
)
let displayModal: Ref<boolean> = ref(false)
const displayModal: Ref<boolean> = ref(false)
const sport = computed(() =>
props.sports
? props.sports.find(

View File

@ -301,7 +301,7 @@
workoutDurationSeconds: '',
workoutDistance: '',
})
let withGpx = ref(
const withGpx = ref(
props.workout.id ? props.workout.with_gpx : props.isCreation
)
let gpxFile: File | null = null

View File

@ -238,7 +238,7 @@
}
function getWorkoutsQuery(newQuery: LocationQuery): TWorkoutsPayload {
let workoutQuery = getQuery(newQuery, orderByList, defaultOrder.order_by, {
const workoutQuery = getQuery(newQuery, orderByList, defaultOrder.order_by, {
defaultSort: defaultOrder.order,
})
Object.keys(newQuery)

View File

@ -84,7 +84,7 @@
const sports: ComputedRef<ISport[]> = computed(
() => store.getters[SPORTS_STORE.GETTERS.SPORTS]
)
let markerCoordinates: Ref<TCoordinates> = ref({
const markerCoordinates: Ref<TCoordinates> = ref({
latitude: null,
longitude: null,
})