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:
committed by
Eugen Rochko
parent
812fe90eca
commit
2e112e2406
.eslintrc.ymllink_header.jsmain.js
app/javascript
mastodon
actions
accounts.jsalerts.jsblocks.jscards.jscompose.jsdomain_blocks.jsfavourites.jsinteractions.jsmodal.jsmutes.jsnotifications.jsreports.jssearch.jssettings.jsstatuses.jsstore.jstimelines.js
api.jscomponents
account.jsattachment_list.jsautosuggest_textarea.jsavatar.jsavatar_overlay.jsbutton.jscollapsable.jscolumn_back_button.jscolumn_back_button_slim.jscolumn_collapsable.jsdisplay_name.jsdropdown_menu.jsextended_video_player.jsicon_button.jsload_more.jsmedia_gallery.jspermalink.jsrelative_timestamp.jsstatus.jsstatus_action_bar.jsstatus_content.jsstatus_list.jsvideo_player.js
containers
features
account
components
account_gallery
account_timeline
blocks
community_timeline
compose
components
autosuggest_account.jscharacter_counter.jscompose_form.jsemoji_picker_dropdown.jsnavigation_bar.jsprivacy_dropdown.jsreply_indicator.jssearch.jssearch_results.jstext_icon_button.jsupload_button.jsupload_form.jsupload_progress.jswarning.js
containers
autosuggest_account_container.jsautosuggest_status_container.jscompose_form_container.jsnavigation_container.jsprivacy_dropdown_container.jsreply_indicator_container.jssearch_container.jssearch_results_container.jssensitive_button_container.jsspoiler_button_container.jsupload_button_container.jsupload_form_container.jsupload_progress_container.jswarning_container.js
index.jsfavourited_statuses
favourites
follow_requests
followers
following
getting_started
hashtag_timeline
home_timeline
mutes
notifications
public_timeline
reblogs
report
status
ui
locales
locale-data
middleware
reducers
accounts.jsaccounts_counters.jsalerts.jscompose.jsindex.jsmeta.jsmodal.jsnotifications.jsrelationships.jsreports.jssearch.jssettings.jsstatus_lists.jsstatuses.jstimelines.jsuser_lists.js
selectors
packs
config/webpack
configuration.jsdevelopment.jsdevelopment.server.js
package.jsonloaders
production.jsshared.jstest.jstranslationRunner.jsstorybook
streaming
@ -6,7 +6,7 @@ const makeMapStateToProps = () => {
|
||||
const getAccount = makeGetAccount();
|
||||
|
||||
const mapStateToProps = (state, { id }) => ({
|
||||
account: getAccount(state, id)
|
||||
account: getAccount(state, id),
|
||||
});
|
||||
|
||||
return mapStateToProps;
|
||||
|
||||
@ -6,7 +6,7 @@ const makeMapStateToProps = () => {
|
||||
const getStatus = makeGetStatus();
|
||||
|
||||
const mapStateToProps = (state, { id }) => ({
|
||||
status: getStatus(state, id)
|
||||
status: getStatus(state, id),
|
||||
});
|
||||
|
||||
return mapStateToProps;
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
fetchComposeSuggestions,
|
||||
selectComposeSuggestion,
|
||||
changeComposeSpoilerText,
|
||||
insertEmojiCompose
|
||||
insertEmojiCompose,
|
||||
} from '../../../actions/compose';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
@ -23,7 +23,7 @@ const mapStateToProps = state => ({
|
||||
is_submitting: state.getIn(['compose', 'is_submitting']),
|
||||
is_uploading: state.getIn(['compose', 'is_uploading']),
|
||||
me: state.getIn(['compose', 'me']),
|
||||
showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden'])
|
||||
showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
@ -3,7 +3,7 @@ import NavigationBar from '../components/navigation_bar';
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
return {
|
||||
account: state.getIn(['accounts', state.getIn(['meta', 'me'])])
|
||||
account: state.getIn(['accounts', state.getIn(['meta', 'me'])]),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -3,14 +3,14 @@ import PrivacyDropdown from '../components/privacy_dropdown';
|
||||
import { changeComposeVisibility } from '../../../actions/compose';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
value: state.getIn(['compose', 'privacy'])
|
||||
value: state.getIn(['compose', 'privacy']),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
onChange (value) {
|
||||
dispatch(changeComposeVisibility(value));
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ const mapDispatchToProps = dispatch => ({
|
||||
|
||||
onCancel () {
|
||||
dispatch(cancelReplyCompose());
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -3,13 +3,13 @@ import {
|
||||
changeSearch,
|
||||
clearSearch,
|
||||
submitSearch,
|
||||
showSearch
|
||||
showSearch,
|
||||
} from '../../../actions/search';
|
||||
import Search from '../components/search';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
value: state.getIn(['search', 'value']),
|
||||
submitted: state.getIn(['search', 'submitted'])
|
||||
submitted: state.getIn(['search', 'submitted']),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
@ -28,7 +28,7 @@ const mapDispatchToProps = dispatch => ({
|
||||
|
||||
onShow () {
|
||||
dispatch(showSearch());
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import { connect } from 'react-redux';
|
||||
import SearchResults from '../components/search_results';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
results: state.getIn(['search', 'results'])
|
||||
results: state.getIn(['search', 'results']),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(SearchResults);
|
||||
|
||||
@ -8,19 +8,19 @@ import spring from 'react-motion/lib/spring';
|
||||
import { injectIntl, defineMessages } from 'react-intl';
|
||||
|
||||
const messages = defineMessages({
|
||||
title: { id: 'compose_form.sensitive', defaultMessage: 'Mark media as sensitive' }
|
||||
title: { id: 'compose_form.sensitive', defaultMessage: 'Mark media as sensitive' },
|
||||
});
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
visible: state.getIn(['compose', 'media_attachments']).size > 0,
|
||||
active: state.getIn(['compose', 'sensitive'])
|
||||
active: state.getIn(['compose', 'sensitive']),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
onClick () {
|
||||
dispatch(changeComposeSensitivity());
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
@ -30,7 +30,7 @@ class SensitiveButton extends React.PureComponent {
|
||||
visible: PropTypes.bool,
|
||||
active: PropTypes.bool,
|
||||
onClick: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired
|
||||
intl: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
render () {
|
||||
|
||||
@ -4,21 +4,21 @@ import { changeComposeSpoilerness } from '../../../actions/compose';
|
||||
import { injectIntl, defineMessages } from 'react-intl';
|
||||
|
||||
const messages = defineMessages({
|
||||
title: { id: 'compose_form.spoiler', defaultMessage: 'Hide text behind warning' }
|
||||
title: { id: 'compose_form.spoiler', defaultMessage: 'Hide text behind warning' },
|
||||
});
|
||||
|
||||
const mapStateToProps = (state, { intl }) => ({
|
||||
label: 'CW',
|
||||
title: intl.formatMessage(messages.title),
|
||||
active: state.getIn(['compose', 'spoiler']),
|
||||
ariaControls: 'cw-spoiler-input'
|
||||
ariaControls: 'cw-spoiler-input',
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
onClick () {
|
||||
dispatch(changeComposeSpoilerness());
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -4,14 +4,14 @@ import { uploadCompose } from '../../../actions/compose';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
disabled: state.getIn(['compose', 'is_uploading']) || (state.getIn(['compose', 'media_attachments']).size > 3 || state.getIn(['compose', 'media_attachments']).some(m => m.get('type') === 'video')),
|
||||
resetFileKey: state.getIn(['compose', 'resetFileKey'])
|
||||
resetFileKey: state.getIn(['compose', 'resetFileKey']),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
|
||||
onSelectFile (files) {
|
||||
dispatch(uploadCompose(files));
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ const mapDispatchToProps = dispatch => ({
|
||||
|
||||
onRemoveFile (media_id) {
|
||||
dispatch(undoUploadCompose(media_id));
|
||||
}
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import UploadProgress from '../components/upload_progress';
|
||||
|
||||
const mapStateToProps = (state, props) => ({
|
||||
active: state.getIn(['compose', 'is_uploading']),
|
||||
progress: state.getIn(['compose', 'progress'])
|
||||
progress: state.getIn(['compose', 'progress']),
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(UploadProgress);
|
||||
|
||||
@ -20,7 +20,7 @@ const mapStateToProps = state => {
|
||||
return {
|
||||
needsLeakWarning: (state.getIn(['compose', 'privacy']) === 'private' || state.getIn(['compose', 'privacy']) === 'direct') && mentionedUsernames !== null,
|
||||
mentionedDomains: mentionedUsernamesWithDomains,
|
||||
needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', state.getIn(['meta', 'me']), 'locked'])
|
||||
needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', state.getIn(['meta', 'me']), 'locked']),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user