diff options
author | Yamagishi Kazutoshi <ykzts@desire.sh> | 2017-06-06 20:20:07 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-06 13:20:07 +0200 |
commit | d8ae3efec39cc0d05410629a267b07295b93c59b (patch) | |
tree | 684d0c953616fa408aa6d78a09b654cf94dcc6c2 /app/javascript/mastodon/features/compose/components | |
parent | cd81a1c52a43e6bed17ba86cef343086a44cd5e9 (diff) | |
download | mastodon-d8ae3efec39cc0d05410629a267b07295b93c59b.tar mastodon-d8ae3efec39cc0d05410629a267b07295b93c59b.tar.gz mastodon-d8ae3efec39cc0d05410629a267b07295b93c59b.tar.bz2 mastodon-d8ae3efec39cc0d05410629a267b07295b93c59b.zip |
Improve ESLint rules for JSX (#3608)
* Add react/no-string-refs ESLint rule
* Add react/jsx-boolean-value ESLint rule
* Add react/jsx-closing-bracket-location ESLint rule
* Add react/jsx-indent ESLint rule
* Add react/jsx-curly-spacing ESLint rule
* Add react/jsx-equals-spacing ESLint rule
* Add react/jsx-first-prop-new-line ESLint rule
* Add react/jsx-no-duplicate-props ESLint rule
* Add react/jsx-tag-spacing ESLint rule
Diffstat (limited to 'app/javascript/mastodon/features/compose/components')
4 files changed, 10 insertions, 8 deletions
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index f413c2792..621ec43ab 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -152,7 +152,7 @@ class ComposeForm extends ImmutablePureComponent { <div className='compose-form'> <Collapsable isVisible={this.props.spoiler} fullHeight={50}> <div className='spoiler-input'> - <input placeholder={intl.formatMessage(messages.spoiler_placeholder)} value={this.props.spoiler_text} onChange={this.handleChangeSpoilerText} onKeyDown={this.handleKeyDown} type='text' className='spoiler-input__input' id='cw-spoiler-input'/> + <input placeholder={intl.formatMessage(messages.spoiler_placeholder)} value={this.props.spoiler_text} onChange={this.handleChangeSpoilerText} onKeyDown={this.handleKeyDown} type='text' className='spoiler-input__input' id='cw-spoiler-input' /> </div> </Collapsable> diff --git a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js index b6682f8d3..9ac674bb3 100644 --- a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js +++ b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js @@ -106,14 +106,16 @@ class EmojiPickerDropdown extends React.PureComponent { return ( <Dropdown ref={this.setRef} className='emoji-picker__dropdown' onShow={this.onShowDropdown} onHide={this.onHideDropdown}> <DropdownTrigger className='emoji-button' title={intl.formatMessage(messages.emoji)}> - <img draggable='false' - className={`emojione ${active && loading ? 'pulse-loading' : ''}`} - alt='🙂' src='/emoji/1f602.svg' /> + <img + draggable='false' + className={`emojione ${active && loading ? 'pulse-loading' : ''}`} + alt='🙂' src='/emoji/1f602.svg' + /> </DropdownTrigger> <DropdownContent className='dropdown__left'> { this.state.active && !this.state.loading && - (<EmojiPicker emojione={settings} onChange={this.handleChange} searchPlaceholder={intl.formatMessage(messages.emoji_search)} categories={categories} search={true} />) + (<EmojiPicker emojione={settings} onChange={this.handleChange} searchPlaceholder={intl.formatMessage(messages.emoji_search)} categories={categories} search />) } </DropdownContent> </Dropdown> diff --git a/app/javascript/mastodon/features/compose/components/privacy_dropdown.js b/app/javascript/mastodon/features/compose/components/privacy_dropdown.js index 8da5ce72a..49f1179a0 100644 --- a/app/javascript/mastodon/features/compose/components/privacy_dropdown.js +++ b/app/javascript/mastodon/features/compose/components/privacy_dropdown.js @@ -78,7 +78,7 @@ class PrivacyDropdown extends React.PureComponent { return ( <div ref={this.setRef} className={`privacy-dropdown ${open ? 'active' : ''}`}> - <div className='privacy-dropdown__value'><IconButton className='privacy-dropdown__value-icon' icon={valueOption.icon} title={intl.formatMessage(messages.change_privacy)} size={18} active={open} inverted onClick={this.handleToggle} style={iconStyle}/></div> + <div className='privacy-dropdown__value'><IconButton className='privacy-dropdown__value-icon' icon={valueOption.icon} title={intl.formatMessage(messages.change_privacy)} size={18} active={open} inverted onClick={this.handleToggle} style={iconStyle} /></div> <div className='privacy-dropdown__dropdown'> {open && options.map(item => <div role='button' tabIndex='0' key={item.value} data-index={item.value} onClick={this.handleClick} className={`privacy-dropdown__option ${item.value === value ? 'active' : ''}`}> diff --git a/app/javascript/mastodon/features/compose/components/upload_button.js b/app/javascript/mastodon/features/compose/components/upload_button.js index 2791ed66e..326b9851a 100644 --- a/app/javascript/mastodon/features/compose/components/upload_button.js +++ b/app/javascript/mastodon/features/compose/components/upload_button.js @@ -54,13 +54,13 @@ class UploadButton extends ImmutablePureComponent { return ( <div className='compose-form__upload-button'> - <IconButton icon='camera' title={intl.formatMessage(messages.upload)} disabled={disabled} onClick={this.handleClick} className='compose-form__upload-button-icon' size={18} inverted style={iconStyle}/> + <IconButton icon='camera' title={intl.formatMessage(messages.upload)} disabled={disabled} onClick={this.handleClick} className='compose-form__upload-button-icon' size={18} inverted style={iconStyle} /> <input key={resetFileKey} ref={this.setRef} type='file' multiple={false} - accept={ acceptContentTypes.toArray().join(',')} + accept={acceptContentTypes.toArray().join(',')} onChange={this.handleChange} disabled={disabled} style={{ display: 'none' }} |