Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
Eslint: object-shorthand
Browse files Browse the repository at this point in the history
  • Loading branch information
artkravchenko committed May 23, 2016
1 parent c07278c commit 4e9a53f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"no-unneeded-ternary": 2,
"no-var": 2,
"no-warning-comments": 1,
"object-shorthand": 2,
"object-curly-spacing": [2, "always"],
"padded-blocks": [2, "never"],
"prefer-const": 2,
Expand Down
6 changes: 5 additions & 1 deletion src/api/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,11 @@ export default class ApiClient
}

async processImage(id, transforms, derived_id = null) {
const response = await this.postJSON('/api/v1/image', { original_id: id, transforms: JSON.stringify(transforms), derived_id: derived_id });
const response = await this.postJSON('/api/v1/image', {
original_id: id,
transforms: JSON.stringify(transforms),
derived_id
});
return response.body;
}

Expand Down
1 change: 1 addition & 0 deletions src/api/db/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint object-shorthand: "off" */
/*
This file is a part of libertysoil.org website
Copyright (C) 2015 Loki Education (Social Enterprise)
Expand Down
6 changes: 3 additions & 3 deletions src/api/db/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const User = {
username: [
'required',
'maxLength:31',
{ rule: function (val) {
{ rule: (val) => {
if (!val.match(/^(?!.*\.{2})[a-z0-9\-\_\'\.]+$/i)) {
throw new Error("Username can contain letters a-z, numbers 0-9, dashes (-), underscores (_), apostrophes (\'), and periods (.)");
}
Expand All @@ -29,7 +29,7 @@ const User = {
password: [
'required',
{
rule: function (val) {
rule: (val) => {
if (!val.match(/^[\x20-\x7E]{8,}$/)) {
throw new Error("Password is min. 8 characters. Password can only have ascii characters.");
}
Expand All @@ -44,7 +44,7 @@ const User = {
email: [
'required',
{
rule: function (val) {
rule: (val) => {
if (!val.match(/^[a-z0-9!#$%&"'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i)) {
throw new Error('The email must be a valid email address');
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/pickpoint-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class PickpointInput extends React.Component {
};

static defaultProps = {
onSelect: function () {}
onSelect: () => {}
};

state = {
Expand Down
4 changes: 1 addition & 3 deletions src/components/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ class Sidebar extends React.Component {
dispatch(toggleUISidebar(false));
}

this.setState({
clientWidth: clientWidth
});
this.setState({ clientWidth });
}, 100);

render() {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class SettingsPage extends React.Component {
more: {
summary: this.form.summary.value,
bio: this.form.bio.value,
roles: roles,
roles,
...processedPictures
}
});
Expand Down

0 comments on commit 4e9a53f

Please sign in to comment.