ui: fix eslint

This commit is contained in:
Matthew Penner 2023-01-12 12:45:07 -07:00
parent 7e1aa8d7e2
commit 3d7112b702
No known key found for this signature in database
19 changed files with 28 additions and 30 deletions

View file

@ -43,13 +43,13 @@ export default (include: string[] = []) => {
const params = {}; const params = {};
if (filters !== null) { if (filters !== null) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }
if (sort !== null) { if (sort !== null) {
// @ts-ignore // @ts-expect-error todo
params.sort = (sortDirection ? '-' : '') + sort; params.sort = (sortDirection ? '-' : '') + sort;
} }

View file

@ -10,7 +10,7 @@ export default (filters?: Filters): Promise<Database[]> => {
const params = {}; const params = {};
if (filters !== undefined) { if (filters !== undefined) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }

View file

@ -33,13 +33,13 @@ export default (include: string[] = []) => {
const params = {}; const params = {};
if (filters !== null) { if (filters !== null) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }
if (sort !== null) { if (sort !== null) {
// @ts-ignore // @ts-expect-error todo
params.sort = (sortDirection ? '-' : '') + sort; params.sort = (sortDirection ? '-' : '') + sort;
} }

View file

@ -10,7 +10,7 @@ export default (filters?: Filters): Promise<Location[]> => {
const params = {}; const params = {};
if (filters !== undefined) { if (filters !== undefined) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }

View file

@ -61,13 +61,13 @@ export default (include: string[] = []) => {
const params = {}; const params = {};
if (filters !== null) { if (filters !== null) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }
if (sort !== null) { if (sort !== null) {
// @ts-ignore // @ts-expect-error todo
params.sort = (sortDirection ? '-' : '') + sort; params.sort = (sortDirection ? '-' : '') + sort;
} }

View file

@ -17,13 +17,13 @@ export default (nestId: number, include: string[] = []) => {
const params = {}; const params = {};
if (filters !== null) { if (filters !== null) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }
if (sort !== null) { if (sort !== null) {
// @ts-ignore // @ts-expect-error todo
params.sort = (sortDirection ? '-' : '') + sort; params.sort = (sortDirection ? '-' : '') + sort;
} }

View file

@ -45,13 +45,13 @@ export default (include: string[] = []) => {
const params = {}; const params = {};
if (filters !== null) { if (filters !== null) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }
if (sort !== null) { if (sort !== null) {
// @ts-ignore // @ts-expect-error todo
params.sort = (sortDirection ? '-' : '') + sort; params.sort = (sortDirection ? '-' : '') + sort;
} }

View file

@ -18,13 +18,13 @@ export default (id: number, include: string[] = []) => {
const params = {}; const params = {};
if (filters !== null) { if (filters !== null) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }
if (sort !== null) { if (sort !== null) {
// @ts-ignore // @ts-expect-error todo
params.sort = (sortDirection ? '-' : '') + sort; params.sort = (sortDirection ? '-' : '') + sort;
} }

View file

@ -30,7 +30,7 @@ export default (values: Values, include: string[] = []): Promise<Node> => {
.replace('HTTP', 'Http') .replace('HTTP', 'Http')
.replace('SFTP', 'Sftp') .replace('SFTP', 'Sftp')
.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`); .replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);
// @ts-ignore // @ts-expect-error todo
data[key2] = values[key]; data[key2] = values[key];
}); });

View file

@ -51,7 +51,7 @@ export default (id: string | number, filters: Filters = {}, include: string[] =
const params = {}; const params = {};
if (filters !== null) { if (filters !== null) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }

View file

@ -93,13 +93,13 @@ export default (include: string[] = []) => {
const params = {}; const params = {};
if (filters !== null) { if (filters !== null) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }
if (sort !== null) { if (sort !== null) {
// @ts-ignore // @ts-expect-error todo
params.sort = (sortDirection ? '-' : '') + sort; params.sort = (sortDirection ? '-' : '') + sort;
} }

View file

@ -9,7 +9,7 @@ export default (id: number, node: Partial<Node>, include: string[] = []): Promis
.replace('HTTP', 'Http') .replace('HTTP', 'Http')
.replace('SFTP', 'Sftp') .replace('SFTP', 'Sftp')
.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`); .replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);
// @ts-ignore // @ts-expect-error todo
data[key2] = node[key]; data[key2] = node[key];
}); });

View file

@ -46,7 +46,7 @@ const searchRoles = (filters?: { name?: string }): Promise<UserRole[]> => {
const params = {}; const params = {};
if (filters !== undefined) { if (filters !== undefined) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }
@ -85,13 +85,13 @@ const getRoles = (include: string[] = []) => {
const params = {}; const params = {};
if (filters !== null) { if (filters !== null) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }
if (sort !== null) { if (sort !== null) {
// @ts-ignore // @ts-expect-error todo
params.sort = (sortDirection ? '-' : '') + sort; params.sort = (sortDirection ? '-' : '') + sort;
} }

View file

@ -170,13 +170,13 @@ export default (include: string[] = []) => {
const params = {}; const params = {};
if (filters !== null) { if (filters !== null) {
Object.keys(filters).forEach(key => { Object.keys(filters).forEach(key => {
// @ts-ignore // @ts-expect-error todo
params['filter[' + key + ']'] = filters[key]; params['filter[' + key + ']'] = filters[key];
}); });
} }
if (sort !== null) { if (sort !== null) {
// @ts-ignore // @ts-expect-error todo
params.sort = (sortDirection ? '-' : '') + sort; params.sort = (sortDirection ? '-' : '') + sort;
} }

View file

@ -58,7 +58,7 @@ const searchUserAccounts = async (params: QueryBuilderParams<'username' | 'email
const createUser = (values: UpdateUserValues, include: string[] = []): Promise<User> => { const createUser = (values: UpdateUserValues, include: string[] = []): Promise<User> => {
const data = {}; const data = {};
Object.keys(values).forEach(k => { Object.keys(values).forEach(k => {
// @ts-ignore // @ts-expect-error todo
data[k.replace(/[A-Z]/g, l => `_${l.toLowerCase()}`)] = values[k]; data[k.replace(/[A-Z]/g, l => `_${l.toLowerCase()}`)] = values[k];
}); });
@ -76,7 +76,7 @@ const updateUser = (id: number, values: Partial<UpdateUserValues>, include: stri
if (k === 'password' && values[k] === '') { if (k === 'password' && values[k] === '') {
return; return;
} }
// @ts-ignore // @ts-expect-error todo
data[k.replace(/[A-Z]/g, l => `_${l.toLowerCase()}`)] = values[k]; data[k.replace(/[A-Z]/g, l => `_${l.toLowerCase()}`)] = values[k];
}); });
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

View file

@ -16,7 +16,6 @@ export default () => {
const loadOptions = async (inputValue: string, callback: (options: Option[]) => void) => { const loadOptions = async (inputValue: string, callback: (options: Option[]) => void) => {
if (!server) { if (!server) {
// eslint-disable-next-line node/no-callback-literal
callback([] as Option[]); callback([] as Option[]);
return; return;
} }

View file

@ -1,6 +1,6 @@
import { CSSObject } from '@emotion/serialize'; import { CSSObject } from '@emotion/serialize';
import { Field as FormikField, FieldProps } from 'formik'; import { Field as FormikField, FieldProps } from 'formik';
import React, { forwardRef } from 'react'; import { forwardRef } from 'react';
import Select, { import Select, {
ContainerProps, ContainerProps,
ControlProps, ControlProps,

View file

@ -1,4 +1,3 @@
import React from 'react';
import { PaginationDataSet } from '@/api/http'; import { PaginationDataSet } from '@/api/http';
const TFootPaginated = ({ pagination, span }: { span: number; pagination: PaginationDataSet }) => { const TFootPaginated = ({ pagination, span }: { span: number; pagination: PaginationDataSet }) => {

View file

@ -42,7 +42,7 @@ const extractSearchFilters = <T extends string, D extends string = '*'>(
return { filters: {} }; return { filters: {} };
} }
// @ts-expect-error // @ts-expect-error todo
return { filters: Object.fromEntries(filters) }; return { filters: Object.fromEntries(filters) };
}; };