aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/lib
diff options
context:
space:
mode:
authorLibravatar MCMXC <16797721+mcmxcdev@users.noreply.github.com>2023-07-23 20:08:52 -0600
committerLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2023-07-25 07:45:23 +0000
commit8c131073730ec684145c2cc8ee8d6b39bbe9278d (patch)
tree1129d432ae88475909f0e5d38960395b75364902 /src/webview/lib
parent6.4.1-nightly.11 [skip ci] (diff)
downloadferdium-app-8c131073730ec684145c2cc8ee8d6b39bbe9278d.tar.gz
ferdium-app-8c131073730ec684145c2cc8ee8d6b39bbe9278d.tar.zst
ferdium-app-8c131073730ec684145c2cc8ee8d6b39bbe9278d.zip
chore: improve lint setup
- update eslint config - merged eslint rules for JS and TS to avoid duplicates - extended stricter lint ruleset from typescript-eslint - corrected wrong setup for certain eslint rulesets - opt in to reportUnusedDisableDirectives config option - fix or disable a lot of lint issues throughout codebase - remove trailingComma: all from prettier config which is default in prettier v3 - add volta configuration to package.json to autoload correct node and pnpm versions - upgrade all eslint and prettier related dependencies to latest - remove config options from settings.json which are default anyways - remove config options from settings.json which are outdated/unknown - set up prettier as default formatter in settings.json
Diffstat (limited to 'src/webview/lib')
-rw-r--r--src/webview/lib/Userscript.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/webview/lib/Userscript.ts b/src/webview/lib/Userscript.ts
index b0e4fb805..5adc1ac3a 100644
--- a/src/webview/lib/Userscript.ts
+++ b/src/webview/lib/Userscript.ts
@@ -32,7 +32,7 @@ export default class Userscript {
32 * 32 *
33 * @param {*} settings 33 * @param {*} settings
34 */ 34 */
35 // eslint-disable-next-line camelcase 35
36 internal_setSettings(settings: any) { 36 internal_setSettings(settings: any) {
37 // This is needed to get a clean JS object from the settings itself to provide better accessibility 37 // This is needed to get a clean JS object from the settings itself to provide better accessibility
38 // Otherwise this will be a mobX instance 38 // Otherwise this will be a mobX instance
@@ -45,7 +45,7 @@ export default class Userscript {
45 * @param {number} indirect Indirect messages 45 * @param {number} indirect Indirect messages
46 */ 46 */
47 setBadge(direct: number = 0, indirect: number = 0) { 47 setBadge(direct: number = 0, indirect: number = 0) {
48 if (this.recipe && this.recipe.setBadge) { 48 if (this.recipe?.setBadge) {
49 this.recipe.setBadge(direct, indirect); 49 this.recipe.setBadge(direct, indirect);
50 } 50 }
51 } 51 }
@@ -55,7 +55,7 @@ export default class Userscript {
55 * @param {*} title Dialog title 55 * @param {*} title Dialog title
56 */ 56 */
57 setDialogTitle(title: string) { 57 setDialogTitle(title: string) {
58 if (this.recipe && this.recipe.setDialogTitle) { 58 if (this.recipe?.setDialogTitle) {
59 this.recipe.setDialogTitle(title); 59 this.recipe.setDialogTitle(title);
60 } 60 }
61 } 61 }
@@ -66,7 +66,7 @@ export default class Userscript {
66 * @param {...string} files 66 * @param {...string} files
67 */ 67 */
68 injectCSSFiles(...files: string[]) { 68 injectCSSFiles(...files: string[]) {
69 if (this.recipe && this.recipe.injectCSS) { 69 if (this.recipe?.injectCSS) {
70 // @ts-expect-error A spread argument must either have a tuple type or be passed to a rest parameter. 70 // @ts-expect-error A spread argument must either have a tuple type or be passed to a rest parameter.
71 this.recipe.injectCSS(...files); 71 this.recipe.injectCSS(...files);
72 } 72 }
@@ -99,6 +99,7 @@ export default class Userscript {
99 * @param {string} key 99 * @param {string} key
100 * @return Value of the key 100 * @return Value of the key
101 */ 101 */
102 // eslint-disable-next-line consistent-return
102 get(key: string) { 103 get(key: string) {
103 const ferdiumUserKey = window.localStorage.getItem(`ferdium-user-${key}`); 104 const ferdiumUserKey = window.localStorage.getItem(`ferdium-user-${key}`);
104 105