1
0
mirror of https://github.com/SomboChea/ui synced 2024-12-01 02:14:27 +07:00

fix: linter error fixed (#143)

This commit is contained in:
Gagan Deep 2019-10-03 01:22:27 +05:30 committed by Juan Picado @jotadeveloper
parent cf050f234d
commit 74576bda12
5 changed files with 17 additions and 17 deletions

View File

@ -16,11 +16,11 @@ export default class ErrorBoundary extends Component<ErrorProps, ErrorAppState>
this.state = { hasError: false, error: null, info: null }; this.state = { hasError: false, error: null, info: null };
} }
componentDidCatch(error, info) { public componentDidCatch(error, info) {
this.setState({ hasError: true, error, info }); this.setState({ hasError: true, error, info });
} }
render() { public render(): JSX.Element {
const { hasError, error, info } = this.state; const { hasError, error, info } = this.state;
const { children } = this.props; const { children } = this.props;

View File

@ -16,7 +16,7 @@ import { DetailContext } from '../../pages/Version';
import { TitleListItem, TitleListItemText } from './styles'; import { TitleListItem, TitleListItemText } from './styles';
const renderLatestDescription = (description, version, isLatest: boolean = true) => { const renderLatestDescription = (description, version, isLatest: boolean = true): JSX.Element => {
return ( return (
<span> <span>
<div>{description}</div> <div>{description}</div>
@ -25,15 +25,15 @@ const renderLatestDescription = (description, version, isLatest: boolean = true)
); );
}; };
const renderCopyCLI = () => <Install />; const renderCopyCLI = (): JSX.Element => <Install />;
const renderMaintainers = () => <Developers type="maintainers" />; const renderMaintainers = (): JSX.Element => <Developers type="maintainers" />;
const renderContributors = () => <Developers type="contributors" />; const renderContributors = (): JSX.Element => <Developers type="contributors" />;
const renderRepository = () => <Repository />; const renderRepository = (): JSX.Element => <Repository />;
const renderAuthor = () => <Author />; const renderAuthor = (): JSX.Element => <Author />;
const renderEngine = () => <Engine />; const renderEngine = (): JSX.Element => <Engine />;
const renderDist = () => <Dist />; const renderDist = (): JSX.Element => <Dist />;
const renderActionBar = () => <ActionBar />; const renderActionBar = (): JSX.Element => <ActionBar />;
const renderTitle = (packageName, packageVersion, packageMeta) => { const renderTitle = (packageName, packageVersion, packageMeta): JSX.Element => {
const version = packageVersion ? packageVersion : packageMeta.latest.version; const version = packageVersion ? packageVersion : packageMeta.latest.version;
const isLatest = typeof packageVersion === 'undefined'; const isLatest = typeof packageVersion === 'undefined';
@ -66,7 +66,7 @@ function renderSideBar(packageName, packageVersion, packageMeta): ReactElement<H
); );
} }
const DetailSidebar = () => { const DetailSidebar = (): JSX.Element => {
const { packageName, packageMeta, packageVersion } = React.useContext(DetailContext); const { packageName, packageMeta, packageVersion } = React.useContext(DetailContext);
return renderSideBar(packageName, packageVersion, packageMeta); return renderSideBar(packageName, packageVersion, packageMeta);

View File

@ -22,13 +22,13 @@ const Developers: FC<Props> = ({ type, visibleMax }) => {
setVisibleDevs(visibleDevs + VISIBLE_MAX); setVisibleDevs(visibleDevs + VISIBLE_MAX);
}; };
const renderDeveloperDetails = ({ name, avatar, email }, packageMeta) => { const renderDeveloperDetails = ({ name, avatar, email }, packageMeta): JSX.Element => {
const { name: packageName, version } = packageMeta.latest; const { name: packageName, version } = packageMeta.latest;
return <AvatarTooltip avatar={avatar} email={email} name={name} packageName={packageName} version={version} />; return <AvatarTooltip avatar={avatar} email={email} name={name} packageName={packageName} version={version} />;
}; };
const renderDevelopers = (developers, packageMeta) => { const renderDevelopers = (developers, packageMeta): JSX.Element => {
const listVisibleDevelopers = developers.slice(0, visibleDevs); const listVisibleDevelopers = developers.slice(0, visibleDevs);
return ( return (

View File

@ -19,7 +19,7 @@ export function getRouterPackageName(params): string {
return packageName; return packageName;
} }
function fillTitle(text) { function fillTitle(text): string {
return `Verdaccio - ${text}`; return `Verdaccio - ${text}`;
} }

View File

@ -56,7 +56,7 @@ export function formatDateDistance(lastUpdate): string {
return distanceInWordsToNow(new Date(lastUpdate)); return distanceInWordsToNow(new Date(lastUpdate));
} }
export function buildScopePackage(scope: string, packageName: string) { export function buildScopePackage(scope: string, packageName: string): string {
return `@${scope}/${packageName}`; return `@${scope}/${packageName}`;
} }