Update frontend linting

This commit is contained in:
Arnie
2024-10-25 23:48:08 +02:00
parent 31eebd8dab
commit 08a45037fa
21 changed files with 2035 additions and 3823 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import createCache from "@emotion/cache";
import createCache, { EmotionCache } from "@emotion/cache";
import { CacheProvider, Global, ThemeProvider, css } from "@emotion/react";
import styled from "@emotion/styled";
import normalizeCss from "normalize.css/normalize.css?inline";
@@ -13,7 +13,7 @@ const themeCache = createCache({
key: "cv",
});
const i = themeCache.insert;
const i: EmotionCache["insert"] = (...args) => themeCache.insert(...args);
themeCache.insert = (...args) => {
args[2].tags.forEach((t) => {
if (!t.getAttribute("media")) {
+13 -13
View File
@@ -9,19 +9,19 @@ import { Paragraph } from "../common/Text";
const messages = defineMessages({
skills: {
defaultMessage: "Skills",
id: "Experience.skills",
id: "4JISx9",
},
});
const approxCurrentYears = {
InvestBay: Math.round(
(Date.now() - new Date("2024-02-01").getTime()) / 1000 / 60 / 60 / 24 / 365
(Date.now() - new Date("2024-02-01").getTime()) / 1000 / 60 / 60 / 24 / 365,
),
YourPass: Math.round(
(Date.now() - new Date("2021-06-01").getTime()) / 1000 / 60 / 60 / 24 / 365
(Date.now() - new Date("2021-06-01").getTime()) / 1000 / 60 / 60 / 24 / 365,
),
YourSystemSysOps: Math.round(
(Date.now() - new Date("2022-01-01").getTime()) / 1000 / 60 / 60 / 24 / 365
(Date.now() - new Date("2022-01-01").getTime()) / 1000 / 60 / 60 / 24 / 365,
),
};
@@ -103,12 +103,12 @@ const Experience: React.FC = () => {
{intl.formatMessage(
{
defaultMessage: "February 2024 - Present",
id: "Experience.investbay",
id: "w2Pn7j",
},
{
// not used atm
count: approxCurrentYears.InvestBay,
}
},
)}
</Paragraph>
<Paragraph>
@@ -126,11 +126,11 @@ const Experience: React.FC = () => {
{intl.formatMessage(
{
defaultMessage: "July 2021 - Present ({count} years)",
id: "Experience.yourpass",
id: "6T3Cls",
},
{
count: approxCurrentYears.YourPass,
}
},
)}
</Paragraph>
<Paragraph>
@@ -149,11 +149,11 @@ const Experience: React.FC = () => {
{intl.formatMessage(
{
defaultMessage: "January 2022 - Present ({count} years)",
id: "Experience.yoursystem",
id: "nqa9U0",
},
{
count: approxCurrentYears.YourSystemSysOps,
}
},
)}
</Paragraph>
<Paragraph>
@@ -168,7 +168,7 @@ const Experience: React.FC = () => {
<Paragraph>
{intl.formatMessage({
defaultMessage: "February 2016 - December 2021 (5 years)",
id: "Experience.yoursystem",
id: "96SwL8",
})}
</Paragraph>
<Paragraph>
@@ -186,14 +186,14 @@ const Experience: React.FC = () => {
<Paragraph>
{intl.formatMessage({
defaultMessage: "Birth - February 2016",
id: "Experience.past",
id: "KtILZ7",
})}
</Paragraph>
<Paragraph>
{intl.formatMessage({
defaultMessage:
"Working on smaller projects such as chats, forum based websites, web based presentations, most notably a system for handling the driver training center and driving school agenda... Tinkering...",
id: "Experience.pastDescription",
id: "obpLg6",
})}
</Paragraph>
</Content>
+2 -2
View File
@@ -1,4 +1,4 @@
import React from "react";
import React, { Children } from "react";
import PageBreakAvoid from "../common/PageBreakAvoid";
import { Spacer } from "../common/Spacer";
@@ -15,7 +15,7 @@ const Skill: React.FC<React.PropsWithChildren<SkillProps>> = (props) => {
<PageBreakAvoid>
<strong>{title}</strong>
<Spacer />
{React.Children.map(children, (c) => (
{Children.map(children, (c) => (
<Paragraph>{c}</Paragraph>
))}
</PageBreakAvoid>
+7 -7
View File
@@ -56,45 +56,45 @@ const Skills: React.FC = () => {
{intl.formatMessage({
defaultMessage:
"Several years of experience developing, maintaining and adhering to the DevOps practices to streamline organization's processes across both backend and frontend development.",
id: "Skills.devops",
id: "BOZ+do",
})}
</Skill>
<Skill title="Front-End Development">
{intl.formatMessage({
defaultMessage:
"Extensive experience in frontend development spanning back to the early 2000s.",
id: "Skills.frontendDevelopment",
id: "AjT8sf",
})}
</Skill>
<Skill title="Back-End Development">
{intl.formatMessage({
defaultMessage:
"Deep knowledge of backend operations, mostly supporting web based applications using various technologies, programming languages and frameworks.",
id: "Skills.backendDevelopmentSum1",
id: "h4cHqQ",
})}
{intl.formatMessage({
defaultMessage:
"In recent years, the main focus was on Go to write tooling and backend services.",
id: "Skills.backendDevelopmentSum2",
id: "FxkFRP",
})}
</Skill>
<Skill title="Infrastructure operations">
{intl.formatMessage({
defaultMessage:
"Throughout my career, I have gained valuable experience in developing and maintaining high-load infrastructures over several years.",
id: "Skills.infrastructureOperations",
id: "YBTD7C",
})}
{intl.formatMessage({
defaultMessage:
"Following the OCI (Open Container Initiative) and leveraging Docker and Kubernetes to create highly available deployments, primarily on the AWS platform, was a challenging and enjoyable experience, that has greatly enhanced my skills in this area.",
id: "Skills.infrastructureOperationsAdditional",
id: "VRhCte",
})}
</Skill>
<Spacer withDivider />
<SubHeadline level={4}>
{intl.formatMessage({
defaultMessage: "Other notable skills",
id: "Skills.otherNotableSkills",
id: "8NqNwY",
})}
</SubHeadline>
<List>
+1 -2
View File
@@ -1,7 +1,6 @@
import React from "react";
import { Paragraph } from "../common/Text";
import { Caption } from "../common/Text";
import { Paragraph, Caption } from "../common/Text";
const Summary: React.FC = () => {
return (
@@ -1,22 +1,22 @@
import React from "react";
import React, { Component } from "react";
type ErrorHandler = (error: Error, info: React.ErrorInfo) => void;
type ErrorHandlingComponent<Props> = (
props: Props,
error?: Error
error?: Error,
) => React.ReactNode;
type ErrorState = { error?: Error };
function Catch<Props extends object>(
component: ErrorHandlingComponent<Props>,
errorHandler?: ErrorHandler
errorHandler?: ErrorHandler,
): React.ComponentType<Props> {
function Inner({ error, props }: { error?: Error; props: Props }) {
return <React.Fragment>{component(props, error)}</React.Fragment>;
}
return class CatchClass extends React.Component<Props, ErrorState> {
return class CatchClass extends Component<Props, ErrorState> {
state: ErrorState = {
error: undefined,
};
@@ -46,7 +46,7 @@ const divStyles: React.CSSProperties = {
const ErrorBoundary = Catch(function (
props: React.PropsWithChildren,
error?: Error
error?: Error,
) {
if (error) {
return (
@@ -78,7 +78,7 @@ const MainNavigation: React.FC = () => {
<NavigationHeadline>
{intl.formatMessage({
defaultMessage: "Contact",
id: "Navigation.contact",
id: "s3RWxF",
})}
</NavigationHeadline>
@@ -89,14 +89,14 @@ const MainNavigation: React.FC = () => {
<NavigationHeadline href="#objective">
{intl.formatMessage({
defaultMessage: "Objective",
id: "Navigation.objective",
id: "UMiSC4",
})}
</NavigationHeadline>
<NavigationHeadline href="#skills">
{intl.formatMessage({
defaultMessage: "Top Skills",
id: "Navigation.topSkills",
id: "JUWjX4",
})}
</NavigationHeadline>
@@ -119,7 +119,7 @@ const MainNavigation: React.FC = () => {
<NavigationHeadline>
{intl.formatMessage({
defaultMessage: "Certifications",
id: "Navigation.certifications",
id: "tl429z",
})}
</NavigationHeadline>
@@ -135,7 +135,7 @@ const MainNavigation: React.FC = () => {
<NavigationHeadline href="#experience">
{intl.formatMessage({
defaultMessage: "Experience",
id: "Navigation.experience",
id: "W1qv5r",
})}
</NavigationHeadline>
</StickyWrapper>
@@ -25,18 +25,18 @@ const Space = styled("div", { shouldForwardProp })<SpaceProps>(
({ spacing, theme }) => ({
width: "100%",
height: theme.spacing(spacing === undefined ? 1 : spacing),
})
}),
);
const Spacer: React.FC<SpacerProps> = (props) => {
const { spacing, withDivider } = props;
if (!withDivider) {
const spaceSize = typeof spacing === undefined ? 2 : spacing;
const spaceSize = spacing === undefined ? 2 : spacing;
return <Space spacing={spaceSize} />;
}
const spaceSize = typeof spacing === undefined ? 1 : spacing;
const spaceSize = spacing === undefined ? 1 : spacing;
return (
<Root>
+9 -3
View File
@@ -28,15 +28,21 @@ export const BUILD_TIMESTAMP: Date = window.APP_CONFIG?.commitTime
export const CONTACT_EMAIL = confString(
window.APP_CONFIG?.contactEmail,
import.meta.env.VITE_CONTACT_EMAIL || ""
typeof import.meta.env.VITE_CONTACT_EMAIL === "string"
? import.meta.env.VITE_CONTACT_EMAIL
: "",
);
export const CONTACT_PHONE = confString(
window.APP_CONFIG?.contactPhone,
import.meta.env.VITE_CONTACT_PHONE || ""
typeof import.meta.env.VITE_CONTACT_PHONE === "string"
? import.meta.env.VITE_CONTACT_PHONE
: "",
);
export const POSITION = confString(
window.APP_CONFIG?.position,
import.meta.env.VITE_POSITION || ""
typeof import.meta.env.VITE_POSITION === "string"
? import.meta.env.VITE_POSITION
: "",
);
+3 -3
View File
@@ -1,10 +1,10 @@
import React from "react";
import ReactDOM from "react-dom/client";
import { createRoot } from "react-dom/client";
import App from "./App";
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<App />
</React.StrictMode>
</React.StrictMode>,
);
+3 -3
View File
@@ -28,7 +28,7 @@ const Dashboard: React.FC = () => {
<SubHeadline level={4}>
{intl.formatMessage({
defaultMessage: "Central Bohemia, Czechia",
id: "Dashboard.location",
id: "Lkk994",
})}
</SubHeadline>
@@ -49,7 +49,7 @@ const Dashboard: React.FC = () => {
<Headline level={2}>
{intl.formatMessage({
defaultMessage: "Skills",
id: "Dashboard.skillsTitle",
id: "4JISx9",
})}
</Headline>
<Spacer />
@@ -63,7 +63,7 @@ const Dashboard: React.FC = () => {
<Headline level={2}>
{intl.formatMessage({
defaultMessage: "Experience",
id: "Dashboard.experienceTitle",
id: "W1qv5r",
})}
</Headline>
<Spacer />
+1 -1
View File
@@ -21,7 +21,7 @@ const NotFound = () => {
<p>
{intl.formatMessage({
defaultMessage: "Nothing to see here",
id: "Router.NotFound",
id: "ywIjM0",
})}
</p>
<Link to="/">Go home</Link>
+3 -4
View File
@@ -1,6 +1,5 @@
import React from "react";
import { Outlet, RouterProvider } from "react-router-dom";
import { createBrowserRouter } from "react-router-dom";
import React, { lazy } from "react";
import { Outlet, RouterProvider, createBrowserRouter } from "react-router-dom";
import { ErrorBoundary } from "../components/ErrorBoundary";
import Dashboard from "./Dashboard";
@@ -13,7 +12,7 @@ const Layout: React.FC = () => {
);
};
const NotFound = React.lazy(() => import("./NotFound"));
const NotFound = lazy(() => import("./NotFound"));
const router = createBrowserRouter([
{