Added eslint

dependabot/npm_and_yarn/typescript-eslint/parser-4.33.0
guusvanmeerveld 4 years ago
parent bc58b24fda
commit 67efeaf756

@ -0,0 +1,52 @@
{
"root": true,
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 8
},
"plugins": ["prettier"],
"ignorePatterns": ["node_modules/*", ".next/*", ".out/*", "!.prettierrc.js"],
"extends": ["eslint:recommended"],
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"],
"parser": "@typescript-eslint/parser",
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"browser": true,
"node": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended"
],
"rules": {
"prettier/prettier": "error",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/no-autofocus": "off",
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/explicit-function-return-type": [
"warn",
{
"allowExpressions": true,
"allowConciseArrowFunctionExpressionsStartingWithVoid": true,
"allowTypedFunctionExpressions": true
}
]
}
}
]
}

@ -1,3 +0,0 @@
module.export = {
basePath: '/'
}

@ -6,7 +6,8 @@
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"pretify": "prettier --write ." "prettify": "prettier --write .",
"lint": "eslint src"
}, },
"dependencies": { "dependencies": {
"milligram": "^1.4.1", "milligram": "^1.4.1",
@ -16,13 +17,19 @@
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-google-recaptcha": "^2.1.0", "react-google-recaptcha": "^2.1.0",
"react-icons": "^4.2.0", "react-icons": "^4.2.0",
"react-recaptcha-google": "^1.1.1",
"sass": "^1.34.0" "sass": "^1.34.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^15.6.1", "@types/node": "^15.6.1",
"@types/react": "^17.0.6", "@types/react": "^17.0.6",
"@types/react-google-recaptcha": "^2.1.0", "@types/react-google-recaptcha": "^2.1.0",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"eslint": "^7.27.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.3.0", "prettier": "^2.3.0",
"typescript": "^4.2.4" "typescript": "^4.2.4"
} }

@ -1,9 +1,11 @@
import ReCAPTCHA from 'react-google-recaptcha'; import ReCAPTCHA from 'react-google-recaptcha';
import { useTheme } from 'next-themes'; import { useTheme } from 'next-themes';
import { FC } from 'react';
const formURL = 'https://forms.guusvanmeerveld.dev/portfolio'; const formURL = 'https://forms.guusvanmeerveld.dev/portfolio';
const Contact = () => { const Contact: FC = () => {
const { theme } = useTheme(); const { theme } = useTheme();
return ( return (

@ -1,6 +1,8 @@
import { FaTwitter, FaYoutube, FaCoffee, FaGithub } from 'react-icons/fa'; import { FaTwitter, FaYoutube, FaCoffee, FaGithub } from 'react-icons/fa';
const Footer = () => { import { FC } from 'react';
const Footer: FC = () => {
return ( return (
<footer className="footer"> <footer className="footer">
<div className="container"> <div className="container">

@ -1,7 +1,9 @@
import Navbar from './Navbar'; import { FC } from 'react';
import Footer from './Footer';
const Layout = ({ children }) => ( import Navbar from '@components/Navbar';
import Footer from '@components/Footer';
const Layout: FC<{ children: JSX.Element | JSX.Element[] }> = ({ children }) => (
<> <>
<Navbar /> <Navbar />
{children} {children}

@ -2,9 +2,11 @@ import { useTheme } from 'next-themes';
import { BiMoon } from 'react-icons/bi'; import { BiMoon } from 'react-icons/bi';
import { ImSun } from 'react-icons/im'; import { ImSun } from 'react-icons/im';
const Navbar = () => { import { FC } from 'react';
const Navbar: FC = () => {
const { theme, setTheme } = useTheme(); const { theme, setTheme } = useTheme();
const switchTheme = () => setTheme(theme == 'dark' ? 'light' : 'dark'); const switchTheme = (): void => setTheme(theme == 'dark' ? 'light' : 'dark');
return ( return (
<nav className="navigation"> <nav className="navigation">
@ -12,7 +14,7 @@ const Navbar = () => {
<span className="header">Portfolio</span> <span className="header">Portfolio</span>
<div className="items"> <div className="items">
<a href="/#projects">Projects</a> <a href="/#projects">Projects</a>
<a href="/#contact">Contact</a> <a href="/contact">Contact</a>
<a href="https://github.com/guusvanmeerveld/portfolio">Source code</a> <a href="https://github.com/guusvanmeerveld/portfolio">Source code</a>
<BiMoon onClick={switchTheme} className="dark-switch moon" /> <BiMoon onClick={switchTheme} className="dark-switch moon" />

@ -1,14 +1,12 @@
import Head from 'next/head'; import Head from 'next/head';
const Page = ({ import { FC } from 'react';
title,
description, const Page: FC<{
children,
}: {
title: string; title: string;
description: string; description: string;
children: JSX.Element[] | JSX.Element; children: JSX.Element[] | JSX.Element;
}) => ( }> = ({ title, description, children }) => (
<> <>
<Head> <Head>
<meta charSet="UTF-8" /> <meta charSet="UTF-8" />

@ -1,13 +1,15 @@
import Page from 'src/components/Page'; import Page from 'src/components/Page';
import Layout from 'src/components/Layout'; import Layout from 'src/components/Layout';
const NotFound = () => ( import { FC } from 'react';
const NotFound: FC = () => (
<Page title="Page not found" description="This page either doesn't exist or has been deleted"> <Page title="Page not found" description="This page either doesn't exist or has been deleted">
<Layout> <Layout>
<div className="page"> <div className="page">
<div> <div>
<div className="header">Not found</div> <div className="header">Not found</div>
<div className="subtitle">This page either doesn't exist or has been deleted</div> <div className="subtitle">This page either doesn&apos;t exist or has been deleted</div>
<a href="/" className="link button"> <a href="/" className="link button">
Go back Go back
</a> </a>

@ -1,11 +1,13 @@
import { ThemeProvider } from 'next-themes'; import { ThemeProvider } from 'next-themes';
import type { AppProps } from 'next/app';
import 'milligram'; import 'milligram';
import '@styles/raleway.css'; import '@styles/raleway.css';
import '@styles/sass/index.scss'; import '@styles/sass/index.scss';
function App({ Component, pageProps }) { function App({ Component, pageProps }: AppProps): JSX.Element {
return ( return (
<ThemeProvider> <ThemeProvider>
<Component {...pageProps} /> <Component {...pageProps} />

@ -1,12 +1,19 @@
import Document, { Html, Head, Main, NextScript } from 'next/document'; import Document, {
Html,
Head,
Main,
NextScript,
DocumentInitialProps,
DocumentContext,
} from 'next/document';
export default class AppDocument extends Document { export default class AppDocument extends Document {
static async getInitialProps(ctx) { static async getInitialProps(ctx: DocumentContext): Promise<DocumentInitialProps> {
const initialProps = await Document.getInitialProps(ctx); const initialProps = await Document.getInitialProps(ctx);
return { ...initialProps }; return { ...initialProps };
} }
render() { render(): JSX.Element {
return ( return (
<Html lang="en"> <Html lang="en">
<Head /> <Head />

@ -1,24 +1,23 @@
import Page from '@components/Page'; import Page from '@components/Page';
import Layout from '@components/Layout'; import Layout from '@components/Layout';
import { Component } from 'react';
import React, { Component } from 'react';
class Binas extends Component { class Binas extends Component {
links: string[]; links: string[];
constructor(props) { componentDidMount(): void {
super(props); this.links = [];
this.links = new Array();
for (let i = 1; i < 305; i++) { for (let i = 1; i < 305; i++) {
this.links.push(this.link(i)); this.links.push(this.link(i));
} }
} }
link = (page) => link = (page: number): string =>
`https://cdp.contentdelivery.nu/1fa0c165-3b6c-4c5b-acee-a231157e66a3/20160908101125/extract/assets/img/layout/${page}.jpg`; `https://cdp.contentdelivery.nu/1fa0c165-3b6c-4c5b-acee-a231157e66a3/20160908101125/extract/assets/img/layout/${page}.jpg`;
render() { render(): JSX.Element {
return ( return (
<Page title="Binas" description="Voor wanneer je effe de binas nodig hebt"> <Page title="Binas" description="Voor wanneer je effe de binas nodig hebt">
<Layout> <Layout>

@ -1,12 +1,17 @@
import Page from 'src/components/Page'; import Page from 'src/components/Page';
import Layout from 'src/components/Layout'; import Layout from 'src/components/Layout';
import { NextPage } from 'next';
const Thanks = () => ( const Thanks: NextPage = () => (
<Page title="Thanks!" description="Thanks for submitting your contact form!"> <Page title="Thanks!" description="Thanks for submitting your contact form!">
<Layout> <Layout>
<div className="page"> <div className="page">
<div> <div>
<div className="icon"></div> <div className="icon">
<span role="img" aria-label="heart emoji">
</span>
</div>
<div className="header">Thank you!</div> <div className="header">Thank you!</div>
<div className="subtitle">Your submission is greatly appreciated!</div> <div className="subtitle">Your submission is greatly appreciated!</div>
<a href="/" className="link button"> <a href="/" className="link button">

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save