From 850318982bd323a21cfa9547000ca3fb19cd175b Mon Sep 17 00:00:00 2001 From: Frank Adler Date: Wed, 1 Dec 2021 10:31:42 +0100 Subject: [PATCH] :bug: fixing linter warnings --- package.json | 4 ++-- src/main/index.js | 18 +++++++++--------- src/renderer/utils.ts | 6 +++--- webpack.main.config.js | 34 +++++++++++++++++----------------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 72d28de..e4c2dda 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "scripts": { "clean": "rm -rf out .webpack", "start": "yarn clean && electron-forge start", - "lint": "eslint src/**/*.ts src/**/*.tsx ./*.js", - "fix": "eslint src/**/*.ts src/**/*.tsx ./*.js --fix", + "lint": "eslint src/**/*.ts src/**/*.tsx src/**/*.js ./*.js", + "fix": "eslint src/**/*.ts src/**/*.tsx src/**/*.js ./*.js --fix", "package": "yarn clean && electron-forge package", "make": "yarn clean && electron-forge make", "publish": "yarn clean && electron-forge publish" diff --git a/src/main/index.js b/src/main/index.js index 4c71303..e888e57 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -23,7 +23,7 @@ const electron = require("electron"); const config = new ElectronStore({ name: "config", - defaults: defaultConfig + defaults: defaultConfig, }); const getIcon = () => { @@ -41,20 +41,20 @@ const mb = menubar({ width: 500, height: 47, webPreferences: { - nodeIntegration: true - } + nodeIntegration: true, + }, }, icon: getIcon(), preloadWindow: true, windowPosition: "trayRight", - tooltip: "RE:Trace" + tooltip: "RE:Trace", }); electron.nativeTheme.on("updated", () => { mb.tray.setImage(getIcon()); }); -const collapse = skipEvent => { +const collapse = (skipEvent) => { if (!skipEvent) { mb.window.webContents.send("window-collapse"); } @@ -62,7 +62,7 @@ const collapse = skipEvent => { mb.window.setSize(500, 47); }; -const expand = skipEvent => { +const expand = (skipEvent) => { if (!skipEvent) { mb.window.webContents.send("window-expand"); } @@ -74,14 +74,14 @@ const secondaryMenu = Menu.buildFromTemplate([ { label: "Quit", click: mb.app.quit, - accelerator: "CommandOrControl+Q" - } + accelerator: "CommandOrControl+Q", + }, ]); if (mb.app.isPackaged) { mb.app.setLoginItemSettings({ openAtLogin: config.get("autostart") === true, - openAsHidden: true + openAsHidden: true, }); } diff --git a/src/renderer/utils.ts b/src/renderer/utils.ts index 664694b..2064fa9 100644 --- a/src/renderer/utils.ts +++ b/src/renderer/utils.ts @@ -25,18 +25,18 @@ export function flatten(str: string): string { KEEP_CONTENT: true, FORBID_TAGS: ["script", "style"], ALLOWED_ATTR: [], - ALLOW_DATA_ATTR: false + ALLOW_DATA_ATTR: false, }); } export function extractHashtags(str: string): string[] { - return Array.from(str.match(HASHTAG_REGEX) || []).map(hashtag => + return Array.from(str.match(HASHTAG_REGEX) || []).map((hashtag) => hashtag.toLowerCase().replace("#", "") ); } export function extractMentions(str: string): string[] { - return Array.from(str.match(MENTION_REGEX) || []).map(mention => + return Array.from(str.match(MENTION_REGEX) || []).map((mention) => mention.toLowerCase().replace("@", "") ); } diff --git a/webpack.main.config.js b/webpack.main.config.js index ce55f0f..f8efccc 100644 --- a/webpack.main.config.js +++ b/webpack.main.config.js @@ -19,20 +19,20 @@ const CopyPlugin = require("copy-webpack-plugin"); module.exports = { target: "electron-main", entry: { - main: ["./src/main/index.js"] + main: ["./src/main/index.js"], }, resolve: { - extensions: [".js", ".json", ".ts"] + extensions: [".js", ".json", ".ts"], }, module: { rules: [ { test: /\.(ts)$/, - loader: "ts-loader" + loader: "ts-loader", }, { test: /\.node$/, - use: "node-loader" + use: "node-loader", }, { test: /\.(m?js|node)$/, @@ -40,34 +40,34 @@ module.exports = { use: { loader: "@marshallofsound/webpack-asset-relocator-loader", options: { - outputAssetBase: "native_modules" - } - } - } - ] + outputAssetBase: "native_modules", + }, + }, + }, + ], }, plugins: [ new CopyPlugin([ { from: "src/main/assets/icon_dark.png", - to: "assets/icon_dark.png" + to: "assets/icon_dark.png", }, { from: "src/main/assets/icon_dark@2x.png", - to: "assets/icon_dark@2x.png" + to: "assets/icon_dark@2x.png", }, { from: "src/main/assets/icon_light.png", - to: "assets/icon_light.png" + to: "assets/icon_light.png", }, { from: "src/main/assets/icon_light@2x.png", - to: "assets/icon_light@2x.png" + to: "assets/icon_light@2x.png", }, { from: "src/main/config.default.json", - to: "config.default.json" - } - ]) - ] + to: "config.default.json", + }, + ]), + ], };