Skip to content

Commit

Permalink
Merge pull request #10 from riitasointi/linter-rules
Browse files Browse the repository at this point in the history
Remove unused variables
  • Loading branch information
jenkrisu authored Mar 21, 2023
2 parents b876eee + 7e42280 commit 57a4f33
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 66 deletions.
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
],
"plugins": ["@typescript-eslint", "prettier"],
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unnecessary-type-constraint": "off",
"@typescript-eslint/ban-types": ["off", { "types": ["{}", "object"] }],
Expand Down
3 changes: 0 additions & 3 deletions components/ComponentExample/ComponentExample.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import MobileDevice from '../MobileDevice/MobileDevice';
import ShowcaseBox from '../ShowcaseBox/ShowcaseBox';
import React from 'react';
import ComponentCode from './ComponentCode';
import styles from './ComponentExample.module.scss';

type ComponentExampleVariant = 'normal' | 'mobile_device';

Expand All @@ -18,7 +17,6 @@ interface ComponentExampleProps {
children?: ReactNode;
codeString?: string;
style?: CSSProperties;
noCode?: boolean;
}

const getWithoutWrappers = (children: any): ReactNode[] =>
Expand All @@ -36,7 +34,6 @@ const ComponentExample: React.FunctionComponent<ComponentExampleProps> = ({
filterPropsInExample,
codeString,
style,
noCode,
}) => {
const showcase =
variant === 'mobile_device' ? (
Expand Down
1 change: 0 additions & 1 deletion components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
Link as SuomifiLink,
Text,
} from 'suomifi-ui-components';
import GitHubLogo from '../../assets/icons/github.svg';
import styles from './Footer.module.scss';

const Footer: React.FunctionComponent = () => {
Expand Down
4 changes: 1 addition & 3 deletions components/SpacingShowcase/SpacingShowcase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export const cssValueToString = (cssValue: number | string | ValueUnit) => {
return typeof cssValue === 'number' ? cssValue.toString(10) : cssValue;
};

const Container = styled(({ size, name, ...passProps }) => (
<div {...passProps} />
))(
const Container = styled(({ ...passProps }) => <div {...passProps} />)(
({ size }) => `
min-height: calc(${size} + 2em);
max-width: 420px;
Expand Down
2 changes: 0 additions & 2 deletions layouts/InfopageLayout/InfopageLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useTranslation } from 'next-export-i18n';
import { ReactNode } from 'react';
import { Block } from 'suomifi-ui-components';
import styles from './InfopageLayout.module.scss';
Expand All @@ -10,7 +9,6 @@ interface InfopageLayoutProps {
const InfopageLayout: React.FunctionComponent<InfopageLayoutProps> = ({
children,
}: InfopageLayoutProps) => {
const { t } = useTranslation();
return (
<>
<Block className="container">
Expand Down
2 changes: 0 additions & 2 deletions layouts/PlainLayout/PlainLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useTranslation } from 'next-export-i18n';
import { ReactNode } from 'react';
import { Block } from 'suomifi-ui-components';

Expand All @@ -9,7 +8,6 @@ interface PlainLayoutProps {
const PlainLayout: React.FunctionComponent<PlainLayoutProps> = ({
children,
}: PlainLayoutProps) => {
const { t } = useTranslation();
return (
<>
<Block className="container">
Expand Down
5 changes: 0 additions & 5 deletions pages/components/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ const ButtonPage: NextPage = () => {
</Paragraph>

<ComponentExample
noCode
style={{
padding: defaultSuomifiTheme.spacing.m,
marginBottom: defaultSuomifiTheme.spacing.s,
Expand All @@ -265,7 +264,6 @@ const ButtonPage: NextPage = () => {
</Block>
</ComponentExample>
<ComponentExample
noCode
style={{
padding: defaultSuomifiTheme.spacing.m,
marginBottom: defaultSuomifiTheme.spacing.s,
Expand Down Expand Up @@ -295,7 +293,6 @@ const ButtonPage: NextPage = () => {
</Block>
</ComponentExample>
<ComponentExample
noCode
style={{
padding: defaultSuomifiTheme.spacing.m,
marginBottom: defaultSuomifiTheme.spacing.s,
Expand Down Expand Up @@ -325,7 +322,6 @@ const ButtonPage: NextPage = () => {
</Block>
</ComponentExample>
<ComponentExample
noCode
style={{
padding: defaultSuomifiTheme.spacing.m,
marginBottom: defaultSuomifiTheme.spacing.s,
Expand Down Expand Up @@ -359,7 +355,6 @@ const ButtonPage: NextPage = () => {
</Block>
</ComponentExample>
<ComponentExample
noCode
style={{
padding: defaultSuomifiTheme.spacing.m,
background: defaultSuomifiTheme.colors.whiteBase,
Expand Down
15 changes: 3 additions & 12 deletions pages/components/loadingspinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ const Page: NextPage = () => {
);
};

const BasicExample = ({
...passProps
}: Partial<LoadingSpinnerProps>): JSX.Element => {
const BasicExample = ({}: Partial<LoadingSpinnerProps>): JSX.Element => {
const { t } = useTranslation();
const [visible, setVisible] = useState(false);
const [status, setStatus] = useState<LoadingSpinnerStatus>('loading');
Expand All @@ -175,7 +173,6 @@ const BasicExample = ({

return (
<ComponentExample
noCode
style={{
marginBottom: defaultSuomifiTheme.spacing.s,
display: 'flex',
Expand Down Expand Up @@ -224,9 +221,7 @@ const BasicExample = ({
);
};

const SuccessExample = ({
...passProps
}: Partial<LoadingSpinnerProps>): JSX.Element => {
const SuccessExample = ({}: Partial<LoadingSpinnerProps>): JSX.Element => {
const { t } = useTranslation();
const [visible, setVisible] = useState(false);
const [status, setStatus] = useState<LoadingSpinnerStatus>('failed');
Expand All @@ -247,7 +242,6 @@ const SuccessExample = ({

return (
<ComponentExample
noCode
style={{
marginBottom: defaultSuomifiTheme.spacing.s,
display: 'flex',
Expand Down Expand Up @@ -299,9 +293,7 @@ const SuccessExample = ({
);
};

const FailingExample = ({
...passProps
}: Partial<LoadingSpinnerProps>): JSX.Element => {
const FailingExample = ({}: Partial<LoadingSpinnerProps>): JSX.Element => {
const { t } = useTranslation();
const [visible, setVisible] = useState(false);
const [status, setStatus] = useState<LoadingSpinnerStatus>('success');
Expand All @@ -322,7 +314,6 @@ const FailingExample = ({

return (
<ComponentExample
noCode
style={{
marginBottom: defaultSuomifiTheme.spacing.s,
display: 'flex',
Expand Down
15 changes: 3 additions & 12 deletions pages/components/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const Page: NextPage = () => {
</Paragraph>

<Block variant="section">
<ConfirmExample title="" desc="" noCode />
<ConfirmExample />
</Block>

<Block variant="section" className="my-xl">
Expand Down Expand Up @@ -99,7 +99,7 @@ const Page: NextPage = () => {
</Paragraph>
</Block>

<ConfirmExample title="" desc="" noCode={false} />
<ConfirmExample />

<Block variant="section">
<Heading variant="h2" className="my-xl">
Expand Down Expand Up @@ -268,16 +268,7 @@ const DefaultExample = ({ ...passProps }: Partial<ModalProps>): JSX.Element => {
);
};

const ConfirmExample = ({
title,
desc,
noCode,
...passProps
}: Partial<ModalProps> & {
title: string;
desc: string;
noCode: boolean;
}): JSX.Element => {
const ConfirmExample = ({ ...passProps }: Partial<ModalProps>): JSX.Element => {
const { t } = useTranslation();
const [visible, setVisible] = useState(false);
return (
Expand Down
1 change: 0 additions & 1 deletion pages/components/multiselect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import SideNavLayout from '../../layouts/SideNavLayout/SideNavLayout';
import { navItems } from '../../utils/components-sidenav';
import InfoBox from '../../components/InfoBox/InfoBox';
import ComponentExample from '../../components/ComponentExample/ComponentExample';
import { useState } from 'react';
import {
Block,
Heading,
Expand Down
1 change: 0 additions & 1 deletion pages/components/notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import SideNavLayout from '../../layouts/SideNavLayout/SideNavLayout';
import { navItems } from '../../utils/components-sidenav';
import InfoBox from '../../components/InfoBox/InfoBox';
import ComponentExample from '../../components/ComponentExample/ComponentExample';
import { useState } from 'react';
import {
Block,
Heading,
Expand Down
16 changes: 4 additions & 12 deletions pages/components/pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ const Page: NextPage = () => {
);
};

const FirstExample = ({
...passProps
}: Partial<PaginationProps> & {}): JSX.Element => {
const FirstExample = ({}: Partial<PaginationProps> & {}): JSX.Element => {
const [current, setCurrent] = useState(2);
const lastPage = 8;

Expand Down Expand Up @@ -161,9 +159,7 @@ const FirstExample = ({
);
};

const BasicExample = ({
...passProps
}: Partial<PaginationProps> & {}): JSX.Element => {
const BasicExample = ({}: Partial<PaginationProps> & {}): JSX.Element => {
const arrLength = 100;
const step = 5;

Expand Down Expand Up @@ -231,9 +227,7 @@ const BasicExample = ({
);
};

const SuccessExample = ({
...passProps
}: Partial<PaginationProps> & {}): JSX.Element => {
const SuccessExample = ({}: Partial<PaginationProps> & {}): JSX.Element => {
const [current, setCurrent] = useState(2);
const lastPage = 8;

Expand Down Expand Up @@ -269,9 +263,7 @@ const SuccessExample = ({
);
};

const FailingExample = ({
...passProps
}: Partial<PaginationProps> & {}): JSX.Element => {
const FailingExample = ({}: Partial<PaginationProps> & {}): JSX.Element => {
const [current, setCurrent] = useState(2);
const lastPage = 8;

Expand Down
2 changes: 0 additions & 2 deletions pages/components/radiobutton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
Text,
Paragraph,
ExternalLink,
Link as ExampleLink,
ExternalLink as ExampleExternalLink,
defaultSuomifiTheme,
RadioButton,
RadioButtonGroup,
Expand Down
2 changes: 0 additions & 2 deletions pages/components/servicenavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
Text,
Paragraph,
ExternalLink,
Link as ExampleLink,
ExternalLink as ExampleExternalLink,
ServiceNavigation,
ServiceNavigationItem,
RouterLink,
Expand Down
2 changes: 0 additions & 2 deletions pages/components/sidenavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
Text,
Paragraph,
ExternalLink,
Link as ExampleLink,
ExternalLink as ExampleExternalLink,
SideNavigation,
SideNavigationItem,
RouterLink,
Expand Down
3 changes: 0 additions & 3 deletions pages/components/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ import Head from 'next/head';
import { useTranslation } from 'next-export-i18n';
import SideNavLayout from '../../layouts/SideNavLayout/SideNavLayout';
import { navItems } from '../../utils/components-sidenav';
import InfoBox from '../../components/InfoBox/InfoBox';
import ComponentExample from '../../components/ComponentExample/ComponentExample';
import {
Block,
Heading,
Text,
Paragraph,
ExternalLink,
Link as ExampleLink,
ExternalLink as ExampleExternalLink,
} from 'suomifi-ui-components';

const Page: NextPage = () => {
Expand Down
2 changes: 0 additions & 2 deletions pages/patterns/multi-insert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import {
Text,
Paragraph,
Block,
RouterLink,
ExternalLink,
} from 'suomifi-ui-components';
import SideNavLayout from '../../layouts/SideNavLayout/SideNavLayout';
import { navItems } from '../../utils/patterns-sidenav';
import InfoBox from '../../components/InfoBox/InfoBox';
import Link from 'next/link';
import { MultiInsert } from '../../components/MultiInsert/MultiInsert';

const MultiInsertPage: NextPage = () => {
Expand Down

0 comments on commit 57a4f33

Please sign in to comment.