Improve eslint rules (#3147)
* Add semi to ESLint rules * Add padded-blocks to ESLint rules * Add comma-dangle to ESLint rules * add config/webpack and storyboard * add streaming/ * yarn test:lint -- --fix
This commit is contained in:
parent
812fe90eca
commit
2e112e2406
170 changed files with 919 additions and 904 deletions
|
@ -18,7 +18,7 @@ const messages = defineMessages({
|
|||
class ActionBar extends React.PureComponent {
|
||||
|
||||
static contextTypes = {
|
||||
router: PropTypes.object
|
||||
router: PropTypes.object,
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
|
@ -30,7 +30,7 @@ class ActionBar extends React.PureComponent {
|
|||
onMention: PropTypes.func.isRequired,
|
||||
onReport: PropTypes.func,
|
||||
me: PropTypes.number.isRequired,
|
||||
intl: PropTypes.object.isRequired
|
||||
intl: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
handleReplyClick = () => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import punycode from 'punycode'
|
||||
import punycode from 'punycode';
|
||||
|
||||
const IDNA_PREFIX = 'xn--';
|
||||
|
||||
|
@ -9,7 +9,7 @@ const decodeIDNA = domain => {
|
|||
.split('.')
|
||||
.map(part => part.indexOf(IDNA_PREFIX) === 0 ? punycode.decode(part.slice(IDNA_PREFIX.length)) : part)
|
||||
.join('.');
|
||||
}
|
||||
};
|
||||
|
||||
const getHostname = url => {
|
||||
const parser = document.createElement('a');
|
||||
|
@ -20,7 +20,7 @@ const getHostname = url => {
|
|||
class Card extends React.PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
card: ImmutablePropTypes.map
|
||||
card: ImmutablePropTypes.map,
|
||||
};
|
||||
|
||||
renderLink () {
|
||||
|
@ -95,6 +95,7 @@ class Card extends React.PureComponent {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default Card;
|
||||
|
|
|
@ -15,7 +15,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
|
|||
class DetailedStatus extends ImmutablePureComponent {
|
||||
|
||||
static contextTypes = {
|
||||
router: PropTypes.object
|
||||
router: PropTypes.object,
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
|
|
|
@ -2,7 +2,7 @@ import { connect } from 'react-redux';
|
|||
import Card from '../components/card';
|
||||
|
||||
const mapStateToProps = (state, { statusId }) => ({
|
||||
card: state.getIn(['cards', statusId], null)
|
||||
card: state.getIn(['cards', statusId], null),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(Card);
|
||||
|
|
|
@ -13,30 +13,30 @@ import {
|
|||
favourite,
|
||||
unfavourite,
|
||||
reblog,
|
||||
unreblog
|
||||
unreblog,
|
||||
} from '../../actions/interactions';
|
||||
import {
|
||||
replyCompose,
|
||||
mentionCompose
|
||||
mentionCompose,
|
||||
} from '../../actions/compose';
|
||||
import { deleteStatus } from '../../actions/statuses';
|
||||
import { initReport } from '../../actions/reports';
|
||||
import {
|
||||
makeGetStatus,
|
||||
getStatusAncestors,
|
||||
getStatusDescendants
|
||||
getStatusDescendants,
|
||||
} from '../../selectors';
|
||||
import { ScrollContainer } from 'react-router-scroll';
|
||||
import ColumnBackButton from '../../components/column_back_button';
|
||||
import StatusContainer from '../../containers/status_container';
|
||||
import { openModal } from '../../actions/modal';
|
||||
import { isMobile } from '../../is_mobile'
|
||||
import { isMobile } from '../../is_mobile';
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
|
||||
const messages = defineMessages({
|
||||
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
|
||||
deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' }
|
||||
deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' },
|
||||
});
|
||||
|
||||
const makeMapStateToProps = () => {
|
||||
|
@ -48,7 +48,7 @@ const makeMapStateToProps = () => {
|
|||
descendantsIds: state.getIn(['timelines', 'descendants', Number(props.params.statusId)]),
|
||||
me: state.getIn(['meta', 'me']),
|
||||
boostModal: state.getIn(['meta', 'boost_modal']),
|
||||
autoPlayGif: state.getIn(['meta', 'auto_play_gif'])
|
||||
autoPlayGif: state.getIn(['meta', 'auto_play_gif']),
|
||||
});
|
||||
|
||||
return mapStateToProps;
|
||||
|
@ -57,7 +57,7 @@ const makeMapStateToProps = () => {
|
|||
class Status extends ImmutablePureComponent {
|
||||
|
||||
static contextTypes = {
|
||||
router: PropTypes.object
|
||||
router: PropTypes.object,
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
|
@ -69,7 +69,7 @@ class Status extends ImmutablePureComponent {
|
|||
me: PropTypes.number,
|
||||
boostModal: PropTypes.bool,
|
||||
autoPlayGif: PropTypes.bool,
|
||||
intl: PropTypes.object.isRequired
|
||||
intl: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
componentWillMount () {
|
||||
|
@ -116,7 +116,7 @@ class Status extends ImmutablePureComponent {
|
|||
dispatch(openModal('CONFIRM', {
|
||||
message: intl.formatMessage(messages.deleteMessage),
|
||||
confirm: intl.formatMessage(messages.deleteConfirm),
|
||||
onConfirm: () => dispatch(deleteStatus(status.get('id')))
|
||||
onConfirm: () => dispatch(deleteStatus(status.get('id'))),
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue