update eslint
This commit is contained in:
@@ -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
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
25
eslint.config.mjs
Normal file
25
eslint.config.mjs
Normal file
@@ -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 }]
|
||||||
|
}
|
||||||
|
}]);
|
||||||
11
package.json
11
package.json
@@ -17,13 +17,12 @@
|
|||||||
"ws": "^8.13.0"
|
"ws": "^8.13.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.43.0",
|
"@eslint/eslintrc": "^3.3.5",
|
||||||
"eslint-config-standard": "^17.1.0",
|
"@eslint/js": "^9.39.4",
|
||||||
"eslint-plugin-import": "^2.27.5",
|
"eslint": "^10.1.0",
|
||||||
"eslint-plugin-n": "^16.0.1",
|
"globals": "^17.4.0"
|
||||||
"eslint-plugin-promise": "^6.1.1"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lint": "DEBUG=eslint:cli-engine eslint --fix ."
|
"lint": "npx eslint . --fix"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { AtomicChange, DB_BACKEND, doNothingCallback } from "./backends.js";
|
|||||||
export default class LocalDB extends DB_BACKEND {
|
export default class LocalDB extends DB_BACKEND {
|
||||||
#path = null;
|
#path = null;
|
||||||
#data = null;
|
#data = null;
|
||||||
#defaultuser = null;
|
//#defaultuser = null;
|
||||||
|
|
||||||
constructor (config) {
|
constructor (config) {
|
||||||
super();
|
super();
|
||||||
@@ -13,7 +13,7 @@ export default class LocalDB extends DB_BACKEND {
|
|||||||
try {
|
try {
|
||||||
this.#path = path;
|
this.#path = path;
|
||||||
this.#load();
|
this.#load();
|
||||||
this.#defaultuser = global.config.defaultuser;
|
//this.#defaultuser = global.config.defaultuser;
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
console.log(`error: ${path} was not found. Please follow the directions in the README to initialize localdb.json.`);
|
console.log(`error: ${path} was not found. Please follow the directions in the README to initialize localdb.json.`);
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ export function readJSONFile (path) {
|
|||||||
return JSON.parse(readFileSync(path));
|
return JSON.parse(readFileSync(path));
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.log(`error: ${path} was not found.`);
|
console.log(`error opening ${path}: ${e}`);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user