diff options
author | 2023-07-30 10:55:59 -0600 | |
---|---|---|
committer | 2023-07-30 23:57:51 +0000 | |
commit | 080d8b05297f3f5afcf33354a40a5201697b1df5 (patch) | |
tree | 35180bd3cb9fcd137feca3fe169032cbbb469463 /src/electron | |
parent | refactor: various improvements (#1296) (diff) | |
download | ferdium-app-080d8b05297f3f5afcf33354a40a5201697b1df5.tar.gz ferdium-app-080d8b05297f3f5afcf33354a40a5201697b1df5.tar.zst ferdium-app-080d8b05297f3f5afcf33354a40a5201697b1df5.zip |
refactor: more lint improvements
- set parserOptions.ecmaVersion to latest and env to es2024 in eslint config
- install missing types libraries
- install eslint-plugin-sonar
- enable eslint-plugin-sonar recommended rules and declare jsx-runtime for react in eslint config
- clean up disabled lint rules which don't inflict problems anymore
- disable various lint issues and fix others
Diffstat (limited to 'src/electron')
-rw-r--r-- | src/electron/exception.ts | 1 | ||||
-rw-r--r-- | src/electron/ipc-api/appIndicator.ts | 2 | ||||
-rw-r--r-- | src/electron/ipc-api/download.ts | 2 | ||||
-rw-r--r-- | src/electron/ipc-api/localServer.ts | 4 | ||||
-rw-r--r-- | src/electron/macOSPermissions.ts | 2 |
5 files changed, 6 insertions, 5 deletions
diff --git a/src/electron/exception.ts b/src/electron/exception.ts index ada98d17b..a445a6475 100644 --- a/src/electron/exception.ts +++ b/src/electron/exception.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | // eslint-disable-next-line unicorn/no-empty-file | ||
1 | process.on('uncaughtException', err => { | 2 | process.on('uncaughtException', err => { |
2 | // handle the error safely | 3 | // handle the error safely |
3 | console.error(err); | 4 | console.error(err); |
diff --git a/src/electron/ipc-api/appIndicator.ts b/src/electron/ipc-api/appIndicator.ts index 766e6937a..c3232d89f 100644 --- a/src/electron/ipc-api/appIndicator.ts +++ b/src/electron/ipc-api/appIndicator.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { app, ipcMain, BrowserWindow } from 'electron'; | 1 | import { app, ipcMain, BrowserWindow } from 'electron'; |
2 | import { join } from 'path'; | 2 | import { join } from 'node:path'; |
3 | import { autorun } from 'mobx'; | 3 | import { autorun } from 'mobx'; |
4 | import { isMac, isWindows, isLinux } from '../../environment'; | 4 | import { isMac, isWindows, isLinux } from '../../environment'; |
5 | import TrayIcon from '../../lib/Tray'; | 5 | import TrayIcon from '../../lib/Tray'; |
diff --git a/src/electron/ipc-api/download.ts b/src/electron/ipc-api/download.ts index 851bff4c3..0c7e022d4 100644 --- a/src/electron/ipc-api/download.ts +++ b/src/electron/ipc-api/download.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { ipcMain, dialog, BrowserWindow } from 'electron'; | 1 | import { ipcMain, dialog, BrowserWindow } from 'electron'; |
2 | import { download } from 'electron-dl'; | 2 | import { download } from 'electron-dl'; |
3 | import { writeFileSync } from 'fs-extra'; | 3 | import { writeFileSync } from 'fs-extra'; |
4 | import { PathLike } from 'fs'; | 4 | import { PathLike } from 'node:fs'; |
5 | 5 | ||
6 | const debug = require('../../preload-safe-debug')('Ferdium:ipcApi:download'); | 6 | const debug = require('../../preload-safe-debug')('Ferdium:ipcApi:download'); |
7 | 7 | ||
diff --git a/src/electron/ipc-api/localServer.ts b/src/electron/ipc-api/localServer.ts index 6264e719d..5fdfad32c 100644 --- a/src/electron/ipc-api/localServer.ts +++ b/src/electron/ipc-api/localServer.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { randomBytes } from 'crypto'; | 1 | import { randomBytes } from 'node:crypto'; |
2 | import { ipcMain, BrowserWindow } from 'electron'; | 2 | import { ipcMain, BrowserWindow } from 'electron'; |
3 | import { createServer } from 'net'; | 3 | import { createServer } from 'node:net'; |
4 | import { LOCAL_HOSTNAME, LOCAL_PORT } from '../../config'; | 4 | import { LOCAL_HOSTNAME, LOCAL_PORT } from '../../config'; |
5 | import { userDataPath } from '../../environment-remote'; | 5 | import { userDataPath } from '../../environment-remote'; |
6 | import { server } from '../../internal-server/start'; | 6 | import { server } from '../../internal-server/start'; |
diff --git a/src/electron/macOSPermissions.ts b/src/electron/macOSPermissions.ts index 88706dd23..90056f59c 100644 --- a/src/electron/macOSPermissions.ts +++ b/src/electron/macOSPermissions.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { systemPreferences, BrowserWindow, dialog } from 'electron'; | 1 | import { systemPreferences, BrowserWindow, dialog } from 'electron'; |
2 | import { pathExistsSync, mkdirSync, writeFileSync } from 'fs-extra'; | 2 | import { pathExistsSync, mkdirSync, writeFileSync } from 'fs-extra'; |
3 | import macosVersion from 'macos-version'; | 3 | import macosVersion from 'macos-version'; |
4 | import { dirname } from 'path'; | 4 | import { dirname } from 'node:path'; |
5 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error | 5 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error |
6 | // @ts-ignore | 6 | // @ts-ignore |
7 | import { askForScreenCaptureAccess } from 'node-mac-permissions'; | 7 | import { askForScreenCaptureAccess } from 'node-mac-permissions'; |