Skip to content

Commit 4933a75

Browse files
author
Tiko
committed
fiexed eslint any types
1 parent 21f8ed7 commit 4933a75

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

src/containers/NewsletterSubscribe/NewsletterSubscribe.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ const NewsletterSubscribe: React.FC<NewsletterSubscribeProps> = ({
3535
const [name, setName] = useState('');
3636
const [email, setEmail] = useState('');
3737

38-
const stateChanger = (setter: any) => (e: any) => setter(e.target.value);
38+
const stateChanger = (
39+
setter: React.Dispatch<React.SetStateAction<string>>,
40+
) => (e: React.ChangeEvent<HTMLInputElement>) => setter(e.target.value);
3941
const canSubmit = name !== '' && email !== '';
4042

4143
return (

src/lib/Socials.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type Social =
2020
| 'link'
2121
| 'github';
2222

23-
export const getMinifiedSocial = (social: Social) => {
23+
export const getMinifiedSocial = (social: Social): string => {
2424
const socialHtml = socialIcons[social];
2525
const twoOrMoreWhitespaceRegex = /\s{2,}/g;
2626
const minifiedHtml = socialHtml.replace(twoOrMoreWhitespaceRegex, ' ');

src/lib/calcHeaderSizes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const calcHeaderSize = (scale: number, baseSize: number) => {
1+
const calcHeaderSize = (scale: number, baseSize: number): string => {
22
const elements = ['h6', 'h5', 'h4', 'h3', 'h2', 'h1'];
33
const rawCSSArr = elements.map((element, count) => {
44
const multiplier = baseSize * scale ** count;

src/pages/partners.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const CheckListItem: React.FC<CheckListItemProps> = ({ children }) => {
7777
);
7878
};
7979

80-
const Partners = () => (
80+
const Partners: React.FC<Record<string, never>> = () => (
8181
<Layout pageSettings={pageSettings}>
8282
<ContentPageHeader
8383
useGatsbyLink

src/styles/theme.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/* eslint-disable no-unused-vars, @typescript-eslint/no-unused-vars */
22

33
// Colors
4+
import React from 'react';
5+
46
const black = '#0f0f0f';
57
const darkgray = '#1a1a1a';
68
const green = '#23be87';
@@ -29,15 +31,17 @@ const GlobalHeadingSettings = {
2931
weight: bold,
3032
marginBottom: '0.66em',
3133
};
34+
35+
// TODO: add typing to theme interface, for now they will accept any object (Record<string, unknown>)
3236
interface Bytecode {
33-
colors: any;
34-
fonts: any;
35-
fontWeights: any;
36-
typography: any;
37-
breakpoint: any;
38-
containerWidth: any;
39-
breakpointMobileMenu: any;
40-
mediaQueryMin: any | null;
37+
colors: Record<string, unknown>;
38+
fonts: Record<string, unknown>;
39+
fontWeights: Record<string, unknown>;
40+
typography: Record<string, unknown>;
41+
breakpoint: Record<string, unknown>;
42+
containerWidth: Record<string, unknown>;
43+
breakpointMobileMenu: string;
44+
mediaQueryMin: Record<string, unknown> | null;
4145
}
4246
// Bytecode theme
4347
const bytecode: Bytecode = {

0 commit comments

Comments
 (0)