Fix lint errors

This commit is contained in:
Sacha Weatherstone
2021-10-31 19:52:01 +11:00
parent a5d67279de
commit f630dc3141
4 changed files with 21 additions and 23 deletions
+1 -1
View File
@@ -55,7 +55,7 @@
"eslint-import-resolver-typescript": "^2.5.0", "eslint-import-resolver-typescript": "^2.5.0",
"eslint-plugin-import": "^2.25.2", "eslint-plugin-import": "^2.25.2",
"eslint-plugin-react": "^7.26.1", "eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-react-hooks": "^4.2.1-alpha-9c8161ba8-20211028",
"gzipper": "^6.0.0", "gzipper": "^6.0.0",
"postcss": "^8.3.11", "postcss": "^8.3.11",
"prettier": "^2.4.1", "prettier": "^2.4.1",
+5 -5
View File
@@ -28,7 +28,7 @@ specifiers:
eslint-import-resolver-typescript: ^2.5.0 eslint-import-resolver-typescript: ^2.5.0
eslint-plugin-import: ^2.25.2 eslint-plugin-import: ^2.25.2
eslint-plugin-react: ^7.26.1 eslint-plugin-react: ^7.26.1
eslint-plugin-react-hooks: ^4.2.0 eslint-plugin-react-hooks: ^4.2.1-alpha-9c8161ba8-20211028
gzipper: ^6.0.0 gzipper: ^6.0.0
i18next: ^21.3.3 i18next: ^21.3.3
i18next-browser-languagedetector: ^6.1.2 i18next-browser-languagedetector: ^6.1.2
@@ -97,7 +97,7 @@ devDependencies:
eslint-import-resolver-typescript: 2.5.0_f3fc3a8f1727ab01eb417b5ed5016c22 eslint-import-resolver-typescript: 2.5.0_f3fc3a8f1727ab01eb417b5ed5016c22
eslint-plugin-import: 2.25.2_eslint@8.1.0 eslint-plugin-import: 2.25.2_eslint@8.1.0
eslint-plugin-react: 7.26.1_eslint@8.1.0 eslint-plugin-react: 7.26.1_eslint@8.1.0
eslint-plugin-react-hooks: 4.2.0_eslint@8.1.0 eslint-plugin-react-hooks: 4.2.1-alpha-9c8161ba8-20211028_eslint@8.1.0
gzipper: 6.0.0 gzipper: 6.0.0
postcss: 8.3.11 postcss: 8.3.11
prettier: 2.4.1 prettier: 2.4.1
@@ -2240,11 +2240,11 @@ packages:
eslint: 7.32.0 eslint: 7.32.0
dev: true dev: true
/eslint-plugin-react-hooks/4.2.0_eslint@8.1.0: /eslint-plugin-react-hooks/4.2.1-alpha-9c8161ba8-20211028_eslint@8.1.0:
resolution: {integrity: sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==} resolution: {integrity: sha512-wqdj1w8azrZwM5yYh3Pm6y/Cxg6nA+Nb2OqkHZ3Bf+cmnoCs2MSDUal+AnKAZN3kxWjSK4rljuromNaxUejyiA==}
engines: {node: '>=10'} engines: {node: '>=10'}
peerDependencies: peerDependencies:
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0
dependencies: dependencies:
eslint: 8.1.0 eslint: 8.1.0
dev: true dev: true
+6 -4
View File
@@ -90,8 +90,9 @@ const App = (): JSX.Element => {
); );
}); });
connection.onNodeInfoPacket.subscribe((nodeInfoPacket) => connection.onNodeInfoPacket.subscribe(
dispatch(addNode(nodeInfoPacket.data)), (nodeInfoPacket): void | { payload: Protobuf.NodeInfo; type: string } =>
dispatch(addNode(nodeInfoPacket.data)),
); );
connection.onAdminPacket.subscribe((adminPacket) => { connection.onAdminPacket.subscribe((adminPacket) => {
@@ -111,8 +112,9 @@ const App = (): JSX.Element => {
} }
}); });
connection.onMeshHeartbeat.subscribe((date) => connection.onMeshHeartbeat.subscribe(
dispatch(setLastMeshInterraction(date.getTime())), (date): void | { payload: number; type: string } =>
dispatch(setLastMeshInterraction(date.getTime())),
); );
connection.onTextPacket.subscribe((message) => { connection.onTextPacket.subscribe((message) => {
+9 -13
View File
@@ -78,12 +78,8 @@ export const Connection = ({
setConnection(new ISerialConnection()); setConnection(new ISerialConnection());
} }
console.log(params); // @ts-ignore tmp
await connection.connect(params);
// @ts-ignore
connection.connect(params);
console.log(connection);
}; };
const updateBleDeviceList = async (): Promise<void> => { const updateBleDeviceList = async (): Promise<void> => {
@@ -100,10 +96,10 @@ export const Connection = ({
React.useEffect(() => { React.useEffect(() => {
if (selectedConnType === connType.BLE) { if (selectedConnType === connType.BLE) {
updateBleDeviceList(); void updateBleDeviceList();
} }
if (selectedConnType === connType.SERIAL) { if (selectedConnType === connType.SERIAL) {
updateSerialDeviceList(); void updateSerialDeviceList();
} }
}, [selectedConnType]); }, [selectedConnType]);
@@ -194,8 +190,8 @@ export const Connection = ({
</Button> </Button>
<Button <Button
border border
onClick={() => { onClick={async () => {
ble.getDevice(); await ble.getDevice();
}} }}
> >
New Device New Device
@@ -239,8 +235,8 @@ export const Connection = ({
</Button> </Button>
<Button <Button
border border
onClick={() => { onClick={async () => {
serial.getPort(); await serial.getPort();
}} }}
> >
New Device New Device
@@ -260,7 +256,7 @@ export const Connection = ({
<IconButton <IconButton
onClick={() => { onClick={() => {
connect(connType.SERIAL, { connect(connType.SERIAL, {
// @ts-ignore // @ts-ignore tmp
device: device, device: device,
}); });
}} }}