Altered linter rules and subsequent pass. Change how Spotify API credentials are refreshed.

This commit is contained in:
Erik 2024-05-01 16:31:52 +03:00
parent 76f25ac199
commit 1ef645c27d
25 changed files with 140 additions and 142 deletions

View File

@ -6,17 +6,7 @@
"es6": true, "es6": true,
"node": true "node": true
}, },
"overrides": [ "overrides": [],
// {
// "files": [
// "tests/*"
// ],
// "env": {
// "jest": true,
// "jest/globals": true
// }
// }
],
"extends": [ "extends": [
"eslint:recommended", "eslint:recommended",
"plugin:@typescript-eslint/recommended" "plugin:@typescript-eslint/recommended"
@ -109,7 +99,13 @@
"warn", "warn",
4, 4,
{ {
"SwitchCase": 1 "SwitchCase": 1,
"VariableDeclarator": "first",
"FunctionDeclaration": {"parameters": "first"},
"CallExpression": {"arguments": "first"},
"ArrayExpression": "first",
"ObjectExpression": "first",
"ImportDeclaration": "first"
} }
], ],
"init-declarations": "warn", "init-declarations": "warn",
@ -118,14 +114,15 @@
"single" "single"
], ],
"jsx-quotes": [ "jsx-quotes": [
"warn", "error",
"prefer-single" "prefer-single"
], ],
"key-spacing": [ "key-spacing": [
"warn", "warn",
{ {
"beforeColon": false, "beforeColon": false,
"afterColon": true "afterColon": true,
"align": "value"
} }
], ],
"keyword-spacing": [ "keyword-spacing": [
@ -164,7 +161,6 @@
"new-parens": "warn", "new-parens": "warn",
"no-alert": "warn", "no-alert": "warn",
"no-array-constructor": "warn", "no-array-constructor": "warn",
// "no-bitwise": "warn",
"no-buffer-constructor": "warn", "no-buffer-constructor": "warn",
"no-caller": "warn", "no-caller": "warn",
"no-console": "warn", "no-console": "warn",
@ -192,7 +188,7 @@
"no-loop-func": "warn", "no-loop-func": "warn",
"no-mixed-requires": "warn", "no-mixed-requires": "warn",
"no-multi-assign": "warn", "no-multi-assign": "warn",
"no-multi-spaces": "warn", "no-multi-spaces": ["warn", {"ignoreEOLComments": true, "exceptions": {"ImportDeclaration": true}}],
"no-multi-str": "warn", "no-multi-str": "warn",
"no-multiple-empty-lines": "warn", "no-multiple-empty-lines": "warn",
"no-native-reassign": "warn", "no-native-reassign": "warn",
@ -224,7 +220,7 @@
"no-setter-return": "warn", "no-setter-return": "warn",
"no-spaced-func": "warn", "no-spaced-func": "warn",
"@typescript-eslint/no-shadow": "error", "@typescript-eslint/no-shadow": "error",
"no-tabs": "warn", "no-tabs": "error",
"no-template-curly-in-string": "error", "no-template-curly-in-string": "error",
"no-throw-literal": "warn", "no-throw-literal": "warn",
"no-trailing-spaces": "warn", "no-trailing-spaces": "warn",
@ -241,7 +237,6 @@
"no-useless-rename": "warn", "no-useless-rename": "warn",
"no-useless-return": "warn", "no-useless-return": "warn",
"no-var": "warn", "no-var": "warn",
// "no-void": "warn",
"no-whitespace-before-property": "error", "no-whitespace-before-property": "error",
"nonblock-statement-body-position": [ "nonblock-statement-body-position": [
"warn", "warn",

View File

@ -55,7 +55,10 @@ class SpotifyAPI
this.#token = token; this.#token = token;
this.#tokenType = type; this.#tokenType = type;
setTimeout(this.login.bind(this), expires * 1000); setTimeout(() =>
{
this.#ready = false;
}, expires * 1000);
this.#ready = true; this.#ready = true;
} }