diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..b1afdc7 --- /dev/null +++ b/eslint.config.js @@ -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 } }, +]); diff --git a/meshcore-bot.js b/meshcore-bot.js index 5f26abd..5cb48c9 100644 --- a/meshcore-bot.js +++ b/meshcore-bot.js @@ -1,6 +1,7 @@ import { Constants, NodeJSSerialConnection } from "@liamcottle/meshcore.js"; // get port from cli arguments +/*eslint no-undef: "off"*/ const port = process.argv[2] || "/dev/cu.usbmodem1101"; console.log(`Connecting to ${port}`); @@ -33,11 +34,7 @@ connection.on("disconnected", () => { clearInterval(reconnectInterval); } reconnectInterval = setInterval(async () => { - try { - await connection.connect(); - } catch (e) { - // ignore, we will retry - } + await connection.connect(); }, 3000); });