diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2023-07-23 20:08:52 -0600 |
---|---|---|
committer | Vijay Aravamudhan <vraravam@users.noreply.github.com> | 2023-07-25 07:45:23 +0000 |
commit | 8c131073730ec684145c2cc8ee8d6b39bbe9278d (patch) | |
tree | 1129d432ae88475909f0e5d38960395b75364902 /src/stores/SettingsStore.ts | |
parent | 6.4.1-nightly.11 [skip ci] (diff) | |
download | ferdium-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/stores/SettingsStore.ts')
-rw-r--r-- | src/stores/SettingsStore.ts | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/stores/SettingsStore.ts b/src/stores/SettingsStore.ts index 5ca499160..90cd82690 100644 --- a/src/stores/SettingsStore.ts +++ b/src/stores/SettingsStore.ts | |||
@@ -70,14 +70,17 @@ export default class SettingsStore extends TypedStore { | |||
70 | this.all.app.lockingFeatureEnabled && | 70 | this.all.app.lockingFeatureEnabled && |
71 | this.all.app.inactivityLock !== 0 | 71 | this.all.app.inactivityLock !== 0 |
72 | ) { | 72 | ) { |
73 | inactivityTimer = setTimeout(() => { | 73 | inactivityTimer = setTimeout( |
74 | this.actions.settings.update({ | 74 | () => { |
75 | type: 'app', | 75 | this.actions.settings.update({ |
76 | data: { | 76 | type: 'app', |
77 | locked: true, | 77 | data: { |
78 | }, | 78 | locked: true, |
79 | }); | 79 | }, |
80 | }, this.all.app.inactivityLock * 1000 * 60); | 80 | }); |
81 | }, | ||
82 | this.all.app.inactivityLock * 1000 * 60, | ||
83 | ); | ||
81 | } | 84 | } |
82 | }); | 85 | }); |
83 | getCurrentWindow().on('focus', () => { | 86 | getCurrentWindow().on('focus', () => { |
@@ -176,6 +179,7 @@ export default class SettingsStore extends TypedStore { | |||
176 | 179 | ||
177 | const appSettings = this.all[type]; | 180 | const appSettings = this.all[type]; |
178 | if (Object.hasOwnProperty.call(appSettings, key)) { | 181 | if (Object.hasOwnProperty.call(appSettings, key)) { |
182 | // eslint-disable-next-line @typescript-eslint/no-dynamic-delete | ||
179 | delete appSettings[key]; | 183 | delete appSettings[key]; |
180 | 184 | ||
181 | this.actions.settings.update({ | 185 | this.actions.settings.update({ |
@@ -185,6 +189,7 @@ export default class SettingsStore extends TypedStore { | |||
185 | } | 189 | } |
186 | } | 190 | } |
187 | 191 | ||
192 | // eslint-disable-next-line @typescript-eslint/ban-types | ||
188 | _ensureMigrationAndMarkDone(migrationName: string, callback: Function): void { | 193 | _ensureMigrationAndMarkDone(migrationName: string, callback: Function): void { |
189 | if (!this.all.migration[migrationName]) { | 194 | if (!this.all.migration[migrationName]) { |
190 | callback(); | 195 | callback(); |