Lint fix
This commit is contained in:
+10
-14
@@ -1,20 +1,16 @@
|
||||
import React from "react";
|
||||
|
||||
export interface JsonLDProps {
|
||||
data: object;
|
||||
interface JsonLDProps {
|
||||
data: Record<string, unknown>;
|
||||
}
|
||||
|
||||
class JsonLD extends React.Component<JsonLDProps, undefined> {
|
||||
render() {
|
||||
return (
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: JSON.stringify(this.props.data),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
const JsonLD: React.FC<JsonLDProps> = ({ data }) => (
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: JSON.stringify(data),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
export default JsonLD;
|
||||
|
||||
@@ -23,6 +23,7 @@ declare const module: { hot: any };
|
||||
|
||||
if (module.hot) {
|
||||
module.hot.accept("./routes", () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const NewRoutes = require("./routes").default;
|
||||
|
||||
render(
|
||||
|
||||
@@ -23,7 +23,7 @@ const buildSchema = (formData: Event, signupForms: SignupForm[], tags: Tag[]) =>
|
||||
const tomorrowDatetime = tomorrowDate.toISOString();
|
||||
|
||||
const schema = {
|
||||
title: formData?.id ? formData.title_fi : "New Event",
|
||||
title: formData?.title_fi ?? "New Event",
|
||||
type: "object",
|
||||
required: ["title_fi", "title_en", "tags", "location_fi", "location_en", "start_time", "end_time", "description_fi", "description_en", "content_fi", "content_en"],
|
||||
properties: {
|
||||
|
||||
@@ -19,7 +19,7 @@ const buildSchema = (formData: Post, tags: Tag[]) => {
|
||||
const currentDatetime = date.toISOString();
|
||||
|
||||
const schema = {
|
||||
title: formData?.id ? formData.title_fi : "New Post",
|
||||
title: formData?.title_fi ?? "New Post",
|
||||
type: "object",
|
||||
required: ["title_fi", "title_en", "description_fi", "description_en", "content_fi", "content_en", "publish_time"],
|
||||
properties: {
|
||||
|
||||
@@ -18,7 +18,7 @@ const buildSchema = (formData: JobAd) => {
|
||||
monthFromNow.setDate(new Date().getDate() + 30);
|
||||
|
||||
const schema = {
|
||||
title: formData?.id ? formData.title_fi : "New Job Ad",
|
||||
title: formData?.title_fi ?? "New Job Ad",
|
||||
type: "object",
|
||||
required: ["title_fi", "title_en", "description_fi", "description_en", "content_fi", "content_en", "autohide_at", "autohide_enabled", "visible"],
|
||||
properties: {
|
||||
|
||||
@@ -28,7 +28,7 @@ const buildSchema = (formData: SignupForm) => {
|
||||
const tomorrowDatetime = tomorrowDate.toISOString();
|
||||
|
||||
const schema = {
|
||||
title: formData?.id ? formData.title_fi : "New Sign-up form",
|
||||
title: formData?.title_fi ?? "New Sign-up form",
|
||||
type: "object",
|
||||
required: ["title_fi", "title_en", "start_time", "end_time", "questions"],
|
||||
properties: {
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
const noop = () => {};
|
||||
export default noop;
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import { Hero, HeroPrimarySection, HeroSecondarySection, HeroSecondarySectionItem, HeroAside, HeroAsideItem, HeroPrimaryButtons } from "@components/Hero";
|
||||
import Anchor from "@components/Anchor";
|
||||
import noop from "@utils/noop";
|
||||
|
||||
const ActualPageHero: React.FC = () => (
|
||||
<Hero>
|
||||
@@ -11,12 +12,12 @@ const ActualPageHero: React.FC = () => (
|
||||
>
|
||||
<HeroPrimaryButtons row>
|
||||
<Anchor to="#tapahtumat">
|
||||
<button onClick={() => { }}>
|
||||
<button onClick={noop}>
|
||||
<span>Tapahtumat ›</span>
|
||||
</button>
|
||||
</Anchor>
|
||||
<Anchor to="#uutiset">
|
||||
<button onClick={() => { }}>
|
||||
<button onClick={noop}>
|
||||
<span>Uutiset ›</span>
|
||||
</button>
|
||||
</Anchor>
|
||||
|
||||
@@ -4,6 +4,7 @@ import Button from "@components/Button";
|
||||
|
||||
import FilterContainer from "./FilterContainer";
|
||||
import { CardSection, Card, FullWidthSection } from "@components/index";
|
||||
import noop from "@utils/noop";
|
||||
|
||||
interface EventCalendarProps {
|
||||
events: Event[];
|
||||
@@ -38,7 +39,7 @@ const EventCalendar: React.FC<EventCalendarProps> = ({events}) => {
|
||||
start_time={e.start_time}
|
||||
text={e.description_fi}
|
||||
link={`/events/${e.id}`}
|
||||
buttonOnClick={() => {}}
|
||||
buttonOnClick={noop}
|
||||
>
|
||||
</Card>
|
||||
))}
|
||||
|
||||
@@ -4,6 +4,7 @@ import Button from "@components/Button";
|
||||
|
||||
import FilterContainer from "./FilterContainer";
|
||||
import { CardSection, Card, FullWidthSection } from "@components/index";
|
||||
import noop from "@utils/noop";
|
||||
|
||||
interface NewsProps {
|
||||
feed: Post[];
|
||||
@@ -37,7 +38,7 @@ const News: React.FC<NewsProps> = ({feed}) => {
|
||||
start_time={post.publish_time}
|
||||
text={post.description_fi}
|
||||
link={`/feed/${post.id}`}
|
||||
buttonOnClick={() => {}}
|
||||
buttonOnClick={noop}
|
||||
>
|
||||
</Card>
|
||||
))}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { colors } from "@theme/colors";
|
||||
import { Event } from "@models/Event";
|
||||
import Button from "@components/Button";
|
||||
import Anchor from "@components/Anchor";
|
||||
import noop from "@utils/noop";
|
||||
|
||||
interface EventPageViewProps {
|
||||
event?: Event;
|
||||
@@ -91,7 +92,7 @@ const EventPageView: React.FC<EventPageViewProps> = ({ event }) => {
|
||||
<SignupButtons>
|
||||
{event.signupForm.map(sf => (
|
||||
<Anchor key={sf.id} to={`/signup/${sf.id}`}>
|
||||
<Button type="filled" onClick={() => {}}>
|
||||
<Button type="filled" onClick={noop}>
|
||||
{sf.title_fi}
|
||||
</Button>
|
||||
</Anchor>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from "react";
|
||||
import Anchor from "@components/Anchor";
|
||||
import { Hero, HeroPrimarySection, HeroAside, HeroAsideItem, HeroPrimaryButtons } from "@components/Hero";
|
||||
import noop from "@utils/noop";
|
||||
|
||||
const FrontPageHero: React.FC = () => (
|
||||
<Hero>
|
||||
@@ -11,12 +12,12 @@ const FrontPageHero: React.FC = () => (
|
||||
>
|
||||
<HeroPrimaryButtons>
|
||||
<Anchor to="/kilta">
|
||||
<button onClick={() => { }}>
|
||||
<button onClick={noop}>
|
||||
<span>Tietoa killasta ›</span>
|
||||
</button>
|
||||
</Anchor>
|
||||
<Anchor to="/kilta/toiminta">
|
||||
<button onClick={() => { }}>
|
||||
<button onClick={noop}>
|
||||
<span>Vastapainoa opiskelulle ›</span>
|
||||
</button>
|
||||
</Anchor>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Post } from "@models/Feed";
|
||||
import { colors } from "@theme/colors";
|
||||
import Anchor from "@components/Anchor";
|
||||
import FullWidthSection from "@components/Sections/FullWidthSection";
|
||||
import noop from "@utils/noop";
|
||||
|
||||
interface FrontPageViewProps {
|
||||
events: Event[];
|
||||
@@ -51,7 +52,7 @@ const FrontPageView: React.FC<FrontPageViewProps> = ({ events, feed }) => (
|
||||
text={event.description_fi}
|
||||
link={`/events/${event.id}`}
|
||||
image={event.image || event.tags[0].icon}
|
||||
buttonOnClick={() => {}}
|
||||
buttonOnClick={noop}
|
||||
/>
|
||||
))}
|
||||
<aside>
|
||||
@@ -78,7 +79,7 @@ const FrontPageView: React.FC<FrontPageViewProps> = ({ events, feed }) => (
|
||||
start_time={inst.publish_time}
|
||||
text={inst.description_fi}
|
||||
link={`/feed/${inst.id}`}
|
||||
buttonOnClick={() => {}}
|
||||
buttonOnClick={noop}
|
||||
/>
|
||||
))}
|
||||
<aside>
|
||||
|
||||
@@ -4,8 +4,8 @@ import { SignupForm } from "@models/SignupForm";
|
||||
import { EMAIL_REGEX } from "@utils/regexes";
|
||||
import escapeRegExp from "lodash/escapeRegExp";
|
||||
|
||||
const questionToUISchemaProp = (question: Question): {} => {
|
||||
let obj = {};
|
||||
const questionToUISchemaProp = (question: Question) => {
|
||||
let obj: Record<"ui:widget", string>;
|
||||
if (question.type == "checkbox") {
|
||||
obj = {
|
||||
"ui:widget": "checkboxes",
|
||||
@@ -16,16 +16,16 @@ const questionToUISchemaProp = (question: Question): {} => {
|
||||
"ui:widget": "radio",
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// throw new Error(`No mapping to UI schema prop for question type ${question.type}`);
|
||||
// }
|
||||
else {
|
||||
throw new Error(`No mapping to UI schema prop for question type ${question.type}`);
|
||||
}
|
||||
return {
|
||||
[question.id]: obj,
|
||||
};
|
||||
}
|
||||
|
||||
const questionToValidationSchema = (question: Question) => {
|
||||
let obj = {};
|
||||
let obj: Record<string, unknown>;
|
||||
if (question.type === "text" || question.type === "name") {
|
||||
obj = {
|
||||
type: "string",
|
||||
|
||||
Reference in New Issue
Block a user