diff options
author | 2024-04-15 07:16:37 -0600 | |
---|---|---|
committer | 2024-04-15 07:16:37 -0600 | |
commit | cbba61b40112b41c43285a1a279969e68df1a2e9 (patch) | |
tree | 6f2e95326033396c5f7b79b48e5a3febb0877ff3 /src | |
parent | 6.7.3-nightly.10 [skip ci] (diff) | |
download | ferdium-app-cbba61b40112b41c43285a1a279969e68df1a2e9.tar.gz ferdium-app-cbba61b40112b41c43285a1a279969e68df1a2e9.tar.zst ferdium-app-cbba61b40112b41c43285a1a279969e68df1a2e9.zip |
refactor: project maintenance (#1682)
- remove redundant `@adonisjs/auth`, `@adonisjs/session` and `@emotion/react` dependencies
- remove `.vscode` folder
- clean up some TS and ESLint issues
- migrate from deprecated "husky install" to "husky"
Diffstat (limited to 'src')
-rw-r--r-- | src/api/server/ServerApi.ts | 5 | ||||
-rw-r--r-- | src/models/Recipe.ts | 16 | ||||
-rw-r--r-- | src/stores/SettingsStore.ts | 6 | ||||
-rw-r--r-- | src/webview/contextMenuBuilder.ts | 12 |
4 files changed, 18 insertions, 21 deletions
diff --git a/src/api/server/ServerApi.ts b/src/api/server/ServerApi.ts index 69994114e..ab6866b13 100644 --- a/src/api/server/ServerApi.ts +++ b/src/api/server/ServerApi.ts | |||
@@ -379,8 +379,7 @@ export default class ServerApi { | |||
379 | .filter(recipe => recipe.id); | 379 | .filter(recipe => recipe.id); |
380 | 380 | ||
381 | // @ts-expect-error Type 'boolean' is not assignable to type 'ConcatArray<IRecipe>'. | 381 | // @ts-expect-error Type 'boolean' is not assignable to type 'ConcatArray<IRecipe>'. |
382 | // eslint-disable-next-line unicorn/prefer-spread | 382 | this.recipes = [...this.recipes, ...this._getDevRecipes()]; |
383 | this.recipes = this.recipes.concat(this._getDevRecipes()); | ||
384 | 383 | ||
385 | debug('StubServerApi::getInstalledRecipes resolves', this.recipes); | 384 | debug('StubServerApi::getInstalledRecipes resolves', this.recipes); |
386 | return this.recipes; | 385 | return this.recipes; |
@@ -582,7 +581,7 @@ export default class ServerApi { | |||
582 | file !== 'temp', | 581 | file !== 'temp', |
583 | ); | 582 | ); |
584 | 583 | ||
585 | const recipes = paths | 584 | const recipes: IRecipe[] = paths |
586 | .map(id => { | 585 | .map(id => { |
587 | try { | 586 | try { |
588 | // eslint-disable-next-line import/no-dynamic-require | 587 | // eslint-disable-next-line import/no-dynamic-require |
diff --git a/src/models/Recipe.ts b/src/models/Recipe.ts index e8f11df5f..11eb1884f 100644 --- a/src/models/Recipe.ts +++ b/src/models/Recipe.ts | |||
@@ -50,14 +50,14 @@ export interface IRecipe { | |||
50 | partition: string; | 50 | partition: string; |
51 | local: boolean; | 51 | local: boolean; |
52 | 52 | ||
53 | // eslint-disable-next-line @typescript-eslint/ban-types | 53 | readonly overrideUserAgent?: () => string; |
54 | readonly overrideUserAgent?: null | Function; | 54 | |
55 | // eslint-disable-next-line @typescript-eslint/ban-types | 55 | readonly buildUrl?: (url: string) => string; |
56 | readonly buildUrl?: null | Function; | 56 | |
57 | // eslint-disable-next-line @typescript-eslint/ban-types | 57 | readonly modifyRequestHeaders?: () => void; |
58 | readonly modifyRequestHeaders?: null | Function; | 58 | |
59 | // eslint-disable-next-line @typescript-eslint/ban-types | 59 | readonly knownCertificateHosts?: () => void; |
60 | readonly knownCertificateHosts?: null | Function; | 60 | |
61 | readonly events?: null | ((key: string) => string); | 61 | readonly events?: null | ((key: string) => string); |
62 | 62 | ||
63 | // TODO: [TS DEBT] Need to check if below properties are needed and where is inherited / implemented from | 63 | // TODO: [TS DEBT] Need to check if below properties are needed and where is inherited / implemented from |
diff --git a/src/stores/SettingsStore.ts b/src/stores/SettingsStore.ts index 72d6331cb..29f173f91 100644 --- a/src/stores/SettingsStore.ts +++ b/src/stores/SettingsStore.ts | |||
@@ -183,8 +183,10 @@ export default class SettingsStore extends TypedStore { | |||
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | // eslint-disable-next-line @typescript-eslint/ban-types | 186 | _ensureMigrationAndMarkDone( |
187 | _ensureMigrationAndMarkDone(migrationName: string, callback: Function): void { | 187 | migrationName: string, |
188 | callback: () => void, | ||
189 | ): void { | ||
188 | if (!this.all.migration[migrationName]) { | 190 | if (!this.all.migration[migrationName]) { |
189 | callback(); | 191 | callback(); |
190 | 192 | ||
diff --git a/src/webview/contextMenuBuilder.ts b/src/webview/contextMenuBuilder.ts index dd39560da..f81b051ee 100644 --- a/src/webview/contextMenuBuilder.ts +++ b/src/webview/contextMenuBuilder.ts | |||
@@ -288,11 +288,9 @@ export class ContextMenuBuilder { | |||
288 | this.addPaste(menu, menuInfo); | 288 | this.addPaste(menu, menuInfo); |
289 | this.addPastePlain(menu, menuInfo); | 289 | this.addPastePlain(menu, menuInfo); |
290 | this.addInspectElement(menu, menuInfo); | 290 | this.addInspectElement(menu, menuInfo); |
291 | // @ts-expect-error Expected 1 arguments, but got 2. | 291 | this.processMenu(menu); |
292 | this.processMenu(menu, menuInfo); | ||
293 | 292 | ||
294 | // @ts-expect-error Expected 2 arguments, but got 1. | 293 | this.copyPageUrl(menu, menuInfo); |
295 | this.copyPageUrl(menu); | ||
296 | this.goToHomePage(menu, menuInfo); | 294 | this.goToHomePage(menu, menuInfo); |
297 | this.openInBrowser(menu, menuInfo); | 295 | this.openInBrowser(menu, menuInfo); |
298 | 296 | ||
@@ -349,14 +347,12 @@ export class ContextMenuBuilder { | |||
349 | } | 347 | } |
350 | 348 | ||
351 | this.addInspectElement(menu, menuInfo); | 349 | this.addInspectElement(menu, menuInfo); |
352 | // @ts-expect-error Expected 1 arguments, but got 2. | 350 | this.processMenu(menu); |
353 | this.processMenu(menu, menuInfo); | ||
354 | 351 | ||
355 | this.addSeparator(menu); | 352 | this.addSeparator(menu); |
356 | this.goBack(menu); | 353 | this.goBack(menu); |
357 | this.goForward(menu); | 354 | this.goForward(menu); |
358 | // @ts-expect-error Expected 2 arguments, but got 1. | 355 | this.copyPageUrl(menu, menuInfo); |
359 | this.copyPageUrl(menu); | ||
360 | this.goToHomePage(menu, menuInfo); | 356 | this.goToHomePage(menu, menuInfo); |
361 | this.openInBrowser(menu, menuInfo); | 357 | this.openInBrowser(menu, menuInfo); |
362 | 358 | ||