#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"
],
"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": {
"mocha": true, // needed for tests. Apply it globaly till eslint/selint#3611
"browser": true,

View File

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

View File

@ -168,8 +168,7 @@ export class ContactForm extends Component {
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;
return (
<button className={classNames(buttons[color], {
<button
className={classNames(buttons[color], {
[buttons.loading]: loading,
[buttons.block]: block,
[buttons.smallButton]: small

View File

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

View File

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

View File

@ -34,7 +34,7 @@ Promise.all([
userFactory(store),
font.load(['Roboto', 'Roboto Condensed'])
])
.then(() => {
.then(() => {
ReactDOM.render(
<ReduxProvider store={store}>
<IntlProvider>
@ -51,7 +51,7 @@ Promise.all([
);
initAnalytics();
});
});
import { loadScript, debounce } from 'functions';
const trackPageView = debounce(_trackPageView);

View File

@ -117,8 +117,7 @@ function doFetch(url, options = {}) {
.then(toJSON, rejectWithJSON)
.then(handleResponseSuccess)
.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)
.join('=')
)
.join('&')
;
.join('&');
}