1
0
mirror of https://github.com/SomboChea/ui synced 2024-11-24 15:04:27 +07:00

fix: @typescript-eslint/explicit-member-accessibility

This commit is contained in:
Griffithtp 2019-06-24 22:03:21 +01:00
parent e33570b3f0
commit 55f50e9f4d
4 changed files with 21 additions and 20 deletions

View File

@ -13,11 +13,11 @@ interface Props {
} }
class Developers extends Component<Props, any> { class Developers extends Component<Props, any> {
state = { public state = {
visibleDevs: 6, visibleDevs: 6,
}; };
render() { public render() {
return ( return (
<DetailContextConsumer> <DetailContextConsumer>
{({ packageMeta }: any) => { {({ packageMeta }: any) => {
@ -30,11 +30,11 @@ class Developers extends Component<Props, any> {
); );
} }
handleLoadMore = () => { public handleLoadMore = () => {
this.setState(prev => ({ visibleDevs: prev.visibleDevs + 6 })); this.setState(prev => ({ visibleDevs: prev.visibleDevs + 6 }));
}; };
renderDevelopers = (developers, packageMeta) => { private renderDevelopers = (developers, packageMeta) => {
const { type } = this.props; const { type } = this.props;
const { visibleDevs } = this.state; const { visibleDevs } = this.state;
return ( return (
@ -54,7 +54,7 @@ class Developers extends Component<Props, any> {
); );
}; };
renderLinkForMail(email, avatarComponent, packageName, version) { private renderLinkForMail(email, avatarComponent, packageName, version) {
if (!email || isEmail(email) === false) { if (!email || isEmail(email) === false) {
return avatarComponent; return avatarComponent;
} }
@ -65,7 +65,7 @@ class Developers extends Component<Props, any> {
); );
} }
renderDeveloperDetails = ({ name, avatar, email }, packageMeta) => { private renderDeveloperDetails = ({ name, avatar, email }, packageMeta) => {
const { name: packageName, version } = packageMeta.latest; const { name: packageName, version } = packageMeta.latest;
const avatarComponent = <Avatar aria-label={name} src={avatar} />; const avatarComponent = <Avatar aria-label={name} src={avatar} />;

View File

@ -7,7 +7,7 @@ import { Heading, DistListItem, DistChips } from './styles';
import fileSizeSI from '../../utils/file-size'; import fileSizeSI from '../../utils/file-size';
class Dist extends Component<any, any> { class Dist extends Component<any, any> {
render() { public render() {
return ( return (
<DetailContextConsumer> <DetailContextConsumer>
{(context: any) => { {(context: any) => {
@ -17,7 +17,7 @@ class Dist extends Component<any, any> {
); );
} }
renderChips(dist: any, license: string) { private renderChips(dist: any, license: string) {
const distDict = { const distDict = {
'file-count': dist.fileCount, 'file-count': dist.fileCount,
size: dist.unpackedSize && fileSizeSI(dist.unpackedSize), size: dist.unpackedSize && fileSizeSI(dist.unpackedSize),
@ -43,7 +43,7 @@ class Dist extends Component<any, any> {
return chipsList; return chipsList;
} }
renderDist = ({ packageMeta }: any) => { private renderDist = ({ packageMeta }: any) => {
const { dist = {}, license } = packageMeta.latest; const { dist = {}, license } = packageMeta.latest;
return ( return (

View File

@ -22,15 +22,15 @@ function TabContainer({ children }) {
} }
class RegistryInfoContent extends Component<Props, State> { class RegistryInfoContent extends Component<Props, State> {
state = { public state = {
tabPosition: 0, tabPosition: 0,
}; };
render() { public render() {
return <div>{this.renderTabs()}</div>; return <div>{this.renderTabs()}</div>;
} }
renderTabs() { private renderTabs() {
const { scope, registryUrl } = this.props; const { scope, registryUrl } = this.props;
const { tabPosition } = this.state; const { tabPosition } = this.state;
@ -48,7 +48,7 @@ class RegistryInfoContent extends Component<Props, State> {
); );
} }
renderNpmTab(scope: string, registryUrl: string) { private renderNpmTab(scope: string, registryUrl: string) {
return ( return (
<React.Fragment> <React.Fragment>
<CopyToClipBoard text={getCLISetConfigRegistry(`${NODE_MANAGER.npm} set`, scope, registryUrl)} /> <CopyToClipBoard text={getCLISetConfigRegistry(`${NODE_MANAGER.npm} set`, scope, registryUrl)} />
@ -58,7 +58,7 @@ class RegistryInfoContent extends Component<Props, State> {
); );
} }
renderPNpmTab(scope: string, registryUrl: string) { private renderPNpmTab(scope: string, registryUrl: string) {
return ( return (
<React.Fragment> <React.Fragment>
<CopyToClipBoard text={getCLISetConfigRegistry(`${NODE_MANAGER.pnpm} set`, scope, registryUrl)} /> <CopyToClipBoard text={getCLISetConfigRegistry(`${NODE_MANAGER.pnpm} set`, scope, registryUrl)} />
@ -68,7 +68,7 @@ class RegistryInfoContent extends Component<Props, State> {
); );
} }
renderYarnTab(scope: string, registryUrl: string) { private renderYarnTab(scope: string, registryUrl: string) {
return ( return (
<React.Fragment> <React.Fragment>
<CopyToClipBoard text={getCLISetConfigRegistry(`${NODE_MANAGER.yarn} config set`, scope, registryUrl)} /> <CopyToClipBoard text={getCLISetConfigRegistry(`${NODE_MANAGER.yarn} config set`, scope, registryUrl)} />
@ -76,7 +76,7 @@ class RegistryInfoContent extends Component<Props, State> {
); );
} }
handleChange = (event: any, tabPosition: number) => { private handleChange = (event: any, tabPosition: number) => {
event.preventDefault(); event.preventDefault();
this.setState({ tabPosition }); this.setState({ tabPosition });
}; };

View File

@ -2,10 +2,10 @@ import React from 'react';
export function asyncComponent(getComponent) { export function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component { return class AsyncComponent extends React.Component {
static Component = null; public static Component = null;
state = { Component: AsyncComponent.Component }; public state = { Component: AsyncComponent.Component };
componentDidMount() { public componentDidMount() {
const { Component } = this.state; const { Component } = this.state;
if (!Component) { if (!Component) {
getComponent() getComponent()
@ -19,7 +19,8 @@ export function asyncComponent(getComponent) {
}); });
} }
} }
render() {
public render() {
const { Component } = this.state; const { Component } = this.state;
if (Component) { if (Component) {
// eslint-disable-next-line verdaccio/jsx-spread // eslint-disable-next-line verdaccio/jsx-spread