Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Commit

Permalink
fix: @typescript-eslint/no-explicit-any
Browse files Browse the repository at this point in the history
  • Loading branch information
griffithtp committed Jun 25, 2019
1 parent 7cab3f2 commit 6eec4f4
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
6 changes: 4 additions & 2 deletions src/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ export const AppContext = React.createContext<{}>({});
export const AppContextProvider = AppContext.Provider;
export const AppContextConsumer = AppContext.Consumer;

interface AppStateInterface {
export interface AppStateInterface {
error?: FormError;
logoUrl: string;
user: {};
user: {
username?: string;
};
scope: string;
showLoginModal: boolean;
isUserLoggedIn: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RegistryInfoContent from '../RegistryInfoContent/RegistryInfoContent';
import { Greetings, NavBar, InnerNavBar, MobileNavBar, InnerMobileNavBar, LeftSide, RightSide, IconSearchButton, SearchWrapper } from './styles';

interface Props {
logo: string;
logo?: string;
username?: string;
onLogout: () => void;
onToggleLoginModal: () => void;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface Props {
size?: Breakpoint;
pointer?: boolean;
img?: boolean;
// modifiers?: null | undefined;
modifiers?: null | undefined;
}

const Icon: React.FC<Props> = ({ className, name, size = 'sm', img = false, pointer = false, ...props }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Icon/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export const Svg = styled('svg')`
export const ImgWrapper: StyledOtherComponent<
{
size?: Breakpoint;
pointer: any;
modifiers?: any;
pointer: boolean;
modifiers?: null | undefined;
name?: string | unknown;
},
DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Label/Label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Props {
text: string;
capitalize?: boolean;
weight?: string;
modifiers?: any;
modifiers?: null | undefined;
}

const Wrapper = styled('div')`
Expand Down
2 changes: 1 addition & 1 deletion src/components/Versions/Versions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Versions extends React.PureComponent {
);
}

public renderPackageList = (packages: any, isVersion: boolean = false, timeMap: Record<string, any> = {}): ReactElement<HTMLDivElement> => {
public renderPackageList = (packages: {}, isVersion: boolean = false, timeMap: Record<string, {}> = {}): ReactElement<HTMLDivElement> => {
return (
<List>
{Object.keys(packages)
Expand Down
12 changes: 6 additions & 6 deletions src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React, { Component, ReactElement } from 'react';
import { Router, Route, Switch } from 'react-router-dom';
import { AppContextConsumer } from './App/App';
import { AppContextConsumer, AppStateInterface } from './App/App';

import { asyncComponent } from './utils/asyncComponent';
import history from './history';
Expand Down Expand Up @@ -39,8 +39,8 @@ class RouterApp extends Component<RouterAppProps> {

return (
<AppContextConsumer>
{function renderConsumerVersionPage({ logoUrl, scope, user }: any) {
return <Header logo={logoUrl} onLogout={onLogout} onToggleLoginModal={onToggleLoginModal} scope={scope} username={user.username} />;
{function renderConsumerVersionPage({ logoUrl, scope = '', user }: Partial<AppStateInterface>) {
return <Header logo={logoUrl} onLogout={onLogout} onToggleLoginModal={onToggleLoginModal} scope={scope} username={user && user.username} />;
}}
</AppContextConsumer>
);
Expand All @@ -49,18 +49,18 @@ class RouterApp extends Component<RouterAppProps> {
public renderHomePage = (): ReactElement<HTMLDivElement> => {
return (
<AppContextConsumer>
{function renderConsumerVersionPage({ isUserLoggedIn, packages }: any) {
{function renderConsumerVersionPage({ isUserLoggedIn, packages }: Partial<AppStateInterface>) {
// @ts-ignore
return <HomePage isUserLoggedIn={isUserLoggedIn} packages={packages} />;
}}
</AppContextConsumer>
);
};

public renderVersionPage = (routerProps: any): ReactElement<HTMLDivElement> => {
public renderVersionPage = (routerProps): ReactElement<HTMLDivElement> => {
return (
<AppContextConsumer>
{function renderConsumerVersionPage({ isUserLoggedIn }: any) {
{function renderConsumerVersionPage({ isUserLoggedIn }: Partial<AppStateInterface>) {
return <VersionPackage {...routerProps} isUserLoggedIn={isUserLoggedIn} />;
}}
</AppContextConsumer>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/cli-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SyntheticEvent } from 'react';

export const copyToClipBoardUtility = (str: string): any => (event: SyntheticEvent<HTMLElement>): void => {
export const copyToClipBoardUtility = (str: string): ((e: SyntheticEvent<HTMLElement>) => void) => (event: SyntheticEvent<HTMLElement>): void => {
event.preventDefault();

const node = document.createElement('div');
Expand Down

0 comments on commit 6eec4f4

Please sign in to comment.