Skip to content

Commit 6fe349d

Browse files
committed
chore: fix lint errors
1 parent e0238d1 commit 6fe349d

7 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎packages/desktop/.eslintrc.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
rules: {
1010
'no-console': ['warn', { allow: ['warn', 'error'] }],
1111
'@typescript-eslint/no-var-requires': 'off',
12+
'@typescript-eslint/no-require-imports': 'off',
1213
},
1314
globals: {
1415
zip: true,

‎packages/desktop/app/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (userDataPathIndex > 0) {
2727
/** Make sure the path is actually a writeable folder */
2828
try {
2929
fs.closeSync(fs.openSync(path.join(userDataPath, 'sn-test-file'), 'w'))
30-
} catch (e) {
30+
} catch {
3131
console.error('Failed to write to provided user data path. Aborting')
3232
app.exit(1)
3333
}

‎packages/desktop/app/javascripts/Main/File/FilesManager.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class FilesManager implements FilesManagerInterface {
4343
try {
4444
const data = await fs.promises.readFile(filepath, 'utf8')
4545
return JSON.parse(data)
46-
} catch (error) {
46+
} catch {
4747
return undefined
4848
}
4949
}
@@ -286,7 +286,7 @@ export class FilesManager implements FilesManagerInterface {
286286
async moveFile(source: PathLike, destination: PathLike): Promise<void> {
287287
try {
288288
await fs.promises.rename(source, destination)
289-
} catch (_error) {
289+
} catch {
290290
/** Fall back to copying and then deleting. */
291291
await fs.promises.copyFile(source, destination, fs.constants.COPYFILE_FICLONE_FORCE)
292292
await fs.promises.unlink(source)

‎packages/desktop/app/javascripts/Main/Keychain/Keychain.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function ensureKeychainAccess(store: Store): Promise<BrowserWindow | undef
2727
try {
2828
await getKeychainValue()
2929
store.set(StoreKeys.UseNativeKeychain, true)
30-
} catch (_) {
30+
} catch {
3131
/** Can't access keychain. */
3232
if (keychainAccessIsUserConfigurable) {
3333
return askForKeychainAccess(store)

‎packages/desktop/app/javascripts/Main/Packages/Networking.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export async function getJSON<T>(url: string): Promise<T | undefined> {
4747
try {
4848
const parsed = JSON.parse(data)
4949
resolve(parsed)
50-
} catch (error) {
50+
} catch {
5151
resolve(undefined)
5252
}
5353
})

‎packages/desktop/app/javascripts/Main/Types/Paths.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ export const Paths = {
3939
get homeDir(): string | undefined {
4040
try {
4141
return app.getPath('home')
42-
} catch (error) {
42+
} catch {
4343
return undefined
4444
}
4545
},
4646
get documentsDir(): string | undefined {
4747
try {
4848
return app.getPath('documents')
49-
} catch (error) {
49+
} catch {
5050
return undefined
5151
}
5252
},

‎packages/desktop/app/javascripts/Main/Window.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ function fileUrlsAreEqual(a: string, b: string): boolean {
260260
bPath = lowercaseDriveLetter(bPath)
261261
}
262262
return aPath === bPath
263-
} catch (error) {
263+
} catch {
264264
return false
265265
}
266266
}
@@ -275,7 +275,7 @@ async function getPreviousWindowPosition() {
275275
let position: WindowPosition
276276
try {
277277
position = JSON.parse(await fs.promises.readFile(path.join(Paths.userDataDir, 'window-position.json'), 'utf8'))
278-
} catch (e) {
278+
} catch {
279279
return {
280280
bounds: {
281281
width: WINDOW_DEFAULT_WIDTH,

0 commit comments

Comments
 (0)