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:
Yamagishi Kazutoshi
2017-05-21 00:31:47 +09:00
committed by Eugen Rochko
parent 812fe90eca
commit 2e112e2406
170 changed files with 919 additions and 904 deletions

View File

@ -8,7 +8,7 @@ import SettingText from './setting_text';
const messages = defineMessages({
filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' },
settings: { id: 'home.settings', defaultMessage: 'Column settings' }
settings: { id: 'home.settings', defaultMessage: 'Column settings' },
});
class ColumnSettings extends React.PureComponent {
@ -17,7 +17,7 @@ class ColumnSettings extends React.PureComponent {
settings: ImmutablePropTypes.map.isRequired,
onChange: PropTypes.func.isRequired,
onSave: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired
intl: PropTypes.object.isRequired,
};
render () {

View File

@ -8,11 +8,11 @@ class SettingText extends React.PureComponent {
settings: ImmutablePropTypes.map.isRequired,
settingKey: PropTypes.array.isRequired,
label: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired
onChange: PropTypes.func.isRequired,
};
handleChange = (e) => {
this.props.onChange(this.props.settingKey, e.target.value)
this.props.onChange(this.props.settingKey, e.target.value);
}
render () {

View File

@ -3,7 +3,7 @@ import ColumnSettings from '../components/column_settings';
import { changeSetting, saveSettings } from '../../../actions/settings';
const mapStateToProps = state => ({
settings: state.getIn(['settings', 'home'])
settings: state.getIn(['settings', 'home']),
});
const mapDispatchToProps = dispatch => ({
@ -14,7 +14,7 @@ const mapDispatchToProps = dispatch => ({
onSave () {
dispatch(saveSettings());
}
},
});

View File

@ -8,12 +8,12 @@ import ColumnSettingsContainer from './containers/column_settings_container';
import Link from 'react-router/lib/Link';
const messages = defineMessages({
title: { id: 'column.home', defaultMessage: 'Home' }
title: { id: 'column.home', defaultMessage: 'Home' },
});
const mapStateToProps = state => ({
hasUnread: state.getIn(['timelines', 'home', 'unread']) > 0,
hasFollows: state.getIn(['accounts_counters', state.getIn(['meta', 'me']), 'following_count']) > 0
hasFollows: state.getIn(['accounts_counters', state.getIn(['meta', 'me']), 'following_count']) > 0,
});
class HomeTimeline extends React.PureComponent {
@ -21,7 +21,7 @@ class HomeTimeline extends React.PureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,
hasUnread: PropTypes.bool,
hasFollows: PropTypes.bool
hasFollows: PropTypes.bool,
};
render () {
@ -30,7 +30,7 @@ class HomeTimeline extends React.PureComponent {
let emptyMessage;
if (hasFollows) {
emptyMessage = <FormattedMessage id='empty_column.home.inactivity' defaultMessage="Your home feed is empty. If you have been inactive for a while, it will be regenerated for you soon." />
emptyMessage = <FormattedMessage id='empty_column.home.inactivity' defaultMessage="Your home feed is empty. If you have been inactive for a while, it will be regenerated for you soon." />;
} else {
emptyMessage = <FormattedMessage id='empty_column.home' defaultMessage="You aren't following anyone yet. Visit {public} or use search to get started and meet other users." values={{ public: <Link to='/timelines/public'><FormattedMessage id='empty_column.home.public_timeline' defaultMessage='the public timeline' /></Link> }} />;
}