Improve ESLint rules for JSX (#3608)
* Add react/no-string-refs ESLint rule * Add react/jsx-boolean-value ESLint rule * Add react/jsx-closing-bracket-location ESLint rule * Add react/jsx-indent ESLint rule * Add react/jsx-curly-spacing ESLint rule * Add react/jsx-equals-spacing ESLint rule * Add react/jsx-first-prop-new-line ESLint rule * Add react/jsx-no-duplicate-props ESLint rule * Add react/jsx-tag-spacing ESLint rule
This commit is contained in:
parent
cd81a1c52a
commit
d8ae3efec3
25 changed files with 65 additions and 43 deletions
|
@ -42,7 +42,7 @@ class Column extends React.PureComponent {
|
|||
|
||||
if (heading) {
|
||||
columnHeaderId = heading.replace(/ /g, '-');
|
||||
header = <ColumnHeader icon={icon} active={active} type={heading} onClick={this.handleHeaderClick} hideOnMobile={hideHeadingOnMobile} columnHeaderId={columnHeaderId}/>;
|
||||
header = <ColumnHeader icon={icon} active={active} type={heading} onClick={this.handleHeaderClick} hideOnMobile={hideHeadingOnMobile} columnHeaderId={columnHeaderId} />;
|
||||
}
|
||||
return (
|
||||
<div
|
||||
|
@ -50,7 +50,8 @@ class Column extends React.PureComponent {
|
|||
role='region'
|
||||
aria-labelledby={columnHeaderId}
|
||||
className='column'
|
||||
onScroll={this.handleScroll}>
|
||||
onScroll={this.handleScroll}
|
||||
>
|
||||
{header}
|
||||
{children}
|
||||
</div>
|
||||
|
|
|
@ -75,7 +75,7 @@ class MediaModal extends ImmutablePureComponent {
|
|||
if (attachment.get('type') === 'image') {
|
||||
content = <ImageLoader src={url} />;
|
||||
} else if (attachment.get('type') === 'gifv') {
|
||||
content = <ExtendedVideoPlayer src={url} muted={true} controls={false} />;
|
||||
content = <ExtendedVideoPlayer src={url} muted controls={false} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
@ -64,7 +64,8 @@ class ModalRoot extends React.PureComponent {
|
|||
<TransitionMotion
|
||||
styles={items}
|
||||
willEnter={this.willEnter}
|
||||
willLeave={this.willLeave}>
|
||||
willLeave={this.willLeave}
|
||||
>
|
||||
{interpolatedStyles =>
|
||||
<div className='modal-root'>
|
||||
{interpolatedStyles.map(({ key, data: { type, props }, style }) => {
|
||||
|
|
|
@ -31,7 +31,7 @@ const PageOne = ({ acct, domain }) => (
|
|||
<div>
|
||||
<h1><FormattedMessage id='onboarding.page_one.welcome' defaultMessage='Welcome to Mastodon!' /></h1>
|
||||
<p><FormattedMessage id='onboarding.page_one.federation' defaultMessage='Mastodon is a network of independent servers joining up to make one larger social network. We call these servers instances.' /></p>
|
||||
<p><FormattedMessage id='onboarding.page_one.handle' defaultMessage='You are on {domain}, so your full handle is {handle}' values={{ domain, handle: <strong>{acct}@{domain}</strong> }}/></p>
|
||||
<p><FormattedMessage id='onboarding.page_one.handle' defaultMessage='You are on {domain}, so your full handle is {handle}' values={{ domain, handle: <strong>{acct}@{domain}</strong> }} /></p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -88,7 +88,7 @@ const PageThree = ({ me, domain }) => (
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<p><FormattedMessage id='onboarding.page_three.search' defaultMessage='Use the search bar to find people and look at hashtags, such as {illustration} and {introductions}. To look for a person who is not on this instance, use their full handle.' values={{ illustration: <Permalink to='/timelines/tag/illustration' href='/tags/illustration'>#illustration</Permalink>, introductions: <Permalink to='/timelines/tag/introductions' href='/tags/introductions'>#introductions</Permalink> }}/></p>
|
||||
<p><FormattedMessage id='onboarding.page_three.search' defaultMessage='Use the search bar to find people and look at hashtags, such as {illustration} and {introductions}. To look for a person who is not on this instance, use their full handle.' values={{ illustration: <Permalink to='/timelines/tag/illustration' href='/tags/illustration'>#illustration</Permalink>, introductions: <Permalink to='/timelines/tag/introductions' href='/tags/introductions'>#introductions</Permalink> }} /></p>
|
||||
<p><FormattedMessage id='onboarding.page_three.profile' defaultMessage='Edit your profile to change your avatar, bio, and display name. There, you will also find other preferences.' /></p>
|
||||
</div>
|
||||
);
|
||||
|
@ -104,7 +104,7 @@ const PageFour = ({ domain, intl }) => (
|
|||
<div className='row'>
|
||||
<div>
|
||||
<div className='figure non-interactive'><ColumnHeader icon='home' type={intl.formatMessage(messages.home_title)} /></div>
|
||||
<p><FormattedMessage id='onboarding.page_four.home' defaultMessage='The home timeline shows posts from people you follow.'/></p>
|
||||
<p><FormattedMessage id='onboarding.page_four.home' defaultMessage='The home timeline shows posts from people you follow.' /></p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
@ -141,7 +141,7 @@ const PageSix = ({ admin, domain }) => {
|
|||
<p>
|
||||
<FormattedMessage id='onboarding.page_six.admin' defaultMessage="Your instance's admin is {admin}." values={{ admin: <Permalink href={admin.get('url')} to={`/accounts/${admin.get('id')}`}>@{admin.get('acct')}</Permalink> }} />
|
||||
<br />
|
||||
<FormattedMessage id='onboarding.page_six.read_guidelines' defaultMessage="Please read {domain}'s {guidelines}!" values={{ domain, guidelines: <a href='/about/more' target='_blank'><FormattedMessage id='onboarding.page_six.guidelines' defaultMessage='community guidelines' /></a> }}/>
|
||||
<FormattedMessage id='onboarding.page_six.read_guidelines' defaultMessage="Please read {domain}'s {guidelines}!" values={{ domain, guidelines: <a href='/about/more' target='_blank'><FormattedMessage id='onboarding.page_six.guidelines' defaultMessage='community guidelines' /></a> }} />
|
||||
</p>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ class VideoModal extends ImmutablePureComponent {
|
|||
<div className='modal-root__modal media-modal'>
|
||||
<div>
|
||||
<div className='media-modal__close'><IconButton title={intl.formatMessage(messages.close)} icon='times' overlay onClick={onClose} /></div>
|
||||
<ExtendedVideoPlayer src={url} muted={false} controls={true} time={time} />
|
||||
<ExtendedVideoPlayer src={url} muted={false} controls time={time} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue