Skip to content

Commit e02d7eb

Browse files
authored
Fix frontend eslint errors (#843)
* Fix frontend eslint errors * Post-review updates
1 parent 615df35 commit e02d7eb

18 files changed

+39
-41
lines changed

frontend/src/App.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const call = createFetch({
6565
beforeFetch({ options }) {
6666
if (user?.authenticated) {
6767
const token = user.data.accessToken;
68-
// @ts-ignore
68+
// @ts-expect-error ignore headers type error
6969
options.headers.Authorization = `Bearer ${token}`;
7070
}
7171
return { options };
@@ -205,10 +205,13 @@ onMounted(async () => {
205205
206206
// Hack to clear $set_once until we get confirmation that this can be filtered.
207207
// Move the function reference so we can patch it and still retrieve the results before we sanitize it.
208+
209+
/* eslint no-underscore-dangle: ["error", { "allow": ["_calculate_set_once_properties"] }] */
210+
208211
if (posthog['_original_calculate_set_once_properties'] === undefined) {
209212
posthog['_original_calculate_set_once_properties'] = posthog._calculate_set_once_properties;
210213
}
211-
posthog._calculate_set_once_properties = function (dataSetOnce?) {
214+
posthog._calculate_set_once_properties = function patch(dataSetOnce?) {
212215
dataSetOnce = posthog['_original_calculate_set_once_properties'](dataSetOnce);
213216
214217
if (dataSetOnce?.$initial_current_url || dataSetOnce?.$initial_pathname) {

frontend/src/components/CalendarQalendar.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup>
22
import {
3-
ref, computed, inject, toRefs, watch, onMounted
3+
ref, computed, inject, toRefs, watch,
44
} from 'vue';
55
import { Qalendar } from 'qalendar';
66
import 'qalendar/dist/style.css';
@@ -335,13 +335,13 @@ const config = ref({
335335
},
336336
dayBoundaries: {
337337
start: dayBoundary.value.start,
338-
end: dayBoundary.value.end
338+
end: dayBoundary.value.end,
339339
},
340340
eventDialog: {
341341
// We roll our own
342342
isDisabled: true,
343343
},
344-
locale: locale === 'de' ? 'de-DE' : 'en-US'
344+
locale: locale === 'de' ? 'de-DE' : 'en-US',
345345
});
346346
347347
/**

frontend/src/components/DataTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
import { useI18n } from 'vue-i18n';
66
import { computed, ref, toRefs } from 'vue';
7-
import { TableDataButtonType, TableDataType, TooltipPosition } from '@/definitions';
7+
import { TableDataButtonType, TableDataType } from '@/definitions';
88
import {
99
TableDataRow, TableDataColumn, TableFilter, HTMLInputElementEvent,
1010
} from '@/models';
@@ -181,7 +181,7 @@ const onColumnFilter = (evt: Event, eventFilter: TableFilter, filters: TableFilt
181181
</tr>
182182
</thead>
183183
<tbody>
184-
<tr v-for="(datum, i) in paginatedDataList" :key="datum[dataKey] as unknown as string">
184+
<tr v-for="(datum) in paginatedDataList" :key="datum[dataKey] as unknown as string">
185185
<td v-if="allowMultiSelect">
186186
<input :checked="selectedRows.includes(datum)" type="checkbox" @change="(evt) => onFieldSelect(evt, datum)" />
187187
</td>

frontend/src/components/FTUE/CalendarProvider.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup lang="ts">
2-
import { useI18n } from 'vue-i18n';
32
import {
43
inject, ref,
54
} from 'vue';
@@ -14,7 +13,6 @@ const {
1413
errorMessage,
1514
} = storeToRefs(ftueStore);
1615
const { previousStep, nextStep } = ftueStore;
17-
const { t } = useI18n();
1816
const call = inject(callKey);
1917
const provider = ref('google');
2018

frontend/src/components/FTUE/GoogleOauthProvider.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ const isLoading = ref(false);
3131
3232
const ftueStore = useFTUEStore();
3333
const {
34-
hasNextStep, hasPreviousStep, errorMessage,
34+
hasNextStep, errorMessage,
3535
} = storeToRefs(ftueStore);
36-
const { previousStep, nextStep } = ftueStore;
3736
3837
const calendarStore = useCalendarStore();
3938
const externalConnectionStore = useExternalConnectionsStore();

frontend/src/components/FTUE/SetupProfile.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const { nextStep } = ftueStore;
2020
const user = useUserStore();
2121
user.init(call);
2222
23-
// @ts-ignore
23+
// @ts-expect-error ignore type err
2424
// See https://github.com/microsoft/TypeScript/issues/49231
2525
const timezoneOptions = Intl.supportedValuesOf('timeZone').map((timezone: string) => ({
2626
label: timezone.replaceAll('_', ' '),
File renamed without changes.

frontend/src/components/ScheduleCreation.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ const saveSchedule = async (withConfirmation = true) => {
307307
? await scheduleStore.updateSchedule(call, props.schedule.id, obj)
308308
: await scheduleStore.createSchedule(call, obj);
309309
310+
// eslint-disable-next-line no-prototype-builtins
310311
if (response.hasOwnProperty('error')) {
311312
// error message is in data
312313
scheduleCreationError.value = (response as Error).message;

frontend/src/components/SettingsCalendar.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
<script setup lang="ts">
2-
import { CalendarManagementType, CalendarProviders, MetricEvents, ColorPalette, AlertSchemes } from '@/definitions';
3-
import { ref, reactive, inject, onMounted, computed } from 'vue';
2+
import {
3+
CalendarManagementType, CalendarProviders, MetricEvents, ColorPalette, AlertSchemes,
4+
} from '@/definitions';
5+
import {
6+
ref, reactive, inject, onMounted, computed,
7+
} from 'vue';
48
import { useI18n } from 'vue-i18n';
59
import { useRoute, useRouter } from 'vue-router';
610
import { useCalendarStore } from '@/stores/calendar-store';
711
import { callKey, refreshKey } from '@/keys';
8-
import { CalendarResponse, CalendarListResponse, Exception, ExceptionDetail, PydanticException } from '@/models';
12+
import {
13+
CalendarResponse, CalendarListResponse, Exception, ExceptionDetail, PydanticException,
14+
} from '@/models';
915
import AlertBox from '@/elements/AlertBox.vue';
1016
import CalendarManagement from '@/components/CalendarManagement.vue';
1117
import CautionButton from '@/elements/CautionButton.vue';
@@ -33,6 +39,7 @@ const deleteCalendarModalTarget = ref<number>(null);
3339
const loading = ref(false);
3440
3541
// handle calendar user input to add or edit calendar connections
42+
// eslint-disable-next-line no-shadow
3643
enum InputModes {
3744
Hidden,
3845
Discovery,

frontend/src/components/SettingsGeneral.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { ColourSchemes } from '@/definitions';
3-
import { ref, inject, watch } from 'vue';
3+
import { inject, watch } from 'vue';
44
import { useI18n } from 'vue-i18n';
55
import { useUserStore } from '@/stores/user-store';
66
import { callKey } from '@/keys';
@@ -53,7 +53,7 @@ watch(
5353
},
5454
);
5555
56-
// @ts-ignore
56+
// @ts-expect-error ignore type err
5757
// See https://github.com/microsoft/TypeScript/issues/49231
5858
const timezones = Intl.supportedValuesOf('timeZone');
5959

0 commit comments

Comments
 (0)