Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
🐛 fixing linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ice8lue committed Dec 1, 2021
1 parent 6e680c2 commit 8503189
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 9 additions & 9 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const electron = require("electron");

const config = new ElectronStore({
name: "config",
defaults: defaultConfig
defaults: defaultConfig,
});

const getIcon = () => {
Expand All @@ -41,28 +41,28 @@ 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");
}

mb.window.setSize(500, 47);
};

const expand = skipEvent => {
const expand = (skipEvent) => {
if (!skipEvent) {
mb.window.webContents.send("window-expand");
}
Expand All @@ -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,
});
}

Expand Down
6 changes: 3 additions & 3 deletions src/renderer/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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("@", "")
);
}
34 changes: 17 additions & 17 deletions webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,55 +19,55 @@ 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)$/,
parser: { amd: false },
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/[email protected]",
to: "assets/[email protected]"
to: "assets/[email protected]",
},
{
from: "src/main/assets/icon_light.png",
to: "assets/icon_light.png"
to: "assets/icon_light.png",
},
{
from: "src/main/assets/[email protected]",
to: "assets/[email protected]"
to: "assets/[email protected]",
},
{
from: "src/main/config.default.json",
to: "config.default.json"
}
])
]
to: "config.default.json",
},
]),
],
};

0 comments on commit 8503189

Please sign in to comment.