From 7ea579df68efb28292097f24c88d58aae0211b9e Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 25 Mar 2026 18:09:47 +0000 Subject: [PATCH] update eslint --- .eslintrc.json | 42 ----------------------------------------- eslint.config.mjs | 25 ++++++++++++++++++++++++ package.json | 11 +++++------ src/backends/localdb.js | 4 ++-- src/utils.js | 2 +- 5 files changed, 33 insertions(+), 51 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.mjs diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 86a2b41..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "env": { - "es2021": true, - "node": true - }, - "extends": "standard", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "rules": { - "no-tabs": [ - "error", - { - "allowIndentationTabs": true - } - ], - "indent": [ - "error", - "tab" - ], - "linebreak-style": [ - "error", - "unix" - ], - "quotes": [ - "error", - "double" - ], - "semi": [ - "error", - "always" - ], - "brace-style": [ - "error", - "stroustrup", - { - "allowSingleLine": false - } - ] - } -} \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..b46f86c --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,25 @@ +import { defineConfig } from "eslint/config"; +import globals from "globals"; +import js from "@eslint/js"; + +export default defineConfig([{ + plugins: { + js, + }, + extends: ["js/recommended"], + languageOptions: { + globals: { + ...globals.node + }, + ecmaVersion: "latest", + sourceType: "module" + }, + rules: { + "no-tabs": ["error", { allowIndentationTabs: true }], + indent: ["error", "tab"], + "linebreak-style": ["error", "unix"], + quotes: ["error", "double"], + semi: ["error", "always"], + "brace-style": ["error", "stroustrup", { allowSingleLine: false }] + } +}]); diff --git a/package.json b/package.json index d2f5618..7a93a6c 100644 --- a/package.json +++ b/package.json @@ -17,13 +17,12 @@ "ws": "^8.13.0" }, "devDependencies": { - "eslint": "^8.43.0", - "eslint-config-standard": "^17.1.0", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-n": "^16.0.1", - "eslint-plugin-promise": "^6.1.1" + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "^9.39.4", + "eslint": "^10.1.0", + "globals": "^17.4.0" }, "scripts": { - "lint": "DEBUG=eslint:cli-engine eslint --fix ." + "lint": "npx eslint . --fix" } } diff --git a/src/backends/localdb.js b/src/backends/localdb.js index ff66482..6437e17 100644 --- a/src/backends/localdb.js +++ b/src/backends/localdb.js @@ -5,7 +5,7 @@ import { AtomicChange, DB_BACKEND, doNothingCallback } from "./backends.js"; export default class LocalDB extends DB_BACKEND { #path = null; #data = null; - #defaultuser = null; + //#defaultuser = null; constructor (config) { super(); @@ -13,7 +13,7 @@ export default class LocalDB extends DB_BACKEND { try { this.#path = path; this.#load(); - this.#defaultuser = global.config.defaultuser; + //this.#defaultuser = global.config.defaultuser; } catch { console.log(`error: ${path} was not found. Please follow the directions in the README to initialize localdb.json.`); diff --git a/src/utils.js b/src/utils.js index d76e0ff..cc1a9a0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -331,7 +331,7 @@ export function readJSONFile (path) { return JSON.parse(readFileSync(path)); } catch (e) { - console.log(`error: ${path} was not found.`); + console.log(`error opening ${path}: ${e}`); exit(1); } };