Skip to content

Commit

Permalink
update eslint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
a-wing committed Nov 21, 2024
1 parent aac5cc4 commit 975478e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,18 @@ export default ts.config(
'@stylistic/js': stylisticJs
},
rules: {
'@stylistic/js/comma-spacing': ['warn', {'before': false, 'after': true}],
'@stylistic/js/semi': ['warn', 'never'],
'@stylistic/js/space-in-parens': ['warn', 'never'],
'@stylistic/js/space-before-blocks': ['warn', { 'functions': 'always', 'keywords': 'always', 'classes': 'always' }],
'@stylistic/js/space-infix-ops': ['warn', { 'int32Hint': false }],
'@stylistic/js/space-unary-ops': ['warn'],
'@stylistic/js/switch-colon-spacing': ['warn'],
'@stylistic/js/no-multi-spaces': ['warn'],
'@stylistic/js/no-multiple-empty-lines': ['warn'],
'@stylistic/js/no-trailing-spaces': ['warn'],
'@stylistic/js/no-whitespace-before-property': ['warn'],
'@stylistic/js/new-parens': ['warn', 'always'],
'comma-dangle': ['warn', 'only-multiline'],
'@stylistic/js/quotes': ['warn', 'single', { 'avoidEscape': true }],
'@stylistic/js/indent': ['warn', 2, { 'SwitchCase': 1 }],
Expand Down
4 changes: 2 additions & 2 deletions webapp/components/device.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ export default function DeviceBar(props: { streamId: string }) {
try {
await navigator.mediaDevices.getUserMedia({ audio: true })
} catch { /* empty */ }

try {
await navigator.mediaDevices.getUserMedia({ video: true })
} catch { /* empty */ }
}

const devices = (await navigator.mediaDevices.enumerateDevices()).filter(i => !!i.deviceId)

const audios = devices.filter(i => i.kind === 'audioinput').map(toDevice)
Expand Down
6 changes: 3 additions & 3 deletions webapp/lib/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ const deviceScreen = {
}

async function asyncGetAudioStream(deviceId: string): Promise<MediaStream> {
let stream: MediaStream = new MediaStream
let stream: MediaStream = new MediaStream()
if (deviceId !== 'none') {
stream = await navigator.mediaDevices.getUserMedia({ audio: { deviceId: deviceId }, video: false })
}
return stream
}

async function asyncGetVideoStream(deviceId: string): Promise<MediaStream> {
let stream: MediaStream = new MediaStream
let stream: MediaStream = new MediaStream()
if (deviceId === 'none') {
stream = new MediaStream
/* empty */
} else if (deviceId === 'screen') {
stream = await navigator.mediaDevices.getDisplayMedia({ audio: false, video: { width: 640 } })
} else {
Expand Down
2 changes: 1 addition & 1 deletion webapp/store/atom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const meetingJoinedAtom = atom(false)
meetingJoinedAtom.debugLabel = 'meetingJoined'

const presentationStreamAtom = atom<UserStream>({
stream: new MediaStream,
stream: new MediaStream(),
name: 'Presentation',
})
presentationStreamAtom.debugLabel = 'presentationStream'
Expand Down

0 comments on commit 975478e

Please sign in to comment.