[autofix] Add and apply space-infix-ops eslint rule
authorFrank Bessou <frank.bessou@logilab.fr>
Thu, 04 May 2017 11:00:31 +0200
changeset 175 649a158150a5
parent 174 de0bc05b4792
child 176 08b0e9890021
[autofix] Add and apply space-infix-ops eslint rule Force using space between operator and operands
.eslintrc.yml
src/components/BaseViews.js
src/components/Entity.js
src/index.js
test/index.js
--- a/.eslintrc.yml	Thu May 04 10:45:23 2017 +0200
+++ b/.eslintrc.yml	Thu May 04 11:00:31 2017 +0200
@@ -43,6 +43,7 @@
   react/jsx-indent-props: [2, 4]
   react/no-multi-comp: off
   semi: ["error", "always"]
+  space-infix-ops: ["error"]
   space-before-function-paren: ["error", "never"]
 plugins:
   - react
--- a/src/components/BaseViews.js	Thu May 04 10:45:23 2017 +0200
+++ b/src/components/BaseViews.js	Thu May 04 11:00:31 2017 +0200
@@ -39,7 +39,7 @@
     collection: PropTypesResourceModel.isRequired,
 };
 
-export function ActionsDropDown({target, ignore=[]}) {
+export function ActionsDropDown({target, ignore = []}) {
     const actions = target.allowedActions.filter(x => !ignore.includes(x));
     if (isEmpty(actions)) {
         return null;
--- a/src/components/Entity.js	Thu May 04 10:45:23 2017 +0200
+++ b/src/components/Entity.js	Thu May 04 11:00:31 2017 +0200
@@ -52,7 +52,7 @@
     if (createdAtProp.defined()) {
         const creationDate = new Date(createdAtProp.value());
         const title = createdAtProp.schemas().title() || "created at";
-        metas.push(title + ": "+creationDate.toLocaleString());
+        metas.push(title + ": " + creationDate.toLocaleString());
     }
     if (updatedAtProp.defined()) {
         const updateDate = new Date(updatedAtProp.value());
@@ -60,7 +60,7 @@
         metas.push(title + ": " + updateDate.toLocaleString());
     }
 
-    if (metas.length===0) {
+    if (metas.length === 0) {
         return null;
     }
 
--- a/src/index.js	Thu May 04 10:45:23 2017 +0200
+++ b/src/index.js	Thu May 04 11:00:31 2017 +0200
@@ -9,7 +9,7 @@
 
 import "script-loader!jsonary/super-bundle/jsonary-super-bundle.js";
 
-const appElement= document.getElementById('app');
+const appElement = document.getElementById('app');
 
 render((
     <Router>
--- a/test/index.js	Thu May 04 10:45:23 2017 +0200
+++ b/test/index.js	Thu May 04 11:00:31 2017 +0200
@@ -370,7 +370,7 @@
         it('should map items ', () => {
             const wrappedArray = Jsonary.create(['one', 2, 4]);
 
-            const mapped = wrappedArray.mapItems((currentItem, index)=> currentItem.value()+index);
+            const mapped = wrappedArray.mapItems((currentItem, index)=> currentItem.value() + index);
 
             expect(mapped).to.deep.equal(['one0', 3, 6]);
         });