mirror of
https://github.com/Cyclenerd/meshcore-bot.git
synced 2026-03-28 17:42:46 +01:00
eslint
This commit is contained in:
7
eslint.config.js
Normal file
7
eslint.config.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import js from "@eslint/js";
|
||||||
|
import globals from "globals";
|
||||||
|
import { defineConfig } from "eslint/config";
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
{ files: ["**/*.{js,mjs,cjs}"], plugins: { js }, extends: ["js/recommended"], languageOptions: { globals: globals.browser } },
|
||||||
|
]);
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Constants, NodeJSSerialConnection } from "@liamcottle/meshcore.js";
|
import { Constants, NodeJSSerialConnection } from "@liamcottle/meshcore.js";
|
||||||
|
|
||||||
// get port from cli arguments
|
// get port from cli arguments
|
||||||
|
/*eslint no-undef: "off"*/
|
||||||
const port = process.argv[2] || "/dev/cu.usbmodem1101";
|
const port = process.argv[2] || "/dev/cu.usbmodem1101";
|
||||||
console.log(`Connecting to ${port}`);
|
console.log(`Connecting to ${port}`);
|
||||||
|
|
||||||
@@ -33,11 +34,7 @@ connection.on("disconnected", () => {
|
|||||||
clearInterval(reconnectInterval);
|
clearInterval(reconnectInterval);
|
||||||
}
|
}
|
||||||
reconnectInterval = setInterval(async () => {
|
reconnectInterval = setInterval(async () => {
|
||||||
try {
|
await connection.connect();
|
||||||
await connection.connect();
|
|
||||||
} catch (e) {
|
|
||||||
// ignore, we will retry
|
|
||||||
}
|
|
||||||
}, 3000);
|
}, 3000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user