eslint fix

This commit is contained in:
He4eT 2021-07-22 14:49:31 +05:00
commit 1e0b16361f
10 changed files with 25 additions and 23 deletions

View file

@ -10,7 +10,7 @@ export default ({ name, ifdb, url }) => (
<h4>{name}</h4> <h4>{name}</h4>
<a <a
target='_blank' target='_blank'
rel='noopener' rel='noopener noreferrer'
href={ifdb}> href={ifdb}>
IFDB page IFDB page
</a> </a>

View file

@ -1,5 +1,5 @@
import { h } from 'preact' import { h } from 'preact'
import { useEffect, useRef, useState } from 'preact/hooks' import { useEffect, useState } from 'preact/hooks'
import TextMessage from './TextMessage' import TextMessage from './TextMessage'
@ -47,10 +47,11 @@ export default function ({ inbox, currentWindow }) {
text.replace(' ', ' / ')) text.replace(' ', ' / '))
.map(text => ({ .map(text => ({
style: 'grid', style: 'grid',
text})) text
}))
setMessages(isEmpty ? [] : messages) setMessages(isEmpty ? [] : messages)
}, [inbox, currentWindow]) }, [inbox, currentWindow, prevMessages])
return ( return (
<section <section

View file

@ -6,7 +6,7 @@ const fail = details => (
<h1> <h1>
Error Error
</h1> </h1>
{details.map(x => (<p>{x}</p>))} {details.map(x => (<p key={x}>{x}</p>))}
<hr /> <hr />
<Link href='/'> <Link href='/'>
Home Home
@ -14,7 +14,7 @@ const fail = details => (
| |
<a <a
target='_blank' target='_blank'
rel='noopener' rel='noopener noreferrer'
href='https://github.com/He4eT/ifplayer/issues'> href='https://github.com/He4eT/ifplayer/issues'>
Report bug Report bug
</a> </a>
@ -23,7 +23,7 @@ const fail = details => (
const loading = details => ( const loading = details => (
<div class='status loading'> <div class='status loading'>
{details.map(x => (<div>{x}</div>))} {details.map(x => (<div key={x}>{x}</div>))}
</div> </div>
) )

View file

@ -57,7 +57,7 @@ export default function ({ inbox, currentWindow }) {
const { incoming, clear } = const { incoming, clear } =
parseInbox(inbox, currentWindow) parseInbox(inbox, currentWindow)
setMessages(clear setMessages(messages => clear
? incoming ? incoming
: messages.concat(incoming)) : messages.concat(incoming))
@ -72,7 +72,7 @@ export default function ({ inbox, currentWindow }) {
? lastInput.offsetTop ? lastInput.offsetTop
: textBufferEl.current.scrollHeight * 2 : textBufferEl.current.scrollHeight * 2
}, 0) }, 0)
}, [inbox]) }, [currentWindow, inbox])
const classes = [ const classes = [
isFakeStatus(currentWindow) isFakeStatus(currentWindow)

View file

@ -32,7 +32,6 @@ export const engineByFilename = filename => {
if (format) { if (format) {
return format.engine return format.engine
} else { }
throw new Error('Unsupported file type') throw new Error('Unsupported file type')
} }
}

View file

@ -2,7 +2,9 @@ import { h } from 'preact'
export default function ({ themeEngine }) { export default function ({ themeEngine }) {
const options = themeEngine.themes.map(theme => ( const options = themeEngine.themes.map(theme => (
<option value={theme}> <option
key={theme}
value={theme}>
{theme} {theme}
</option>)) </option>))

View file

@ -21,7 +21,7 @@ export default function () {
<h1> <h1>
<a <a
target='_blank' target='_blank'
rel='noopener' rel='noopener noreferrer'
href='https://ifdb.org/' href='https://ifdb.org/'
title='The Interactive Fiction Database'> title='The Interactive Fiction Database'>
IFDB IFDB
@ -60,21 +60,21 @@ export default function () {
<p> <p>
<a <a
target='_blank' target='_blank'
rel='noopener' rel='noopener noreferrer'
href='https://ifdb.org/search?comp&sortby=awn&searchfor=series%3AInteractive+Fiction+Top+50+of+All+Time'> href='https://ifdb.org/search?comp&sortby=awn&searchfor=series%3AInteractive+Fiction+Top+50+of+All+Time'>
Every four years </a>, Victor Gijsbers puts Every four years </a>, Victor Gijsbers puts
together a list of the top 50 IF games of all time. together a list of the top 50 IF games of all time.
Here is an almost complete version of the <a Here is an almost complete version of the <a
target='_blank' target='_blank'
rel='noopener' rel='noopener noreferrer'
href='https://ifdb.org/viewcomp?id=1lv599reviaxvwo7'> href='https://ifdb.org/viewcomp?id=1lv599reviaxvwo7'>
list for 2019</a>: list for 2019</a>:
</p> </p>
<ol> <ol>
{top2019.map(game => ( {top2019.map(game => (
<li> <li key={game[0]}>
<GameEntry {...{ <GameEntry {...{
...game ...game
}} /> }} />

View file

@ -31,7 +31,7 @@ export default function ({ themeEngine }) {
<br /> <br />
Source code can be found in this <a Source code can be found in this <a
target='_blank' target='_blank'
rel='noopener' rel='noopener noreferrer'
href='https://github.com/He4eT/ifplayer'> href='https://github.com/He4eT/ifplayer'>
repository repository
</a>. </a>.

View file

@ -17,7 +17,7 @@ export default () => (
| |
<a <a
target='_blank' target='_blank'
rel='noopener' rel='noopener noreferrer'
href='https://github.com/He4eT/ifplayer/issues'> href='https://github.com/He4eT/ifplayer/issues'>
Report bug Report bug
</a> </a>

View file

@ -10,7 +10,7 @@ const decode = encodedUrl => decodeURIComponent(encodedUrl)
export default function ({ export default function ({
setTheme, theme, encodedUrl, singleWindow setTheme, theme, encodedUrl, singleWindow
}) { }) {
useEffect(() => setTheme(theme), [theme]) useEffect(() => setTheme(theme), [setTheme, theme])
const [targetUrl, setTargetUrl] = useState(decode(encodedUrl)) const [targetUrl, setTargetUrl] = useState(decode(encodedUrl))