Skip to content

Commit

Permalink
tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
zeim839 committed Jul 11, 2024
1 parent 9590b35 commit 21dcdd3
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 23 deletions.
16 changes: 11 additions & 5 deletions gatsby-node.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import path from 'path'
import { createFilePath } from 'gatsby-source-filesystem'

const createBlog = async (createPage: Function, reporter: any, graphql: Function) => {
const createBlog = async (
createPage: Function, reporter: any, graphql: Function
) => {

// Define the template for blog post.
const blogPost = path.resolve('./src/templates/BlogPostTemplate.tsx')
Expand Down Expand Up @@ -30,9 +32,11 @@ const createBlog = async (createPage: Function, reporter: any, graphql: Function

const posts = result.data.allMarkdownRemark.nodes

// Create blog posts pages
// But only if there's at least one markdown file found at "content/blog" (defined in gatsby-config.js)
// `context` is available in the template as a prop and as a variable in GraphQL
// Create blog posts pages.
// But only if there's at least one markdown file found at
// "content/blog" (defined in gatsby-config.js).
// `context` is available in the template as a prop and as
// a variable in GraphQL.
if (posts.length <= 0) {
return
}
Expand All @@ -52,7 +56,9 @@ const createBlog = async (createPage: Function, reporter: any, graphql: Function
})
}

const createProjects = async (createPage: Function, reporter: any, graphql: Function) => {
const createProjects = async (
createPage: Function, reporter: any, graphql: Function
) => {

// Define the template for blog post.
const projectTemplate = path.resolve('./src/templates/ProjectTemplate.tsx')
Expand Down
11 changes: 8 additions & 3 deletions src/components/Animation/Renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ function generateIndexedWithOffsetPointcloud
}

export default function(props: { speed: number, scale: number }) {
let camera: any, renderer: any, scene: any,
clock: any, raycaster: any, pointer: any, rotateY : any
let camera: any
let renderer: any
let scene: any
let clock: any
let raycaster: any
let pointer: any
let rotateY : any

let pointclouds : any = []

Expand Down Expand Up @@ -184,7 +189,7 @@ clock: any, raycaster: any, pointer: any, rotateY : any

const dims = dimensions()
const container = document.getElementById('animation__root')
if (container == null || typeof container == 'undefined') {
if (container === null || typeof container === 'undefined') {
return
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/ArticleCard/ArticleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function ArticleCard(props: { data: any }) {
<h2 style={{ fontWeight: "bold" }}>
{
props.data.author.map((author: string, i: number) => {
if (i == props.data.author.length - 1) {
if (i === props.data.author.length - 1) {
return author
}
return author + ", "
Expand Down
2 changes: 1 addition & 1 deletion src/components/CursorText.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from "react"
import Typewriter from "typewriter-effect"

export default function CursorText(props: { batch: Array<string> }) {
export default function CursorText(props: { batch: string[] }) {
return (
<div style={{ width: "var(--width-max)", height: 80 }}>
<Typewriter
Expand Down
2 changes: 1 addition & 1 deletion src/components/Index/ContactSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function ContactSection() {
setForm({ ...form, [field]: event.target.value})
}

const onSubmit = (event: { preventDefault: Function }) => {
const onSubmit = (event: { preventDefault: () => any }) => {
event.preventDefault()
alert("Contact form is temporarily unavailable")
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Index/ProjectSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function ProjectSection(props: { nodes: any }) {
nodes = nodes.slice(0, 6)
}

let cards : Array<any> = []
const cards : any[] = []
for (let i = 0; i < nodes.length; ++i) {
cards.push((<ProjectCard index={i} data={nodes[i].frontmatter} />))
}
Expand Down
10 changes: 7 additions & 3 deletions src/components/Marquee/Marquee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,23 @@ type MarqueeProps = {
*/
gradientWidth?: number | string;
/**
* @description A callback for when the marquee finishes scrolling and stops. Only calls if loop is non-zero.
* @description A callback for when the marquee finishes scrolling
* and stops. Only calls if loop is non-zero.
* @type {() => void}
* @default null
*/
onFinish?: () => void;
/**
* @description A callback for when the marquee finishes a loop. Does not call if maximum loops are reached (use onFinish instead).
* @description A callback for when the marquee finishes a loop. Does
* not call if maximum loops are reached (use onFinish instead).
* @type {() => void}
* @default null
*/
onCycleComplete?: () => void;
/**
* @description: A callback function that is invoked once the marquee has finished mounting. It can be utilized to recalculate the page size, if necessary.
* @description: A callback function that is invoked once the marquee
* has finished mounting. It can be utilized to recalculate the page
* size, if necessary.
* @type {() => void}
* @default null
*/
Expand Down
2 changes: 1 addition & 1 deletion src/components/Overlay/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react"
import "./Overlay.css"

interface OverlayProps {
children: Array<any>;
children: any[];
className?: string;
style?: any;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Slideshow/Slideshow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Slideshow = (props: { children: any, period?: number }) => {
}

const SlideIndices = () => {
let rows : any = []
const rows : any = []
for (let i = 0; i < props.children.length; i++) {
if (i !== select) {
rows.push((
Expand Down Expand Up @@ -75,7 +75,7 @@ export const Slideshow = (props: { children: any, period?: number }) => {
// Rendering the child directly (e.g. props.children[select])
// means we re-download images every time they are rendered.
props.children.map((child: any, i: number) => {
if (i == select) {
if (i === select) {
return (<div style={{ width: "100%" }}>{ child }</div>)
}
return (
Expand Down
4 changes: 2 additions & 2 deletions src/pages/projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { graphql } from "gatsby"
import type { HeadFC, PageProps } from "gatsby"

const ProjectsPage: React.FC<PageProps> = (props: { data: any }) => {
let nodes = props.data.allMdx.nodes
let cards : Array<any> = []
const nodes = props.data.allMdx.nodes
const cards : any[] = []
for (let i = 0; i < nodes.length; ++i) {
cards.push((<ProjectCard index={i} data={nodes[i].frontmatter} />))
}
Expand Down
6 changes: 4 additions & 2 deletions src/templates/BlogPostTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ interface ArticleBodyPrompts {

const ArticleBody: React.FC<ArticleBodyPrompts> = ({ data, children }) => {
const { frontmatter } = data.markdownRemark
let img = getImage(frontmatter.featuredImage?.childImageSharp?.gatsbyImageData)
const img = getImage(
frontmatter.featuredImage?.childImageSharp?.gatsbyImageData
)
return (
<div className="article-layout">
<div className="article-layout__matter">
Expand All @@ -26,7 +28,7 @@ const ArticleBody: React.FC<ArticleBodyPrompts> = ({ data, children }) => {
<h2 className="author">
{
frontmatter.author.map((author: string, i: number) => {
if (i == frontmatter.author.length - 1) {
if (i === frontmatter.author.length - 1) {
return author
}
return author + ", "
Expand Down
3 changes: 2 additions & 1 deletion src/templates/ProjectTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ interface ProjectTemplateProps {
children: any;
}

const ProjectTemplate : React.FC<ProjectTemplateProps> = ({ data, children }) => (
const ProjectTemplate :
React.FC<ProjectTemplateProps> = ({ data, children }) => (
<Layout>
<MDXProvider>
{ children }
Expand Down

0 comments on commit 21dcdd3

Please sign in to comment.