mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
fix eslint warnings
This commit is contained in:
@@ -31,6 +31,8 @@ export default tseslint.config(
|
|||||||
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
|
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
|
||||||
'@typescript-eslint/no-unused-expressions': 'off',
|
'@typescript-eslint/no-unused-expressions': 'off',
|
||||||
'@typescript-eslint/no-unsafe-assignment': 'off',
|
'@typescript-eslint/no-unsafe-assignment': 'off',
|
||||||
|
'@typescript-eslint/no-unsafe-member-access': 'off',
|
||||||
|
'@typescript-eslint/no-unsafe-call': 'off',
|
||||||
'@typescript-eslint/no-misused-promises': [
|
'@typescript-eslint/no-misused-promises': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ const Devices = () => {
|
|||||||
),
|
),
|
||||||
|
|
||||||
VALUE: (array) =>
|
VALUE: (array) =>
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||||
array.sort((a, b) => a.v.toString().localeCompare(b.v.toString()))
|
array.sort((a, b) => a.v.toString().localeCompare(b.v.toString()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -357,7 +357,9 @@ const Devices = () => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: (dv: DeviceValue) =>
|
accessor: (dv: DeviceValue) =>
|
||||||
DeviceValueUOM_s[dv.u].replace(/[^a-zA-Z0-9]/g, ''),
|
dv.u !== undefined && DeviceValueUOM_s[dv.u]
|
||||||
|
? DeviceValueUOM_s[dv.u].replace(/[^a-zA-Z0-9]/g, '')
|
||||||
|
: '',
|
||||||
name: 'UoM'
|
name: 'UoM'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ const Sensors = () => {
|
|||||||
sortToggleType: SortToggleType.AlternateWithReset,
|
sortToggleType: SortToggleType.AlternateWithReset,
|
||||||
sortFns: {
|
sortFns: {
|
||||||
GPIO: (array) => array.sort((a, b) => a.g - b.g),
|
GPIO: (array) => array.sort((a, b) => a.g - b.g),
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||||
NAME: (array) => array.sort((a, b) => a.n.localeCompare(b.n)),
|
NAME: (array) => array.sort((a, b) => a.n.localeCompare(b.n)),
|
||||||
TYPE: (array) => array.sort((a, b) => a.t - b.t),
|
TYPE: (array) => array.sort((a, b) => a.t - b.t),
|
||||||
VALUE: (array) => array.sort((a, b) => a.v - b.v)
|
VALUE: (array) => array.sort((a, b) => a.v - b.v)
|
||||||
@@ -238,7 +238,7 @@ const Sensors = () => {
|
|||||||
},
|
},
|
||||||
sortToggleType: SortToggleType.AlternateWithReset,
|
sortToggleType: SortToggleType.AlternateWithReset,
|
||||||
sortFns: {
|
sortFns: {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||||
NAME: (array) => array.sort((a, b) => a.n.localeCompare(b.n)),
|
NAME: (array) => array.sort((a, b) => a.n.localeCompare(b.n)),
|
||||||
VALUE: (array) => array.sort((a, b) => a.t - b.t)
|
VALUE: (array) => array.sort((a, b) => a.t - b.t)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ const DragNdrop = ({ onFileSelected }) => {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const droppedFiles = event.dataTransfer.files;
|
const droppedFiles = event.dataTransfer.files;
|
||||||
if (droppedFiles.length > 0) {
|
if (droppedFiles.length > 0) {
|
||||||
checkFileExtension(droppedFiles[0]);
|
checkFileExtension(droppedFiles[0] as File);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user