Skip to content

Commit

Permalink
feat: adding husky
Browse files Browse the repository at this point in the history
  • Loading branch information
ailtonloures committed Sep 19, 2024
1 parent 4275396 commit 5c09ac2
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 18 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint && git add --all .
14 changes: 13 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# Dependency directories
node_modules
out

# Electron-Forge
out/

# Github workflows
.github

# VSCode settings
.vscode

# Markdown files
*.md
30 changes: 19 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
"scripts": {
"start": "electron-forge start --enable-logging",
"make:icons": "electron-icon-maker --input=./assets/icons/icon.png --output=./assets",
"lint": "eslint --fix",
"lint": "prettier --write . && eslint --fix",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish"
"publish": "electron-forge publish",
"prepare": "husky"
},
"dependencies": {
"@sentry/electron": "^5.4.0",
Expand All @@ -53,6 +54,7 @@
"eslint": "^9.9.1",
"eslint-config-prettier": "^9.1.0",
"globals": "^15.9.0",
"husky": "^9.1.6",
"prettier": "^3.3.3"
}
}
4 changes: 2 additions & 2 deletions src/shared/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function createBookmark({ path, basename }) {
id: new Date().getTime(),
},
...getBookmarks(),
]),
])
);
}

Expand All @@ -27,6 +27,6 @@ export function getBookmarks() {
export function deleteBookmark(id) {
store.set(
storeName,
JSON.stringify(getBookmarks().filter((item) => item.id !== id)),
JSON.stringify(getBookmarks().filter((item) => item.id !== id))
);
}
8 changes: 6 additions & 2 deletions src/tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { app, dialog, Menu, nativeImage, Tray } from 'electron/main';
import { spawn } from 'node:child_process';
import path from 'node:path';

import { createBookmark, deleteBookmark, getBookmarks } from './shared/store.js';
import {
createBookmark,
deleteBookmark,
getBookmarks,
} from './shared/store.js';

let tray = null;

Expand All @@ -28,7 +32,7 @@ function getLabel() {

function getIcon() {
return nativeImage.createFromPath(
path.resolve(import.meta.dirname, '..', 'assets/icons/png/16x16.png'),
path.resolve(import.meta.dirname, '..', 'assets/icons/png/16x16.png')
);
}

Expand Down

0 comments on commit 5c09ac2

Please sign in to comment.