mirror of
https://github.com/SomboChea/ui
synced 2024-12-28 23:24:26 +07:00
fix: linter error fixed (#143)
This commit is contained in:
parent
cf050f234d
commit
74576bda12
@ -16,11 +16,11 @@ export default class ErrorBoundary extends Component<ErrorProps, ErrorAppState>
|
||||
this.state = { hasError: false, error: null, info: null };
|
||||
}
|
||||
|
||||
componentDidCatch(error, info) {
|
||||
public componentDidCatch(error, info) {
|
||||
this.setState({ hasError: true, error, info });
|
||||
}
|
||||
|
||||
render() {
|
||||
public render(): JSX.Element {
|
||||
const { hasError, error, info } = this.state;
|
||||
const { children } = this.props;
|
||||
|
||||
|
@ -16,7 +16,7 @@ import { DetailContext } from '../../pages/Version';
|
||||
|
||||
import { TitleListItem, TitleListItemText } from './styles';
|
||||
|
||||
const renderLatestDescription = (description, version, isLatest: boolean = true) => {
|
||||
const renderLatestDescription = (description, version, isLatest: boolean = true): JSX.Element => {
|
||||
return (
|
||||
<span>
|
||||
<div>{description}</div>
|
||||
@ -25,15 +25,15 @@ const renderLatestDescription = (description, version, isLatest: boolean = true)
|
||||
);
|
||||
};
|
||||
|
||||
const renderCopyCLI = () => <Install />;
|
||||
const renderMaintainers = () => <Developers type="maintainers" />;
|
||||
const renderContributors = () => <Developers type="contributors" />;
|
||||
const renderRepository = () => <Repository />;
|
||||
const renderAuthor = () => <Author />;
|
||||
const renderEngine = () => <Engine />;
|
||||
const renderDist = () => <Dist />;
|
||||
const renderActionBar = () => <ActionBar />;
|
||||
const renderTitle = (packageName, packageVersion, packageMeta) => {
|
||||
const renderCopyCLI = (): JSX.Element => <Install />;
|
||||
const renderMaintainers = (): JSX.Element => <Developers type="maintainers" />;
|
||||
const renderContributors = (): JSX.Element => <Developers type="contributors" />;
|
||||
const renderRepository = (): JSX.Element => <Repository />;
|
||||
const renderAuthor = (): JSX.Element => <Author />;
|
||||
const renderEngine = (): JSX.Element => <Engine />;
|
||||
const renderDist = (): JSX.Element => <Dist />;
|
||||
const renderActionBar = (): JSX.Element => <ActionBar />;
|
||||
const renderTitle = (packageName, packageVersion, packageMeta): JSX.Element => {
|
||||
const version = packageVersion ? packageVersion : packageMeta.latest.version;
|
||||
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);
|
||||
|
||||
return renderSideBar(packageName, packageVersion, packageMeta);
|
||||
|
@ -22,13 +22,13 @@ const Developers: FC<Props> = ({ type, visibleMax }) => {
|
||||
setVisibleDevs(visibleDevs + VISIBLE_MAX);
|
||||
};
|
||||
|
||||
const renderDeveloperDetails = ({ name, avatar, email }, packageMeta) => {
|
||||
const renderDeveloperDetails = ({ name, avatar, email }, packageMeta): JSX.Element => {
|
||||
const { name: packageName, version } = packageMeta.latest;
|
||||
|
||||
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);
|
||||
|
||||
return (
|
||||
|
@ -19,7 +19,7 @@ export function getRouterPackageName(params): string {
|
||||
return packageName;
|
||||
}
|
||||
|
||||
function fillTitle(text) {
|
||||
function fillTitle(text): string {
|
||||
return `Verdaccio - ${text}`;
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ export function formatDateDistance(lastUpdate): string {
|
||||
return distanceInWordsToNow(new Date(lastUpdate));
|
||||
}
|
||||
|
||||
export function buildScopePackage(scope: string, packageName: string) {
|
||||
export function buildScopePackage(scope: string, packageName: string): string {
|
||||
return `@${scope}/${packageName}`;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user