#305: fix linting errors after upgrading to eslint 4

This commit is contained in:
SleepWalker 2017-08-23 00:00:10 +03:00
parent e21f6c397d
commit 02ce9bb3b5
17 changed files with 115 additions and 138 deletions

View File

@ -9,25 +9,6 @@
"react" "react"
], ],
"ecmaFeatures": {
"jsx": true,
"modules": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"spread": true,
"arrowFunctions": true,
"blockBindings": true,
"objectLiteralComputedProperties": true,
"objectLiteralDuplicateProperties": true,
"objectLiteralShorthandMethods": true,
"objectLiteralShorthandProperties": true,
"restParams": true,
"superInFunctions": true,
"templateStrings": true,
"experimentalObjectRestSpread": true
},
"env": { "env": {
"mocha": true, // needed for tests. Apply it globaly till eslint/selint#3611 "mocha": true, // needed for tests. Apply it globaly till eslint/selint#3611
"browser": true, "browser": true,

View File

@ -32,8 +32,7 @@ export default class BaseAuthBody extends Component {
renderErrors() { renderErrors() {
return this.form.hasErrors() return this.form.hasErrors()
? <AuthError error={this.form.getFirstError()} onClose={this.onClearErrors} /> ? <AuthError error={this.form.getFirstError()} onClose={this.onClearErrors} />
: null : null;
;
} }
onFormSubmit() { onFormSubmit() {

View File

@ -168,8 +168,7 @@ export class ContactForm extends Component {
logger.warn('Error sending feedback', resp); logger.warn('Error sending feedback', resp);
}) })
.finally(() => this.setState({isLoading: false})) .finally(() => this.setState({isLoading: false}));
;
}; };
} }

View File

@ -36,7 +36,8 @@ export default class Button extends FormComponent {
} = this.props; } = this.props;
return ( return (
<button className={classNames(buttons[color], { <button
className={classNames(buttons[color], {
[buttons.loading]: loading, [buttons.loading]: loading,
[buttons.block]: block, [buttons.block]: block,
[buttons.smallButton]: small [buttons.smallButton]: small

View File

@ -24,14 +24,12 @@ export default class Captcha extends FormInputComponent {
}; };
componentDidMount() { componentDidMount() {
setTimeout(() => setTimeout(() => {
captcha.render(this.el, { captcha.render(this.el, {
skin: this.props.skin, skin: this.props.skin,
onSetCode: this.setCode onSetCode: this.setCode
}) }).then((captchaId) => this.captchaId = captchaId);
.then((captchaId) => this.captchaId = captchaId), }, this.props.delay);
this.props.delay
);
} }
render() { render() {

View File

@ -59,7 +59,8 @@ export default class Dropdown extends FormInputComponent {
return ( return (
<div> <div>
<div className={classNames(styles[color], { <div
className={classNames(styles[color], {
[styles.block]: block, [styles.block]: block,
[styles.opened]: isActive [styles.opened]: isActive
})} })}

View File

@ -117,8 +117,7 @@ function doFetch(url, options = {}) {
.then(toJSON, rejectWithJSON) .then(toJSON, rejectWithJSON)
.then(handleResponseSuccess) .then(handleResponseSuccess)
.then((resp) => middlewareLayer.run('then', resp, {url, options})) .then((resp) => middlewareLayer.run('then', resp, {url, options}))
.catch((resp) => middlewareLayer.run('catch', resp, {url, options}, () => doFetch(url, options))) .catch((resp) => middlewareLayer.run('catch', resp, {url, options}, () => doFetch(url, options)));
;
} }
/** /**
@ -159,6 +158,5 @@ function buildQuery(data: Object = {}): string {
.map(encodeURIComponent) .map(encodeURIComponent)
.join('=') .join('=')
) )
.join('&') .join('&');
;
} }