Skip to content

Commit 19063c1

Browse files
committed
fix: eslint warnings, rendering legacy chunks for carthing
1 parent f4289c0 commit 19063c1

File tree

9 files changed

+35
-30
lines changed

9 files changed

+35
-30
lines changed

client/src/components/Menu/Menu.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ const Menu: React.FC = () => {
6464
}
6565
]
6666

67+
function onWheel(e: WheelEvent<HTMLDivElement>) {
68+
if (e.deltaX < 0) {
69+
setSelected(s => (s - 1 + elements.length) % elements.length)
70+
} else if (e.deltaX > 0) {
71+
setSelected(s => (s + 1) % elements.length)
72+
}
73+
}
74+
6775
useEffect(() => {
6876
function listener(e: KeyboardEvent) {
6977
if (e.key === 'm') {
@@ -99,14 +107,6 @@ const Menu: React.FC = () => {
99107
shownRef.current = shown
100108
}, [shown, setBlurred])
101109

102-
function onWheel(e: WheelEvent<HTMLDivElement>) {
103-
if (e.deltaX < 0) {
104-
setSelected(s => (s - 1 + elements.length) % elements.length)
105-
} else if (e.deltaX > 0) {
106-
setSelected(s => (s + 1) % elements.length)
107-
}
108-
}
109-
110110
useEffect(() => {
111111
const listener = (e: globalThis.WheelEvent) => {
112112
if (shownRef.current) {

client/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export default defineConfig({
1212
plugins: [
1313
react(),
1414
legacy({
15-
targets: ['Chrome 69']
15+
targets: ['Chrome 69'],
16+
renderModernChunks: false
1617
})
1718
],
1819
base: '/usr/share/qt-superbird-app/webapp/',
Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
import js from '@eslint/js'
2+
import globals from 'globals'
23
import tseslint from 'typescript-eslint'
34
import { defineConfig, globalIgnores } from 'eslint/config'
5+
import react from 'eslint-plugin-react'
46

57
export default defineConfig([
68
globalIgnores(['node_modules/', 'dist/', 'out/', 'client/']),
79
{
8-
files: ['**/*.ts'],
9-
plugins: { js },
10-
extends: ['js/recommended']
10+
files: ['**/*.{ts,tsx}'],
11+
plugins: { js, react },
12+
extends: ['js/recommended'],
13+
languageOptions: {
14+
globals: globals.browser
15+
}
1116
},
1217
tseslint.configs.recommended,
18+
react.configs.flat.recommended,
1319
{
1420
rules: {
1521
// 'no-async-promise-executor': 'off',
1622
// '@typescript-eslint/no-explicit-any': 'off'
23+
'react/react-in-jsx-scope': 'off'
24+
},
25+
settings: {
26+
react: { version: 'detect' }
1727
}
1828
}
1929
])

src/main/lib/playback/native.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,23 +104,23 @@ function importAddon() {
104104
if (process.arch === 'x64') {
105105
try {
106106
return require('node-nowplaying-win32-x64-msvc')
107-
} catch (e) {
107+
} catch {
108108
log('Failed to import native addon', 'Native')
109109
return null
110110
}
111111
}
112112
} else if (process.platform === 'darwin') {
113113
try {
114114
return require('node-nowplaying-darwin-universal')
115-
} catch (e) {
115+
} catch {
116116
log('Failed to import native addon', 'Native')
117117
return null
118118
}
119119
} else if (process.platform === 'linux') {
120120
if (process.arch === 'x64') {
121121
try {
122122
return require('node-nowplaying-linux-x64-gnu')
123-
} catch (e) {
123+
} catch {
124124
log('Failed to import native addon', 'Native')
125125
return null
126126
}
@@ -180,17 +180,14 @@ export function filterData(data: NowPlayingMessage): PlaybackData | null {
180180
return playbackData
181181
}
182182

183-
interface NativeConfig {}
184-
185183
class NativeHandler extends BasePlaybackHandler {
186184
name: string = 'native'
187185
requiresInternet: boolean = false
188186

189-
config: NativeConfig | null = null
190187
instance: NowPlaying | null = null
191188
current: NowPlayingMessage | null = null
192189

193-
async setup(config: NativeConfig): Promise<void> {
190+
async setup(): Promise<void> {
194191
log('Setting up', 'Native')
195192

196193
const addon = importAddon()
@@ -209,7 +206,6 @@ class NativeHandler extends BasePlaybackHandler {
209206
await instance.subscribe()
210207

211208
this.instance = instance
212-
this.config = config
213209
}
214210

215211
async cleanup(): Promise<void> {
@@ -220,9 +216,7 @@ class NativeHandler extends BasePlaybackHandler {
220216
this.removeAllListeners()
221217
}
222218

223-
async validateConfig(config: unknown): Promise<boolean> {
224-
const {} = config as NativeConfig
225-
219+
async validateConfig(): Promise<boolean> {
226220
return true
227221
}
228222

src/main/lib/screensaver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export async function uploadScreensaverImage() {
2929
'Image size exceeds the 5MB limit. Please select a smaller image.'
3030
}
3131
}
32-
} catch (error) {
32+
} catch {
3333
return {
3434
success: false,
3535
error: 'file_read_error',
@@ -51,7 +51,7 @@ export async function uploadScreensaverImage() {
5151
updateScreensaverImage()
5252

5353
return { success: true }
54-
} catch (error) {
54+
} catch {
5555
return {
5656
success: false,
5757
error: 'save_error',

src/preload/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@ if (process.contextIsolated) {
131131
console.error(error)
132132
}
133133
} else {
134-
// @ts-ignore (define in dts)
134+
// @ts-expect-error (define in dts)
135135
window.api = api
136136
}

src/renderer/src/pages/Setup/Steps/Playback/providers/Native/Native.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect } from 'react'
1+
import React from 'react'
22
import styles from './Native.module.css'
33

44
interface NativeProps {
@@ -9,8 +9,8 @@ const Native: React.FC<NativeProps> = ({ onStepComplete }) => {
99
return (
1010
<div className={styles.native}>
1111
<p>
12-
This will use your operating system's playback service to provide
13-
updates and controls.
12+
This will use your operating system&apos;s playback service to
13+
provide updates and controls.
1414
</p>
1515
<div className={styles.buttons}>
1616
<button onClick={onStepComplete}>Continue</button>

src/renderer/src/pages/Setup/Steps/Playback/providers/None/None.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect } from 'react'
1+
import React from 'react'
22
import styles from './None.module.css'
33

44
interface NoneProps {

0 commit comments

Comments
 (0)