Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Commit ef27897

Browse files
committed
refactor: update lint rules
1 parent 68d319c commit ef27897

File tree

16 files changed

+1566
-2022
lines changed

16 files changed

+1566
-2022
lines changed

__mocks__/electron.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const EventEmitter = require('events')
1+
const EventTarget = require('events')
22
const { act } = require('@testing-library/react')
33

4-
const eventEmitter = new EventEmitter()
4+
const eventEmitter = new EventTarget()
55

66
let clipboard
77

package-lock.json

Lines changed: 1478 additions & 1960 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,37 +57,37 @@
5757
"react-dom": "^18.2.0",
5858
"react-redux": "^8.0.2",
5959
"redux": "^4.2.0",
60-
"tidy-url": "^1.5.4",
60+
"tidy-url": "^1.5.5",
6161
"tings": "^4.1.1"
6262
},
6363
"devDependencies": {
6464
"@commitlint/cli": "^17.0.3",
6565
"@commitlint/config-conventional": "^17.0.3",
66-
"@electron-forge/cli": "6.0.0-beta.64",
67-
"@electron-forge/maker-zip": "6.0.0-beta.64",
68-
"@electron-forge/plugin-webpack": "6.0.0-beta.64",
66+
"@electron-forge/cli": "6.0.0-beta.65",
67+
"@electron-forge/maker-zip": "6.0.0-beta.65",
68+
"@electron-forge/plugin-webpack": "6.0.0-beta.65",
6969
"@testing-library/jest-dom": "^5.16.4",
7070
"@testing-library/react": "^13.3.0",
7171
"@timfish/forge-externals-plugin": "^0.2.0",
7272
"@types/jest": "^28.1.6",
7373
"@types/lodash": "^4.14.182",
74-
"@types/node": "^18.0.6",
74+
"@types/node": "^18.6.2",
7575
"@types/react": "^18.0.15",
7676
"@types/react-dom": "^18.0.6",
7777
"@types/react-redux": "^7.1.24",
7878
"@vercel/webpack-asset-relocator-loader": "^1.7.3",
79-
"@will-stone/eslint-config-base": "^1.1.0",
80-
"@will-stone/eslint-config-jest": "^2.0.0",
79+
"@will-stone/eslint-config-base": "^2.0.0",
80+
"@will-stone/eslint-config-jest": "^2.1.0",
8181
"@will-stone/eslint-config-node": "^2.0.0",
82-
"@will-stone/eslint-config-prettier": "^2.0.0",
83-
"@will-stone/eslint-config-react": "^2.0.1",
84-
"@will-stone/eslint-config-typescript": "^2.0.0",
85-
"@will-stone/prettier-config": "^6.0.1",
82+
"@will-stone/eslint-config-prettier": "^2.0.1",
83+
"@will-stone/eslint-config-react": "^2.1.0",
84+
"@will-stone/eslint-config-typescript": "^2.1.0",
85+
"@will-stone/prettier-config": "^6.0.2",
8686
"concurrently": "^7.3.0",
8787
"copy-webpack-plugin": "^11.0.0",
8888
"css-loader": "^6.7.1",
8989
"cssnano": "^5.1.12",
90-
"electron": "^19.0.9",
90+
"electron": "^19.0.10",
9191
"electron-notarize": "^1.2.1",
9292
"eslint": "^8.20.0",
9393
"eslint-plugin-tailwindcss": "^3.6.0",
@@ -106,14 +106,14 @@
106106
"prettier": "^2.7.1",
107107
"rimraf": "^3.0.2",
108108
"style-loader": "^3.3.1",
109-
"tailwindcss": "^3.1.6",
109+
"tailwindcss": "^3.1.7",
110110
"ts-jest": "^28.0.7",
111111
"ts-loader": "^9.3.1",
112112
"ts-node": "^10.9.1",
113113
"typescript": "^4.7.4",
114114
"url-loader": "^4.1.1",
115115
"version-bump-prompt": "^6.1.0",
116-
"webpack": "^5.73.0"
116+
"webpack": "^5.74.0"
117117
},
118118
"engines": {
119119
"node": ">=16.0.0"

src/config/CONSTANTS.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
export const CARROT_URL = 'https://www.buymeacoffee.com/wstone'
2-
export const B_URL = 'https://github.com/will-stone/browserosaurus'
3-
export const ISSUES_URL = 'https://github.com/will-stone/browserosaurus/issues'
1+
const CARROT_URL = 'https://www.buymeacoffee.com/wstone'
2+
const B_URL = 'https://github.com/will-stone/browserosaurus'
3+
const ISSUES_URL = 'https://github.com/will-stone/browserosaurus/issues'
4+
5+
export { B_URL, CARROT_URL, ISSUES_URL }

src/config/apps.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface App {
66

77
const typeApps = <T extends Record<string, App>>(apps: T) => apps
88

9-
export const apps = typeApps({
9+
const apps = typeApps({
1010
'company.thebrowser.Browser': {
1111
name: 'Arc',
1212
},
@@ -209,6 +209,8 @@ export const apps = typeApps({
209209
},
210210
})
211211

212-
export type Apps = typeof apps
212+
type Apps = typeof apps
213213

214-
export type AppId = keyof typeof apps
214+
type AppId = keyof typeof apps
215+
216+
export { AppId, Apps, apps }

src/main/windows.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ declare const PREFS_WINDOW_WEBPACK_ENTRY: string
1414
declare const PREFS_WINDOW_PRELOAD_WEBPACK_ENTRY: string
1515

1616
// Prevents garbage collection
17-
export let pickerWindow: BrowserWindow | null | undefined
18-
export let prefsWindow: BrowserWindow | null | undefined
17+
let pickerWindow: BrowserWindow | null | undefined
18+
let prefsWindow: BrowserWindow | null | undefined
1919

20-
export async function createWindows(): Promise<void> {
20+
async function createWindows(): Promise<void> {
2121
prefsWindow = new BrowserWindow({
2222
// Only show on demand
2323
show: false,
@@ -126,7 +126,7 @@ export async function createWindows(): Promise<void> {
126126
])
127127
}
128128

129-
export function showPickerWindow(): void {
129+
function showPickerWindow(): void {
130130
if (pickerWindow) {
131131
const displayBounds = screen.getDisplayNearestPoint(
132132
screen.getCursorScreenPoint(),
@@ -163,6 +163,14 @@ export function showPickerWindow(): void {
163163
}
164164
}
165165

166-
export function showPrefsWindow(): void {
166+
function showPrefsWindow(): void {
167167
prefsWindow?.show()
168168
}
169+
170+
export {
171+
createWindows,
172+
pickerWindow,
173+
prefsWindow,
174+
showPickerWindow,
175+
showPrefsWindow,
176+
}

src/renderers/picker/components/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ const App: React.FC = () => {
108108
>
109109
<span>{app.name}</span>
110110
<span className="flex items-center space-x-4">
111-
{app.hotCode && (
111+
{app.hotCode ? (
112112
<Kbd className="shrink-0">{keyCodeMap[app.hotCode]}</Kbd>
113-
)}
113+
) : null}
114114
<AppLogo
115115
app={app}
116116
className="h-6 w-6 shrink-0"

src/renderers/picker/components/organisms/url-bar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const UrlBar: React.FC<Props> = ({ className }) => {
3737
{parsedUrl.hostname?.replace(/^www\./u, '') || (
3838
<span className="opacity-30">Browserosaurus</span>
3939
)}
40-
{parsedUrl.port && `:${parsedUrl.port}`}
40+
{parsedUrl.port ? `:${parsedUrl.port}` : null}
4141
</div>
4242
</div>
4343
)

src/renderers/picker/refs.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { createRef } from 'react'
22

3-
export const firstAppRef: React.MutableRefObject<HTMLButtonElement | null> =
4-
createRef()
3+
const appsRef: React.MutableRefObject<HTMLButtonElement[] | null> = createRef()
54

6-
export const appsRef: React.MutableRefObject<HTMLButtonElement[] | null> =
7-
createRef()
5+
const appsScrollerRef = createRef<HTMLDivElement>()
86

9-
export const appsScrollerRef = createRef<HTMLDivElement>()
7+
export { appsRef, appsScrollerRef }

src/renderers/picker/state/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ const middleware = [busMiddleware(Channel.PICKER), pickerMiddleware()]
1010

1111
const store = createStore(Channel.PICKER, middleware)
1212

13-
export default store
14-
1513
/**
1614
* Listen for all actions from main
1715
*/
1816
customWindow.electron.receive(Channel.MAIN, (action: AnyAction) => {
1917
store.dispatch(action)
2018
})
19+
20+
export default store

0 commit comments

Comments
 (0)