fix eslint on js files

This commit is contained in:
Aarni Halinen
2021-08-22 19:17:26 +03:00
parent b4a3cd8f44
commit 897faf8f47
8 changed files with 28 additions and 17 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import Icon, { IconType } from "./Icon";
import NavbarDropdownLink from "./NavbarDropdownLink";
import NavbarChildLink from "./NavbarChildLink";
export const renderNavigationItems = (mobile = false) => (
export const renderNavigationItems = (mobile = false): JSX.Element => (
<>
<NavbarDropdownLink to="/kilta" text="Kilta " exploded={mobile}>
<NavbarChildLink to="/kilta/toiminta">Toiminta</NavbarChildLink>
@@ -7,15 +7,15 @@ interface TypeWidgetProps {
}
class TypeWidget extends React.Component<TypeWidgetProps> {
handleTypeChange = (questions: Question[], index: number) => (event) => {
handleTypeChange = (questions: Question[], index: number): React.ChangeEventHandler<HTMLSelectElement> => (event) => {
const { onChange } = this.props;
const val = event.target.value;
const val = event.target.value as Question["type"];
// eslint-disable-next-line no-param-reassign
questions[index].type = val;
onChange(questions);
};
render() {
render(): JSX.Element {
const { inputProps } = this.props;
const { type, questions, index } = inputProps;
const options = optionTypes.map((t) => (
+2 -2
View File
@@ -1,13 +1,13 @@
import React from "react";
import Document, {
Html, Head, Main, NextScript, DocumentContext,
Html, Head, Main, NextScript, DocumentContext, DocumentInitialProps,
} from "next/document";
import { ServerStyleSheet } from "styled-components";
import Favicons from "@components/Favicons";
import HTMLLogo from "@components/HTMLLogo";
export default class MyDocument extends Document<{ styleTags: unknown }> {
static async getInitialProps(ctx: DocumentContext) {
static async getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps> {
const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage;
try {