Merge pull request #121 from chakflying/patch-1

Fix: Update ESLint to handle class static member
This commit is contained in:
Louis Lam 2021-07-30 15:21:14 +08:00 committed by GitHub
commit 2b3a48995b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 9 deletions

View file

@ -2,22 +2,30 @@ module.exports = {
env: { env: {
browser: true, browser: true,
commonjs: true, commonjs: true,
es2017: true, es2020: true,
node: true, node: true,
}, },
extends: [ extends: [
"eslint:recommended", "eslint:recommended",
"plugin:vue/vue3-recommended", "plugin:vue/vue3-recommended",
], ],
parser: "@babel/eslint-parser",
parserOptions: { parserOptions: {
ecmaVersion: 2018,
sourceType: "module", sourceType: "module",
requireConfigFile: false,
}, },
rules: { rules: {
// override/add rules settings here, such as: // override/add rules settings here, such as:
// 'vue/no-unused-vars': 'error' // 'vue/no-unused-vars': 'error'
"no-unused-vars": "warn", "no-unused-vars": "warn",
indent: ["error", 4], indent: [
"error",
4,
{
ignoredNodes: ["TemplateLiteral"],
SwitchCase: 1,
},
],
quotes: ["warn", "double"], quotes: ["warn", "double"],
//semi: ['off', 'never'], //semi: ['off', 'never'],
"vue/html-indent": ["warn", 4], // default: 2 "vue/html-indent": ["warn", 4], // default: 2
@ -53,6 +61,9 @@ module.exports = {
"space-infix-ops": "warn", "space-infix-ops": "warn",
"arrow-spacing": "warn", "arrow-spacing": "warn",
"no-trailing-spaces": "warn", "no-trailing-spaces": "warn",
"no-constant-condition": ["error", {
"checkLoops": false,
}],
"space-before-blocks": "warn", "space-before-blocks": "warn",
//'no-console': 'warn', //'no-console': 'warn',
"no-extra-boolean-cast": "off", "no-extra-boolean-cast": "off",

19
package-lock.json generated
View file

@ -96,6 +96,25 @@
} }
} }
}, },
"@babel/eslint-parser": {
"version": "7.14.7",
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.14.7.tgz",
"integrity": "sha512-6WPwZqO5priAGIwV6msJcdc9TsEPzYeYdS/Xuoap+/ihkgN6dzHp2bcAAwyWZ5bLzk0vvjDmKvRwkqNaiJ8BiQ==",
"dev": true,
"requires": {
"eslint-scope": "^5.1.1",
"eslint-visitor-keys": "^2.1.0",
"semver": "^6.3.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
}
},
"@babel/generator": { "@babel/generator": {
"version": "7.14.8", "version": "7.14.8",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz",

View file

@ -56,6 +56,7 @@
"vue-toastification": "^2.0.0-rc.1" "vue-toastification": "^2.0.0-rc.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "^7.13.10",
"@types/bootstrap": "^5.0.17", "@types/bootstrap": "^5.0.17",
"@vitejs/plugin-legacy": "^1.5.0", "@vitejs/plugin-legacy": "^1.5.0",
"@vitejs/plugin-vue": "^1.3.0", "@vitejs/plugin-vue": "^1.3.0",

View file

@ -1,8 +1,9 @@
const fs = require("fs"); const fs = require("fs");
const {sleep} = require("../src/util"); const { sleep } = require("../src/util");
const {R} = require("redbean-node"); const { R } = require("redbean-node");
const {setSetting, setting} = require("./util-server"); const {
setSetting, setting,
} = require("./util-server");
class Database { class Database {
@ -95,7 +96,7 @@ class Database {
const listener = (reason, p) => { const listener = (reason, p) => {
Database.noReject = false; Database.noReject = false;
}; };
process.addListener('unhandledRejection', listener); process.addListener("unhandledRejection", listener);
console.log("Closing DB") console.log("Closing DB")
@ -112,7 +113,7 @@ class Database {
} }
console.log("SQLite closed") console.log("SQLite closed")
process.removeListener('unhandledRejection', listener); process.removeListener("unhandledRejection", listener);
} }
} }