]> cat aescling's git repositories - mastodon.git/commitdiff
Remove unused variables (#3906)
authorYamagishi Kazutoshi <ykzts@desire.sh>
Fri, 23 Jun 2017 14:05:04 +0000 (23:05 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 23 Jun 2017 14:05:04 +0000 (16:05 +0200)
63 files changed:
.eslintrc.yml
app/javascript/mastodon/actions/accounts.js
app/javascript/mastodon/actions/domain_blocks.js
app/javascript/mastodon/actions/notifications.js
app/javascript/mastodon/actions/statuses.js
app/javascript/mastodon/components/dropdown_menu.js
app/javascript/mastodon/components/media_gallery.js
app/javascript/mastodon/components/status.js
app/javascript/mastodon/components/status_content.js
app/javascript/mastodon/components/status_list.js
app/javascript/mastodon/containers/mastodon.js
app/javascript/mastodon/containers/status_container.js
app/javascript/mastodon/features/account/components/header.js
app/javascript/mastodon/features/account_gallery/index.js
app/javascript/mastodon/features/community_timeline/components/column_settings.js
app/javascript/mastodon/features/community_timeline/containers/column_settings_container.js
app/javascript/mastodon/features/community_timeline/index.js
app/javascript/mastodon/features/compose/components/compose_form.js
app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js
app/javascript/mastodon/features/compose/components/navigation_bar.js
app/javascript/mastodon/features/compose/components/privacy_dropdown.js
app/javascript/mastodon/features/compose/components/search.js
app/javascript/mastodon/features/compose/components/search_results.js
app/javascript/mastodon/features/compose/components/upload_button.js
app/javascript/mastodon/features/compose/containers/navigation_container.js
app/javascript/mastodon/features/compose/containers/reply_indicator_container.js
app/javascript/mastodon/features/compose/containers/upload_form_container.js
app/javascript/mastodon/features/compose/containers/upload_progress_container.js
app/javascript/mastodon/features/compose/index.js
app/javascript/mastodon/features/favourited_statuses/index.js
app/javascript/mastodon/features/follow_requests/containers/account_authorize_container.js
app/javascript/mastodon/features/getting_started/index.js
app/javascript/mastodon/features/hashtag_timeline/index.js
app/javascript/mastodon/features/home_timeline/components/column_settings.js
app/javascript/mastodon/features/notifications/components/column_settings.js
app/javascript/mastodon/features/notifications/components/notification.js
app/javascript/mastodon/features/notifications/components/setting_toggle.js
app/javascript/mastodon/features/public_timeline/containers/column_settings_container.js
app/javascript/mastodon/features/public_timeline/index.js
app/javascript/mastodon/features/report/index.js
app/javascript/mastodon/features/status/index.js
app/javascript/mastodon/features/ui/components/boost_modal.js
app/javascript/mastodon/features/ui/components/confirmation_modal.js
app/javascript/mastodon/features/ui/components/image_loader.js
app/javascript/mastodon/features/ui/components/media_modal.js
app/javascript/mastodon/features/ui/components/onboarding_modal.js
app/javascript/mastodon/features/ui/components/video_modal.js
app/javascript/mastodon/features/ui/containers/notifications_container.js
app/javascript/mastodon/features/ui/index.js
app/javascript/mastodon/middleware/errors.js
app/javascript/mastodon/middleware/sounds.js
app/javascript/mastodon/reducers/compose.js
app/javascript/mastodon/reducers/modal.js
app/javascript/mastodon/reducers/search.js
app/javascript/mastodon/reducers/timelines.js
app/javascript/mastodon/selectors/index.js
app/javascript/mastodon/store/configureStore.js
spec/javascript/.eslintrc.yml [new file with mode: 0644]
spec/javascript/components/loading_indicator.test.js [deleted file]
storybook/config.js
storybook/stories/character_counter.story.js
storybook/stories/loading_indicator.story.js
streaming/index.js

index 2fb54ae66912146333500ed063922d7b13c0a2ff..a816bffeffa8abb3719d0ade538ac302b673ad42 100644 (file)
@@ -1,7 +1,9 @@
 ---
+root: true
+
 env:
   browser: true
-  node: false
+  node: true
   es6: true
 
 parser: babel-eslint
@@ -52,8 +54,14 @@ rules:
   no-mixed-spaces-and-tabs: warn
   no-nested-ternary: warn
   no-trailing-spaces: warn
+  no-undef: error
   no-unreachable: error
   no-unused-expressions: error
+  no-unused-vars:
+  - error
+  - vars: all
+    args: after-used
+    ignoreRestSiblings: true
   object-curly-spacing:
   - error
   - always
@@ -81,7 +89,10 @@ rules:
   - 2
   react/jsx-no-bind: error
   react/jsx-no-duplicate-props: error
+  react/jsx-no-undef: error
   react/jsx-tag-spacing: error
+  react/jsx-uses-react: error
+  react/jsx-uses-vars: error
   react/jsx-wrap-multilines: error
   react/no-multi-comp: off
   react/no-string-refs: error
index a862798f9067990513b6111d19a3677336474fd7..03e3d3d9f94f1fd6d307daf91035f4b2f75d2315 100644 (file)
@@ -1,5 +1,4 @@
 import api, { getLinks } from '../api';
-import Immutable from 'immutable';
 
 export const ACCOUNT_FETCH_REQUEST = 'ACCOUNT_FETCH_REQUEST';
 export const ACCOUNT_FETCH_SUCCESS = 'ACCOUNT_FETCH_SUCCESS';
@@ -597,7 +596,7 @@ export function authorizeFollowRequest(id) {
 
     api(getState)
       .post(`/api/v1/follow_requests/${id}/authorize`)
-      .then(response => dispatch(authorizeFollowRequestSuccess(id)))
+      .then(() => dispatch(authorizeFollowRequestSuccess(id)))
       .catch(error => dispatch(authorizeFollowRequestFail(id, error)));
   };
 };
@@ -631,7 +630,7 @@ export function rejectFollowRequest(id) {
 
     api(getState)
       .post(`/api/v1/follow_requests/${id}/reject`)
-      .then(response => dispatch(rejectFollowRequestSuccess(id)))
+      .then(() => dispatch(rejectFollowRequestSuccess(id)))
       .catch(error => dispatch(rejectFollowRequestFail(id, error)));
   };
 };
index 530ba9cf1ddd14525a5b2de3f7bc3f49fb954a33..44363697a95f5a2f39d28693139b58e2bd385c24 100644 (file)
@@ -16,7 +16,7 @@ export function blockDomain(domain, accountId) {
   return (dispatch, getState) => {
     dispatch(blockDomainRequest(domain));
 
-    api(getState).post('/api/v1/domain_blocks', { domain }).then(response => {
+    api(getState).post('/api/v1/domain_blocks', { domain }).then(() => {
       dispatch(blockDomainSuccess(domain, accountId));
     }).catch(err => {
       dispatch(blockDomainFail(domain, err));
@@ -51,7 +51,7 @@ export function unblockDomain(domain, accountId) {
   return (dispatch, getState) => {
     dispatch(unblockDomainRequest(domain));
 
-    api(getState).delete('/api/v1/domain_blocks', { params: { domain } }).then(response => {
+    api(getState).delete('/api/v1/domain_blocks', { params: { domain } }).then(() => {
       dispatch(unblockDomainSuccess(domain, accountId));
     }).catch(err => {
       dispatch(unblockDomainFail(domain, err));
index d3de2d871f2303b71c4115e39e40fde31980c9c6..cda636139d0c8bbf6c9183941536a70770954940 100644 (file)
@@ -17,7 +17,7 @@ export const NOTIFICATIONS_EXPAND_FAIL    = 'NOTIFICATIONS_EXPAND_FAIL';
 export const NOTIFICATIONS_CLEAR      = 'NOTIFICATIONS_CLEAR';
 export const NOTIFICATIONS_SCROLL_TOP = 'NOTIFICATIONS_SCROLL_TOP';
 
-const messages = defineMessages({
+defineMessages({
   mention: { id: 'notification.mention', defaultMessage: '{name} mentioned you' },
 });
 
index 6956447ba4e263087d4d5c9cccbe69b7830f088b..8d385715c310ea72d559d13e0a2313e6e5d2daa9 100644 (file)
@@ -74,7 +74,7 @@ export function deleteStatus(id) {
   return (dispatch, getState) => {
     dispatch(deleteStatusRequest(id));
 
-    api(getState).delete(`/api/v1/statuses/${id}`).then(response => {
+    api(getState).delete(`/api/v1/statuses/${id}`).then(() => {
       dispatch(deleteStatusSuccess(id));
       dispatch(deleteFromTimelines(id));
     }).catch(error => {
@@ -152,7 +152,7 @@ export function muteStatus(id) {
   return (dispatch, getState) => {
     dispatch(muteStatusRequest(id));
 
-    api(getState).post(`/api/v1/statuses/${id}/mute`).then(response => {
+    api(getState).post(`/api/v1/statuses/${id}/mute`).then(() => {
       dispatch(muteStatusSuccess(id));
     }).catch(error => {
       dispatch(muteStatusFail(id, error));
@@ -186,7 +186,7 @@ export function unmuteStatus(id) {
   return (dispatch, getState) => {
     dispatch(unmuteStatusRequest(id));
 
-    api(getState).post(`/api/v1/statuses/${id}/unmute`).then(response => {
+    api(getState).post(`/api/v1/statuses/${id}/unmute`).then(() => {
       dispatch(unmuteStatusSuccess(id));
     }).catch(error => {
       dispatch(unmuteStatusFail(id, error));
index 6e394a95d9e9bbc503f2693c27c78d1c457bfd9e..deaab938e4dc45c33bc86e2d49aee1a6e5bd3ca0 100644 (file)
@@ -56,7 +56,7 @@ class DropdownMenu extends React.PureComponent {
       return <li key={`sep-${i}`} className='dropdown__sep' />;
     }
 
-    const { text, action, href = '#' } = item;
+    const { text, href = '#' } = item;
 
     return (
       <li className='dropdown__content-list-item' key={`${text}-${i}`}>
index 465130cec4b3502a3e16fea8840ac7881c0fc311..cbed90f82b23417d3b41476ca56417eab50b71d9 100644 (file)
@@ -138,7 +138,7 @@ class MediaGallery extends React.PureComponent {
     visible: !this.props.sensitive,
   };
 
-  handleOpen = (e) => {
+  handleOpen = () => {
     this.setState({ visible: !this.state.visible });
   }
 
index 1363956cf435f570ef8c8c1472445359c64dea1f..3be3685ece295a2f3e41a84f1e9f04f195c9aab5 100644 (file)
@@ -7,7 +7,6 @@ import RelativeTimestamp from './relative_timestamp';
 import DisplayName from './display_name';
 import MediaGallery from './media_gallery';
 import VideoPlayer from './video_player';
-import AttachmentList from './attachment_list';
 import StatusContent from './status_content';
 import StatusActionBar from './status_action_bar';
 import { FormattedMessage } from 'react-intl';
index d02083d3e7aa36d8c43b2b0b121d4d683a735e78..605d42138c4a328f50f959189fd7b7e8754981e1 100644 (file)
@@ -32,7 +32,6 @@ class StatusContent extends React.PureComponent {
     for (var i = 0; i < links.length; ++i) {
       let link    = links[i];
       let mention = this.props.status.get('mentions').find(item => link.href === item.get('url'));
-      let media   = this.props.status.get('media_attachments').find(item => link.href === item.get('text_url') || (item.get('remote_url').length > 0 && link.href === item.get('remote_url')));
 
       if (mention) {
         link.addEventListener('click', this.onMentionClick.bind(this, mention), false);
index b73a73d1bf2fca0c82d0397747437da5ada68c28..40e9d38c1b3d336a78ddaf6b9e20fdc272d8ce7b 100644 (file)
@@ -99,7 +99,7 @@ class StatusList extends ImmutablePureComponent {
   }
 
   render () {
-    const { statusIds, onScrollToBottom, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, emptyMessage } = this.props;
+    const { statusIds, scrollKey, trackScroll, shouldUpdateScroll, isLoading, hasMore, prepend, emptyMessage } = this.props;
 
     let loadMore       = null;
     let scrollableArea = null;
index d44cb1be44a52fef0be521af9a61cb4be57587df..e3cb815c9d3730b4576e42662bcd60c0de3e8876 100644 (file)
@@ -3,7 +3,6 @@ import { Provider } from 'react-redux';
 import PropTypes from 'prop-types';
 import configureStore from '../store/configureStore';
 import {
-  refreshTimelineSuccess,
   updateTimeline,
   deleteFromTimelines,
   refreshHomeTimeline,
index 2592e9a69c82e1471a3db73f8513cef6648b7574..438ecfe43111d77887d8de379ab96005c63d8872 100644 (file)
@@ -19,8 +19,6 @@ import {
 import { muteStatus, unmuteStatus, deleteStatus } from '../actions/statuses';
 import { initReport } from '../actions/reports';
 import { openModal } from '../actions/modal';
-import { createSelector } from 'reselect';
-import { isMobile } from '../is_mobile';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
 
 const messages = defineMessages({
index 653023cba7813a6b1ad2cf376eef7766bd41a885..80a671a01bbe5b813a26d09eecee3351c932d29c 100644 (file)
@@ -17,7 +17,7 @@ const messages = defineMessages({
 });
 
 const makeMapStateToProps = () => {
-  const mapStateToProps = (state, props) => ({
+  const mapStateToProps = state => ({
     autoPlayGif: state.getIn(['meta', 'auto_play_gif']),
   });
 
index fcbee3c89a198c12abc81b84bb7efba504add38c..1e4af30a4c57a22d1069ad2e969848c1f8f3a490 100644 (file)
@@ -7,7 +7,6 @@ import { refreshAccountMediaTimeline, expandAccountMediaTimeline } from '../../a
 import LoadingIndicator from '../../components/loading_indicator';
 import Column from '../ui/components/column';
 import ColumnBackButton from '../../components/column_back_button';
-import Immutable from 'immutable';
 import ImmutablePureComponent from 'react-immutable-pure-component';
 import { getAccountGallery } from '../../selectors';
 import MediaItem from './components/media_item';
index dbbe8ceaa03fc3e6f1d82473bfd6cd7f4dc68f01..aa487e34ee044bf8365bb690325b1504b6433f7d 100644 (file)
@@ -2,8 +2,6 @@ import React from 'react';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import ColumnCollapsable from '../../../components/column_collapsable';
-import SettingToggle from '../../notifications/components/setting_toggle';
 import SettingText from '../../../components/setting_text';
 
 const messages = defineMessages({
@@ -16,12 +14,11 @@ class ColumnSettings extends React.PureComponent {
   static propTypes = {
     settings: ImmutablePropTypes.map.isRequired,
     onChange: PropTypes.func.isRequired,
-    onSave: PropTypes.func.isRequired,
     intl: PropTypes.object.isRequired,
   };
 
   render () {
-    const { settings, onChange, onSave, intl } = this.props;
+    const { settings, onChange, intl } = this.props;
 
     return (
       <div>
index 1efc2ef3319f643d2f9866bd1b4436f2dfe8e6bb..f3489b4095bae4b4130ba7111681411df1a1f7a5 100644 (file)
@@ -1,6 +1,6 @@
 import { connect } from 'react-redux';
 import ColumnSettings from '../components/column_settings';
-import { changeSetting, saveSettings } from '../../../actions/settings';
+import { changeSetting } from '../../../actions/settings';
 
 const mapStateToProps = state => ({
   settings: state.getIn(['settings', 'community']),
@@ -12,10 +12,6 @@ const mapDispatchToProps = dispatch => ({
     dispatch(changeSetting(['community', ...key], checked));
   },
 
-  onSave () {
-    dispatch(saveSettings());
-  },
-
 });
 
 export default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);
index 4fbe670389c27788857455bae9eadf87d14c15c0..6c4b5dacf268d59358d331a9afdda7ef119b46cb 100644 (file)
@@ -14,7 +14,6 @@ import {
 } from '../../actions/timelines';
 import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import ColumnBackButtonSlim from '../../components/column_back_button_slim';
 import ColumnSettingsContainer from './containers/column_settings_container';
 import createStream from '../../stream';
 
index 0ee45c9788dda3893ca8b292de8af5dab03066d4..d75bbdf9cbc69f0af8431a9ba28b9604d541c928 100644 (file)
@@ -7,15 +7,13 @@ import ReplyIndicatorContainer from '../containers/reply_indicator_container';
 import AutosuggestTextarea from '../../../components/autosuggest_textarea';
 import { debounce } from 'lodash';
 import UploadButtonContainer from '../containers/upload_button_container';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import Toggle from 'react-toggle';
+import { defineMessages, injectIntl } from 'react-intl';
 import Collapsable from '../../../components/collapsable';
 import SpoilerButtonContainer from '../containers/spoiler_button_container';
 import PrivacyDropdownContainer from '../containers/privacy_dropdown_container';
 import SensitiveButtonContainer from '../containers/sensitive_button_container';
 import EmojiPickerDropdown from './emoji_picker_dropdown';
 import UploadFormContainer from '../containers/upload_form_container';
-import TextIconButton from './text_icon_button';
 import WarningContainer from '../containers/warning_container';
 import ImmutablePureComponent from 'react-immutable-pure-component';
 import { length } from 'stringz';
@@ -141,7 +139,6 @@ class ComposeForm extends ImmutablePureComponent {
     const text = [this.props.spoiler_text, this.props.text].join('');
 
     let publishText    = '';
-    let reply_to_other = false;
 
     if (this.props.privacy === 'private' || this.props.privacy === 'direct') {
       publishText = <span className='compose-form__publish-private'><i className='fa fa-lock' /> {intl.formatMessage(messages.publish)}</span>;
index 9ac674bb34ead95aee5441362baf396ea728cf41..afaff1be12675c4f4c9ccb3d6f33192af3856209 100644 (file)
@@ -52,7 +52,7 @@ class EmojiPickerDropdown extends React.PureComponent {
       import(/* webpackChunkName: "emojione_picker" */ 'emojione-picker').then(TheEmojiPicker => {
         EmojiPicker = TheEmojiPicker.default;
         this.setState({ loading: false });
-      }).catch(err => {
+      }).catch(() => {
         // TODO: show the user an error?
         this.setState({ loading: false });
       });
index 1c135a7335434e9dde102cd0e1e5f041dc31fb66..00f27dea1ba44f559fb7348b50eccecc384fc389 100644 (file)
@@ -1,11 +1,8 @@
 import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import Avatar from '../../../components/avatar';
-import IconButton from '../../../components/icon_button';
-import DisplayName from '../../../components/display_name';
 import Permalink from '../../../components/permalink';
 import { FormattedMessage } from 'react-intl';
-import Link from 'react-router-dom/Link';
 import ImmutablePureComponent from 'react-immutable-pure-component';
 
 class NavigationBar extends ImmutablePureComponent {
index 49f1179a07a58b19ca1cc9dac756d28ceac72419..f368186a5768ace0b0d12804f9442460793196ae 100644 (file)
@@ -64,7 +64,7 @@ class PrivacyDropdown extends React.PureComponent {
   }
 
   render () {
-    const { value, onChange, intl } = this.props;
+    const { value, intl } = this.props;
     const { open } = this.state;
 
     const options = [
index 800080a7dda95620363c94524e0b2ac0ae6884f7..21b3cf34b259fede2361c4b333307158e0fa3b0b 100644 (file)
@@ -1,6 +1,6 @@
 import React from 'react';
 import PropTypes from 'prop-types';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { defineMessages, injectIntl } from 'react-intl';
 
 const messages = defineMessages({
   placeholder: { id: 'search.placeholder', defaultMessage: 'Search' },
index 26d766a1c67bda6bea39930c2e1e6c52e5268fdd..1a2605c159b7cd41856bd46d517fa7b719bb656d 100644 (file)
@@ -1,6 +1,6 @@
 import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { FormattedMessage } from 'react-intl';
 import AccountContainer from '../../../containers/account_container';
 import StatusContainer from '../../../containers/status_container';
 import Link from 'react-router-dom/Link';
index 326b9851aa159e89897ad77148662ddbfe54347b..0f11b9e8b6d6752c43cc42622341af9c6c68b092 100644 (file)
@@ -11,7 +11,7 @@ const messages = defineMessages({
 });
 
 const makeMapStateToProps = () => {
-  const mapStateToProps = (state, props) => ({
+  const mapStateToProps = state => ({
     acceptContentTypes: state.getIn(['media_attachments', 'accept_content_types']),
   });
 
index 75f288f18525747df2aea73b9c986285e27604ee..8cc53c087e10be65163f03e60aa3661670b8d5fd 100644 (file)
@@ -1,7 +1,7 @@
 import { connect }   from 'react-redux';
 import NavigationBar from '../components/navigation_bar';
 
-const mapStateToProps = (state, props) => {
+const mapStateToProps = state => {
   return {
     account: state.getIn(['accounts', state.getIn(['meta', 'me'])]),
   };
index 7f3eeb89ced85cbd51f92501bf6237a0b5892d54..73f394c1af6214b1f20d2c074a323ca25b361f08 100644 (file)
@@ -6,7 +6,7 @@ import ReplyIndicator from '../components/reply_indicator';
 const makeMapStateToProps = () => {
   const getStatus = makeGetStatus();
 
-  const mapStateToProps = (state, props) => ({
+  const mapStateToProps = state => ({
     status: getStatus(state, state.getIn(['compose', 'in_reply_to'])),
   });
 
index 3125564c27cc9b7ad78f277cb6776841d4b81529..4612599f109b22b1f400c253ea28e182bc740f5d 100644 (file)
@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
 import UploadForm from '../components/upload_form';
 import { undoUploadCompose } from '../../../actions/compose';
 
-const mapStateToProps = (state, props) => ({
+const mapStateToProps = state => ({
   media: state.getIn(['compose', 'media_attachments']),
 });
 
index 51af4440caf816bbced095a0f7492f00d76ea1f0..0cfee96daaaeef6fbb8cdb1d940a64e016f36a3a 100644 (file)
@@ -1,7 +1,7 @@
 import { connect } from 'react-redux';
 import UploadProgress from '../components/upload_progress';
 
-const mapStateToProps = (state, props) => ({
+const mapStateToProps = state => ({
   active: state.getIn(['compose', 'is_uploading']),
   progress: state.getIn(['compose', 'progress']),
 });
index a87e48a23fc321d630538d879d979b1ca14e4c80..0452de856606693b412b9a51908a9f1acb7dfc07 100644 (file)
@@ -1,6 +1,5 @@
 import React from 'react';
 import ComposeFormContainer from './containers/compose_form_container';
-import UploadFormContainer from './containers/upload_form_container';
 import NavigationContainer from './containers/navigation_container';
 import PropTypes from 'prop-types';
 import { connect } from 'react-redux';
index 2b343ba5ae76e2be1806918ede42c2332c733b39..caf0d2ca2bb1d7fa13d3ceac5029ce31ef451917 100644 (file)
@@ -1,7 +1,6 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import PropTypes from 'prop-types';
-import ImmutablePropTypes from 'react-immutable-proptypes';
 import LoadingIndicator from '../../components/loading_indicator';
 import { fetchFavouritedStatuses, expandFavouritedStatuses } from '../../actions/favourites';
 import Column from '../ui/components/column';
@@ -15,19 +14,15 @@ const messages = defineMessages({
 });
 
 const mapStateToProps = state => ({
-  statusIds: state.getIn(['status_lists', 'favourites', 'items']),
   loaded: state.getIn(['status_lists', 'favourites', 'loaded']),
-  me: state.getIn(['meta', 'me']),
 });
 
 class Favourites extends ImmutablePureComponent {
 
   static propTypes = {
     dispatch: PropTypes.func.isRequired,
-    statusIds: ImmutablePropTypes.list.isRequired,
     loaded: PropTypes.bool,
     intl: PropTypes.object.isRequired,
-    me: PropTypes.number.isRequired,
   };
 
   componentWillMount () {
@@ -39,7 +34,7 @@ class Favourites extends ImmutablePureComponent {
   }
 
   render () {
-    const { statusIds, loaded, intl, me } = this.props;
+    const { loaded, intl } = this.props;
 
     if (!loaded) {
       return (
index a423bc79b69c3799bef352dd1dd71fce2243a570..8db471f73d0dd57031ce35902322c272461f47a2 100644 (file)
@@ -14,11 +14,11 @@ const makeMapStateToProps = () => {
 };
 
 const mapDispatchToProps = (dispatch, { id }) => ({
-  onAuthorize (account) {
+  onAuthorize () {
     dispatch(authorizeFollowRequest(id));
   },
 
-  onReject (account) {
+  onReject () {
     dispatch(rejectFollowRequest(id));
   },
 });
index a4549e609653477b8a51293efab31ea5974607b6..c1eb06fcbb54c58547670c9602b8e72460ef093a 100644 (file)
@@ -2,7 +2,6 @@ import React from 'react';
 import Column from '../ui/components/column';
 import ColumnLink from '../ui/components/column_link';
 import ColumnSubheading from '../ui/components/column_subheading';
-import Link from 'react-router-dom/Link';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
 import { connect } from 'react-redux';
 import PropTypes from 'prop-types';
index 3b2f1ba93b19f52bf523207aed5235b04198aa4e..853434d4b71e69d8cd79910350f162f6437f5ab1 100644 (file)
@@ -11,7 +11,6 @@ import {
   deleteFromTimelines,
 } from '../../actions/timelines';
 import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
-import ColumnBackButtonSlim from '../../components/column_back_button_slim';
 import { FormattedMessage } from 'react-intl';
 import createStream from '../../stream';
 
index ba870a36016871dc38567d9982147b5d5a7a0c37..47cd340afbb5f891380430d5153c28017ef55e3b 100644 (file)
@@ -2,7 +2,6 @@ import React from 'react';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import ColumnCollapsable from '../../../components/column_collapsable';
 import SettingToggle from '../../notifications/components/setting_toggle';
 import SettingText from '../../../components/setting_text';
 
@@ -16,12 +15,11 @@ class ColumnSettings extends React.PureComponent {
   static propTypes = {
     settings: ImmutablePropTypes.map.isRequired,
     onChange: PropTypes.func.isRequired,
-    onSave: PropTypes.func.isRequired,
     intl: PropTypes.object.isRequired,
   };
 
   render () {
-    const { settings, onChange, onSave, intl } = this.props;
+    const { settings, onChange, intl } = this.props;
 
     return (
       <div>
index 13ac788263047ae3a130ea6e1b4fad796113507d..2051e0c8635dfaa2d9615d074ffc606a0d6dad37 100644 (file)
@@ -2,7 +2,6 @@ import React from 'react';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { FormattedMessage } from 'react-intl';
-import ColumnCollapsable from '../../../components/column_collapsable';
 import ClearColumnButton from './clear_column_button';
 import SettingToggle from './setting_toggle';
 
@@ -16,7 +15,7 @@ class ColumnSettings extends React.PureComponent {
   };
 
   render () {
-    const { settings, onChange, onSave, onClear } = this.props;
+    const { settings, onChange, onClear } = this.props;
 
     const alertStr = <FormattedMessage id='notifications.column_settings.alert' defaultMessage='Desktop notifications' />;
     const showStr  = <FormattedMessage id='notifications.column_settings.show' defaultMessage='Show in column' />;
index 6ec4d5dc67191341f129a0f58ba961bca2b29330..ede37f66a3c67c3c445e6ea5e8b2ca63f81b7766 100644 (file)
@@ -2,7 +2,6 @@ import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import StatusContainer from '../../../containers/status_container';
 import AccountContainer from '../../../containers/account_container';
-import Avatar from '../../../components/avatar';
 import { FormattedMessage } from 'react-intl';
 import Permalink from '../../../components/permalink';
 import emojify from '../../../emoji';
index aefc14ee3fd9b91c36adcff7c975d1c0cc5148a0..8707a993e9e974a80427c1db1bd8e8ac3a70045b 100644 (file)
@@ -18,7 +18,7 @@ class SettingToggle extends React.PureComponent {
   }
 
   render () {
-    const { prefix, settings, settingKey, label, onChange } = this.props;
+    const { prefix, settings, settingKey, label } = this.props;
     const id = ['setting-toggle', prefix, ...settingKey].filter(Boolean).join('-');
 
     return (
index 62d4e7e5aac075475e5eb2bf06ed9910ef5bce6c..203e1da926f845db453c5581313e4c05f25f4042 100644 (file)
@@ -1,6 +1,6 @@
 import { connect } from 'react-redux';
 import ColumnSettings from '../../community_timeline/components/column_settings';
-import { changeSetting, saveSettings } from '../../../actions/settings';
+import { changeSetting } from '../../../actions/settings';
 
 const mapStateToProps = state => ({
   settings: state.getIn(['settings', 'public']),
@@ -12,10 +12,6 @@ const mapDispatchToProps = dispatch => ({
     dispatch(changeSetting(['public', ...key], checked));
   },
 
-  onSave () {
-    dispatch(saveSettings());
-  },
-
 });
 
 export default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);
index 02ddb418fe4fc56b74bf100dc44343c7085c5afd..3de54ef8bc4b821c7c73d288b77fbbd2f70f3f26 100644 (file)
@@ -14,7 +14,6 @@ import {
 } from '../../actions/timelines';
 import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import ColumnBackButtonSlim from '../../components/column_back_button_slim';
 import ColumnSettingsContainer from './containers/column_settings_container';
 import createStream from '../../stream';
 
index 23aba39de7b8eedb7c12b978cc278b17767a7fbf..0a52684303c40151699a3f7c6338dd5aa28e5654 100644 (file)
@@ -1,6 +1,6 @@
 import React from 'react';
 import { connect } from 'react-redux';
-import { cancelReport, changeReportComment, submitReport } from '../../actions/reports';
+import { changeReportComment, submitReport } from '../../actions/reports';
 import { refreshAccountTimeline } from '../../actions/timelines';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
index 19cee2435993edcf267177018546bba752000d51..afd8a781189494489c73b9ce40e397532919083f 100644 (file)
@@ -3,8 +3,6 @@ import { connect } from 'react-redux';
 import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { fetchStatus } from '../../actions/statuses';
-import Immutable from 'immutable';
-import EmbeddedStatus from '../../components/status';
 import MissingIndicator from '../../components/missing_indicator';
 import DetailedStatus from './components/detailed_status';
 import ActionBar from './components/action_bar';
@@ -21,17 +19,12 @@ import {
 } from '../../actions/compose';
 import { deleteStatus } from '../../actions/statuses';
 import { initReport } from '../../actions/reports';
-import {
-  makeGetStatus,
-  getStatusAncestors,
-  getStatusDescendants,
-} from '../../selectors';
+import { makeGetStatus } 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 { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { defineMessages, injectIntl } from 'react-intl';
 import ImmutablePureComponent from 'react-immutable-pure-component';
 
 const messages = defineMessages({
@@ -159,8 +152,6 @@ class Status extends ImmutablePureComponent {
       );
     }
 
-    const account = status.get('account');
-
     if (ancestorsIds && ancestorsIds.size > 0) {
       ancestors = <div>{this.renderChildren(ancestorsIds)}</div>;
     }
index da2be5264ad9754b020258d8076235de0369b5b1..9a8b96333d84e885d51fd2238649902c2f34adca 100644 (file)
@@ -2,7 +2,6 @@ import React from 'react';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import IconButton from '../../../components/icon_button';
 import Button from '../../../components/button';
 import StatusContent from '../../../components/status_content';
 import Avatar from '../../../components/avatar';
@@ -49,7 +48,7 @@ class BoostModal extends ImmutablePureComponent {
   }
 
   render () {
-    const { status, intl, onClose } = this.props;
+    const { status, intl } = this.props;
 
     return (
       <div className='modal-root__modal boost-modal'>
index f33bfd4453c0c33806215a199016d170ad7ee7a4..a45c220faf20d7d7535f56e9896ce09ae4000bfd 100644 (file)
@@ -1,6 +1,6 @@
 import React from 'react';
 import PropTypes from 'prop-types';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { injectIntl, FormattedMessage } from 'react-intl';
 import Button from '../../../components/button';
 
 class ConfirmationModal extends React.PureComponent {
index a2514d6be6b064cb79a33661c9213acb176dc84f..94bf55badbbb316d5e489fdace8dbaf665d062c4 100644 (file)
@@ -41,7 +41,7 @@ class ImageLoader extends React.PureComponent {
 
   render() {
     const { alt, src, previewSrc, width, height } = this.props;
-    const { loading, error } = this.state;
+    const { loading } = this.state;
 
     return (
       <div className='image-loader'>
index cff1a0cf52d461a32ca88afe9e30e734aba0242b..0f4105ee18396ca197935862fa5481ddfacd7fb7 100644 (file)
@@ -1,5 +1,4 @@
 import React from 'react';
-import LoadingIndicator from '../../../components/loading_indicator';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import ExtendedVideoPlayer from '../../../components/extended_video_player';
index c8985dc83a23f00656fcc493e6c6f522a878f2ab..27959916999e7659e7928ff5f94e38595fe9872c 100644 (file)
@@ -72,7 +72,7 @@ PageTwo.propTypes = {
   me: ImmutablePropTypes.map.isRequired,
 };
 
-const PageThree = ({ me, domain }) => (
+const PageThree = ({ me }) => (
   <div className='onboarding-modal__page onboarding-modal__page-three'>
     <div className='figure non-interactive'>
       <Search
@@ -95,7 +95,6 @@ const PageThree = ({ me, domain }) => (
 
 PageThree.propTypes = {
   me: ImmutablePropTypes.map.isRequired,
-  domain: PropTypes.string.isRequired,
 };
 
 const PageFour = ({ domain, intl }) => (
@@ -187,7 +186,7 @@ class OnboardingModal extends React.PureComponent {
     this.pages = [
       <PageOne acct={me.get('acct')} domain={domain} />,
       <PageTwo me={me} />,
-      <PageThree me={me} domain={domain} />,
+      <PageThree me={me} />,
       <PageFour domain={domain} intl={intl} />,
       <PageSix admin={admin} domain={domain} />,
     ];
index c622085f97dda40a2adb05692636671e36ea4431..3599ab775acebf226452d93632d3837612a7cdc2 100644 (file)
@@ -1,5 +1,4 @@
 import React from 'react';
-import LoadingIndicator from '../../../components/loading_indicator';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import PropTypes from 'prop-types';
 import ExtendedVideoPlayer from '../../../components/extended_video_player';
index 8bc30df3547087ed1eba6d81f7e769dc078aa92a..5924197f1e8c09ea2830511f312e19075057f87f 100644 (file)
@@ -1,12 +1,9 @@
 import { connect } from 'react-redux';
 import { NotificationStack } from 'react-notification';
-import {
-  dismissAlert,
-  clearAlerts,
-} from '../../../actions/alerts';
+import { dismissAlert } from '../../../actions/alerts';
 import { getAlerts } from '../../../selectors';
 
-const mapStateToProps = (state, props) => ({
+const mapStateToProps = state => ({
   notifications: getAlerts(state),
 });
 
index 39600607ff90db8fabc94992187768d2d52761cd..e48e9dbe995c4dbe5bffe3996c72a786817ee714 100644 (file)
@@ -74,9 +74,6 @@ class WrappedRoute extends React.Component {
 
 }
 
-const noOp = () => false;
-
-
 class UI extends React.PureComponent {
 
   static propTypes = {
index 4aca75f1e363dd2e13099649d3e09fc153b9fc31..b2c5f0898b459eb525cf9c3a1e861216f941643b 100644 (file)
@@ -1,13 +1,11 @@
 import { showAlert } from '../actions/alerts';
 
-const defaultSuccessSuffix = 'SUCCESS';
 const defaultFailSuffix = 'FAIL';
 
 export default function errorsMiddleware() {
   return ({ dispatch }) => next => action => {
     if (action.type && !action.skipAlert) {
       const isFail = new RegExp(`${defaultFailSuffix}$`, 'g');
-      const isSuccess = new RegExp(`${defaultSuccessSuffix}$`, 'g');
 
       if (action.type.match(isFail)) {
         if (action.error.response) {
index fd5a2b960ee97911bfce73e18c2bf686ed0f7844..372e7c8354dcad0723fc9571ff461d7aa9e55a90 100644 (file)
@@ -32,7 +32,7 @@ export default function soundsMiddleware() {
     ]),
   };
 
-  return ({ dispatch }) => next => (action) => {
+  return () => next => action => {
     if (action.meta && action.meta.sound && soundCache[action.meta.sound]) {
       play(soundCache[action.meta.sound]);
     }
index 2413df9e242cf8708d19dadda7a9ef4d4fabc682..d0b47a85c2c8ef8fd0f6224995fc99dae011e33c 100644 (file)
@@ -20,7 +20,6 @@ import {
   COMPOSE_SPOILERNESS_CHANGE,
   COMPOSE_SPOILER_TEXT_CHANGE,
   COMPOSE_VISIBILITY_CHANGE,
-  COMPOSE_LISTABILITY_CHANGE,
   COMPOSE_EMOJI_INSERT,
 } from '../actions/compose';
 import { TIMELINE_DELETE } from '../actions/timelines';
index 8fd9a69cdae5abe92fb409ffbb4fabe59cffc684..599a2443e0d5ed56a58407177e89f8f306ca8f04 100644 (file)
@@ -1,5 +1,4 @@
 import { MODAL_OPEN, MODAL_CLOSE } from '../actions/modal';
-import Immutable from 'immutable';
 
 const initialState = {
   modalType: null,
index ed395427e9ef1af11d839893a959e642fcb7f4fc..0a3adac05cc58e0b3dd6725c64dfdef84267845c 100644 (file)
@@ -14,60 +14,6 @@ const initialState = Immutable.Map({
   results: Immutable.Map(),
 });
 
-const normalizeSuggestions = (state, value, accounts, hashtags, statuses) => {
-  let newSuggestions = [];
-
-  if (accounts.length > 0) {
-    newSuggestions.push({
-      title: 'account',
-      items: accounts.map(item => ({
-        type: 'account',
-        id: item.id,
-        value: item.acct,
-      })),
-    });
-  }
-
-  if (value.indexOf('@') === -1 && value.indexOf(' ') === -1 || hashtags.length > 0) {
-    let hashtagItems = hashtags.map(item => ({
-      type: 'hashtag',
-      id: item,
-      value: `#${item}`,
-    }));
-
-    if (value.indexOf('@') === -1 && value.indexOf(' ') === -1 && !value.startsWith('http://') && !value.startsWith('https://') && hashtags.indexOf(value) === -1) {
-      hashtagItems.unshift({
-        type: 'hashtag',
-        id: value,
-        value: `#${value}`,
-      });
-    }
-
-    if (hashtagItems.length > 0) {
-      newSuggestions.push({
-        title: 'hashtag',
-        items: hashtagItems,
-      });
-    }
-  }
-
-  if (statuses.length > 0) {
-    newSuggestions.push({
-      title: 'status',
-      items: statuses.map(item => ({
-        type: 'status',
-        id: item.id,
-        value: item.id,
-      })),
-    });
-  }
-
-  return state.withMutations(map => {
-    map.set('suggestions', newSuggestions);
-    map.set('loaded_value', value);
-  });
-};
-
 export default function search(state = initialState, action) {
   switch(action.type) {
   case SEARCH_CHANGE:
index 2bc1c80509442a361da659154c71e6a263d892f1..1b738a16aa15e33ae6709327ae2f2c18186aebbc 100644 (file)
@@ -11,12 +11,6 @@ import {
   TIMELINE_CONNECT,
   TIMELINE_DISCONNECT,
 } from '../actions/timelines';
-import {
-  REBLOG_SUCCESS,
-  UNREBLOG_SUCCESS,
-  FAVOURITE_SUCCESS,
-  UNFAVOURITE_SUCCESS,
-} from '../actions/interactions';
 import {
   ACCOUNT_BLOCK_SUCCESS,
   ACCOUNT_MUTE_SUCCESS,
index d5d736e2f4497eae8c26993ed64d36834a903f35..07d9a2629bc722db20454f1aab3f43fc46180f2e 100644 (file)
@@ -1,9 +1,6 @@
 import { createSelector } from 'reselect';
 import Immutable from 'immutable';
 
-const getStatuses = state => state.get('statuses');
-const getAccounts = state => state.get('accounts');
-
 const getAccountBase         = (state, id) => state.getIn(['accounts', id], null);
 const getAccountCounters     = (state, id) => state.getIn(['accounts_counters', id], null);
 const getAccountRelationship = (state, id) => state.getIn(['relationships', id], null);
index a92d756f54947a5374ef869b8a7c5fb59b405c1f..1376d4cbaf566e37d957281ea390dac8f386616d 100644 (file)
@@ -4,7 +4,6 @@ import appReducer from '../reducers';
 import loadingBarMiddleware from '../middleware/loading_bar';
 import errorsMiddleware from '../middleware/errors';
 import soundsMiddleware from '../middleware/sounds';
-import Immutable from 'immutable';
 
 export default function configureStore() {
   return createStore(appReducer, compose(applyMiddleware(
diff --git a/spec/javascript/.eslintrc.yml b/spec/javascript/.eslintrc.yml
new file mode 100644 (file)
index 0000000..6db2a46
--- /dev/null
@@ -0,0 +1,3 @@
+---
+env:
+  mocha: true
diff --git a/spec/javascript/components/loading_indicator.test.js b/spec/javascript/components/loading_indicator.test.js
deleted file mode 100644 (file)
index 0859dd1..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-import { expect } from 'chai';
-import { shallow } from 'enzyme';
-import React from 'react';
-import LoadingIndicator from '../../../app/javascript/mastodon/components/loading_indicator';
-
-describe('<LoadingIndicator />', () => {
-
-});
index 1078059a76bf20a9aad9b24c7d5a2d85d672b667..87479560f53febf42643678adf90aefa655b1275 100644 (file)
@@ -1,5 +1,4 @@
 import { configure } from '@storybook/react';
-import React from 'react';
 import { addLocaleData } from 'react-intl';
 import en from 'react-intl/locale-data/en';
 import '../app/javascript/styles/application.scss';
index 15a401a25c7c3f36ad2bd623bff99976508d5664..39d9afb5678ef77abd5a9ae00510947eeb4b7373 100644 (file)
@@ -1,6 +1,5 @@
 import React from 'react';
 import { storiesOf } from '@storybook/react';
-import { action } from '@storybook/addon-actions';
 import CharacterCounter from 'mastodon/features/compose/components/character_counter';
 
 storiesOf('CharacterCounter', module)
index 3e12f61ca86aa7456a622ed6eff0a6258c66b78d..6ee822758a505c2369ea7bdb18734e67f1287bce 100644 (file)
@@ -1,7 +1,6 @@
 import React from 'react';
 import { IntlProvider } from 'react-intl';
 import { storiesOf } from '@storybook/react';
-import { action } from '@storybook/addon-actions';
 import en from 'mastodon/locales/en.json';
 import LoadingIndicator from 'mastodon/components/loading_indicator';
 
index 5afdd59619c01ece9533c02cb51863a0e1e16a1e..fb23be34d48a897a93e06867bdc98461fe4c8f33 100644 (file)
@@ -242,7 +242,7 @@ const startWorker = (workerId) => {
     accountFromRequest(req, next);
   };
 
-  const errorMiddleware = (err, req, res, next) => {
+  const errorMiddleware = (err, req, res) => {
     log.error(req.requestId, err.toString());
     res.writeHead(err.statusCode || 500, { 'Content-Type': 'application/json' });
     res.end(JSON.stringify({ error: err.statusCode ? err.toString() : 'An unexpected error occurred' }));
@@ -366,7 +366,7 @@ const startWorker = (workerId) => {
       }
     });
 
-    ws.on('error', e => {
+    ws.on('error', () => {
       log.verbose(req.requestId, `Ending stream for ${req.accountId}`);
       unsubscribe(id, listener);
       if (closeHandler) {
@@ -443,7 +443,7 @@ const startWorker = (workerId) => {
     }
   });
 
-  const wsInterval = setInterval(() => {
+  setInterval(() => {
     wss.clients.forEach(ws => {
       if (ws.isAlive === false) {
         ws.terminate();