setup next-eslint

This commit is contained in:
Aarni Halinen
2021-06-15 22:05:41 +03:00
parent 9922ca43f9
commit a20dcca1d7
13 changed files with 108 additions and 59 deletions
+3 -2
View File
@@ -1,7 +1,6 @@
import React from "react";
// eslint-disable-next-line react/display-name
export default (): JSX.Element => (
const Icons = (): JSX.Element => (
<>
<link rel="shortcut icon" href="/favicons/favicon.ico" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png" />
@@ -54,3 +53,5 @@ export default (): JSX.Element => (
<link rel="yandex-tableau-widget" href="/favicons/yandex-browser-manifest.json" />
</>
);
export default Icons;
+3 -2
View File
@@ -1,7 +1,6 @@
import React from "react";
// eslint-disable-next-line react/display-name
export default (): JSX.Element => (
const Logo = (): JSX.Element => (
// eslint-disable-next-line react/no-danger
<head dangerouslySetInnerHTML={{
__html:
@@ -55,3 +54,5 @@ export default (): JSX.Element => (
}}
/>
);
export default Logo;
@@ -27,7 +27,9 @@ const Heading = styled.h3`
const SectionDividerWidget: React.FC<SectionDividerWidgetProps> = ({ label }) => (
<Heading>
{label}&nbsp;{getIconByLabel(label)}
{label}
&nbsp;
{getIconByLabel(label)}
</Heading>
);
@@ -51,19 +51,20 @@ class OptionsWidget extends React.Component<OptionsWidgetProps> {
onChange(questions);
};
requiredField() {
requiredField(): JSX.Element {
const { inputProps } = this.props;
const { questions, index } = inputProps;
return (
<Checkbox
checked={questions[index].required}
onChange={this.handleRequiredChange(questions, index)}
>Required?
>
Required?
</Checkbox>
);
}
render() {
render(): JSX.Element {
const { inputProps } = this.props;
const {
type, value, questions, index,
+3 -1
View File
@@ -26,7 +26,9 @@ const NotFoundPage: NextPage = () => (
<Header />
<NotFound id="not-found">
<p>
<strong>404</strong> | Ei&nbsp;vaan&nbsp;löydy
<strong>404</strong>
{" "}
| Ei&nbsp;vaan&nbsp;löydy
</p>
</NotFound>
</>
+1 -2
View File
@@ -126,11 +126,10 @@ const AppContainer = styled.div`
background-color: ${colors.white};
`;
const Web20App = ({ Component, pageProps }: AppProps) => (
const Web20App = ({ Component, pageProps }: AppProps): JSX.Element => (
<>
<Head>
<meta httpEquiv="Content-Type" content="text/html; charset=utf-8" />
<link href="https://fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,800,900&display=swap" rel="stylesheet" />
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Aalto-yliopiston Sähköinsinöörikilta ry</title>
+2 -1
View File
@@ -29,12 +29,13 @@ export default class MyDocument extends Document<{ styleTags: unknown }> {
}
}
render() {
render(): JSX.Element {
const { styleTags } = this.props;
return (
<Html lang="fi">
<Head>
<HTMLLogo />
<link href="https://fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,800,900&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css" />
<Favicons />
</Head>
+4 -2
View File
@@ -46,7 +46,8 @@ const AdminLoginPage: NextPage = () => {
<div className="error">You have to log in first.</div>
)}
<form className="admin-login-form" onSubmit={handleSubmit}>
<label>Username
<label>
Username
<input
id="login-username"
type="text"
@@ -57,7 +58,8 @@ const AdminLoginPage: NextPage = () => {
}}
/>
</label>
<label>Password
<label>
Password
<input
id="login-password"
type="password"
+4 -1
View File
@@ -61,7 +61,10 @@ const SignupEmailPage: NextPage = () => {
return (
<AdminListCommon>
<h1>{title}: Sign-ups</h1>
<h1>
{title}
: Sign-ups
</h1>
<table>
<thead>
<tr>
+4 -3
View File
@@ -30,7 +30,7 @@ const orderedCommittees = [
Others,
];
const blank_profile = "/img/blank_profile.png";
const blankProfile = "/img/blank_profile.png";
const BlueLink = styled(Link)`
color: ${colors.blue1};
@@ -91,7 +91,7 @@ const CommitteeContainer: React.FC<{
name={representative.name}
phone={representative.phone_number}
email={representative.email}
image={(committee.name_en === "Board") ? (representative.image || blank_profile) : null}
image={(committee.name_en === "Board") ? (representative.image || blankProfile) : null}
role_fi={role.name_fi}
role_en={role.name_en}
/>
@@ -126,7 +126,8 @@ const ContactsPageView: React.FC = () => (
<TextSection>
<h1>Yhteystiedot</h1>
<p>
Asiaa olisi, mutta kehen ottaa yhteyttä?<br />
Asiaa olisi, mutta kehen ottaa yhteyttä?
<br />
Tämä sivu yrittää valottaa sen oikean ihmisen puhelinnumeroa ja sähköpostiosoitetta.
</p>
<aside>