Skip to content

Commit

Permalink
chore: Update ESLint configuration and MainRewards component
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed Jul 17, 2024
1 parent 7404048 commit 3d65d65
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
15 changes: 6 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
"overrides": [
{
// Next Frontend
"excludedFiles": [
"frontend/node_modules/*",
"frontend/.next",
"frontend/next.config.js",
"frontend/next-env.d.ts",
"frontend/.eslintrc.json"
],
"excludedFiles": ["frontend/node_modules/*", "frontend/.next"],
"extends": [
"plugin:@typescript-eslint/recommended",
"next/core-web-vitals"
Expand Down Expand Up @@ -38,7 +32,11 @@
},
{
// Electron
"excludedFiles": ["electron/node_modules/*", "electron/.next"],
"excludedFiles": [
"electron/node_modules/*",
"electron/.next",
"eslint/preload.mjs"
],
"extends": ["plugin:@typescript-eslint/recommended"],
"files": ["electron/**/*.js"],
"parser": "@typescript-eslint/parser",
Expand All @@ -60,6 +58,5 @@
}
}
],
"plugins": ["prettier", "unused-imports", "simple-import-sort", "import"],
"root": true
}
13 changes: 7 additions & 6 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ const createMainWindow = async () => {
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
preload: path.join(import.meta.dirname, 'preload.js'),
enableRemoteModule: true,
preload: path.join(import.meta.dirname, 'preload.mjs'),
},
});

Expand Down Expand Up @@ -248,7 +249,7 @@ const createMainWindow = async () => {

mainWindow.webContents.setWindowOpenHandler(({ url }) => {
// open url in a browser and prevent default
require('electron').shell.openExternal(url);
import('electron').then((mod) => mod.shell.openExternal(url));
return { action: 'deny' };
});

Expand Down Expand Up @@ -284,7 +285,7 @@ async function launchDaemon() {
logger.electron('Backend not running!');
}

const check = new Promise(function (resolve, _reject) {
const check = new Promise(function (resolve) {
operateDaemon = spawn(
path.join(
process.resourcesPath,
Expand Down Expand Up @@ -326,7 +327,7 @@ async function launchDaemon() {
}

async function launchDaemonDev() {
const check = new Promise(function (resolve, _reject) {
const check = new Promise(function (resolve) {
operateDaemon = spawn('poetry', [
'run',
'operate',
Expand Down Expand Up @@ -382,7 +383,7 @@ async function launchNextApp() {
}

async function launchNextAppDev() {
await new Promise(function (resolve, _reject) {
await new Promise(function (resolve) {
process.env.NEXT_PUBLIC_BACKEND_PORT = appConfig.ports.dev.operate; // must set next env var to connect to backend
nextAppProcess = spawn(
'yarn',
Expand All @@ -405,7 +406,7 @@ async function launchNextAppDev() {
}

// Fires after splash screen is loaded
ipcMain.on('check', async function (event, _argument) {
ipcMain.on('check', async function (event) {
// Setup
try {
event.sender.send('response', 'Checking installation');
Expand Down
8 changes: 3 additions & 5 deletions electron/preload.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check
// This file is loaded in the renderer process before other scripts
import { contextBridge, ipcRenderer } from 'electron/renderer';

const electronAPI = {
contextBridge.exposeInMainWorld('electronAPI', {
// App controls
closeApp: () => ipcRenderer.send('close-app'),
minimizeApp: () => ipcRenderer.send('minimize-app'),
Expand Down Expand Up @@ -40,6 +40,4 @@ const electronAPI = {
invoke: (channel, data) => ipcRenderer.invoke(channel, data),
removeAllListeners: (channel) => ipcRenderer.removeAllListeners(channel),
},
};

contextBridge.exposeInMainWorld('electronAPI', electronAPI);
});
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,5 @@
"start:frontend": "cd frontend && yarn start",
"test:frontend": "cd frontend && yarn test"
},
"type": "module",
"version": "0.1.0-rc72"
}

0 comments on commit 3d65d65

Please sign in to comment.