Browse Source

Fix lint errors

pull/2/head
Sacha Weatherstone 5 years ago
parent
commit
f630dc3141
  1. 2
      package.json
  2. 10
      pnpm-lock.yaml
  3. 10
      src/App.tsx
  4. 22
      src/pages/settings/Connection.tsx

2
package.json

@ -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",

10
pnpm-lock.yaml

@ -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[email protected] eslint-plugin-import: 2.25[email protected]
eslint-plugin-react: 7.26[email protected] eslint-plugin-react: 7.26[email protected]
eslint-plugin-react-hooks: 4.2.0[email protected] eslint-plugin-react-hooks: 4.2.1-alpha-9c8161ba8-20211028[email protected]
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/[email protected]: /eslint-plugin-react-hooks/4.2.1-alpha-9c8161ba8-20211028[email protected]:
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

10
src/App.tsx

@ -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) => {

22
src/pages/settings/Connection.tsx

@ -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,
}); });
}} }}

Loading…
Cancel
Save