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

@ -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;