diff options
author | Yamagishi Kazutoshi <ykzts@desire.sh> | 2017-05-21 00:31:47 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-05-20 17:31:47 +0200 |
commit | 2e112e240666b62b8c3d4fa201fb24b841f6c92b (patch) | |
tree | f95f2eb5ae8156c10bf16894919d0ba5e3f34096 /app/javascript/mastodon/reducers/search.js | |
parent | 812fe90ecaef58f1dbe16c3fdfea79e14e7bbc9d (diff) |
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
Diffstat (limited to 'app/javascript/mastodon/reducers/search.js')
-rw-r--r-- | app/javascript/mastodon/reducers/search.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/app/javascript/mastodon/reducers/search.js b/app/javascript/mastodon/reducers/search.js index b3fe6c7be..ed395427e 100644 --- a/app/javascript/mastodon/reducers/search.js +++ b/app/javascript/mastodon/reducers/search.js @@ -2,7 +2,7 @@ import { SEARCH_CHANGE, SEARCH_CLEAR, SEARCH_FETCH_SUCCESS, - SEARCH_SHOW + SEARCH_SHOW, } from '../actions/search'; import { COMPOSE_MENTION, COMPOSE_REPLY } from '../actions/compose'; import Immutable from 'immutable'; @@ -11,7 +11,7 @@ const initialState = Immutable.Map({ value: '', submitted: false, hidden: false, - results: Immutable.Map() + results: Immutable.Map(), }); const normalizeSuggestions = (state, value, accounts, hashtags, statuses) => { @@ -23,8 +23,8 @@ const normalizeSuggestions = (state, value, accounts, hashtags, statuses) => { items: accounts.map(item => ({ type: 'account', id: item.id, - value: item.acct - })) + value: item.acct, + })), }); } @@ -32,21 +32,21 @@ const normalizeSuggestions = (state, value, accounts, hashtags, statuses) => { let hashtagItems = hashtags.map(item => ({ type: 'hashtag', id: item, - value: `#${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}` + value: `#${value}`, }); } if (hashtagItems.length > 0) { newSuggestions.push({ title: 'hashtag', - items: hashtagItems + items: hashtagItems, }); } } @@ -57,8 +57,8 @@ const normalizeSuggestions = (state, value, accounts, hashtags, statuses) => { items: statuses.map(item => ({ type: 'status', id: item.id, - value: item.id - })) + value: item.id, + })), }); } @@ -88,7 +88,7 @@ export default function search(state = initialState, action) { return state.set('results', Immutable.Map({ accounts: Immutable.List(action.results.accounts.map(item => item.id)), statuses: Immutable.List(action.results.statuses.map(item => item.id)), - hashtags: Immutable.List(action.results.hashtags) + hashtags: Immutable.List(action.results.hashtags), })).set('submitted', true); default: return state; |