[autofix] Add and apply no-multiple-spaces eslint rule
authorFrank Bessou <frank.bessou@logilab.fr>
Thu, 04 May 2017 11:01:45 +0200
changeset 176 08b0e9890021
parent 175 649a158150a5
child 177 929a7262c5cc
[autofix] Add and apply no-multiple-spaces eslint rule
.eslintrc.yml
src/components/Attribute.js
src/components/Entity.js
src/utils.js
test/index.js
--- a/.eslintrc.yml	Thu May 04 11:00:31 2017 +0200
+++ b/.eslintrc.yml	Thu May 04 11:01:45 2017 +0200
@@ -29,7 +29,7 @@
   new-cap: [0]
   no-console: ["error", {"allow": ["warn", "error"]}]
   no-multiple-empty-lines: ["error", {"max":1, "maxEOF": 0, "maxBOF": 0}]
-  no-multi-spaces: [0]
+  no-multi-spaces: ["error"]
   no-sequences: "error"
   no-shadow: [0]
   no-trailing-spaces: [2]
--- a/src/components/Attribute.js	Thu May 04 11:00:31 2017 +0200
+++ b/src/components/Attribute.js	Thu May 04 11:01:45 2017 +0200
@@ -23,7 +23,7 @@
 AttributeValue.propTypes = ATTRIBUTE_VALUE_PROPTYPES;
 
 function ArrayValue({attribute}) {
-    let attributeValue =  attribute.mapItems( (item) => {
+    let attributeValue = attribute.mapItems( (item) => {
         return (<ArrayItemValue attribute={item} key={item.uniqueId} />);
     });
     attributeValue = intersperse(attributeValue, ', ');
--- a/src/components/Entity.js	Thu May 04 11:00:31 2017 +0200
+++ b/src/components/Entity.js	Thu May 04 11:01:45 2017 +0200
@@ -18,7 +18,7 @@
     const schema = data.schemas();
     const properties = schema.definedProperties();
     const attributes = properties.map(
-        (name)  => {
+        (name) => {
             const attributeSchema = schema.propertySchemas(name);
             const attributeTitle = attributeSchema.title() || name;
             const attribute = data.property(name);
--- a/src/utils.js	Thu May 04 11:00:31 2017 +0200
+++ b/src/utils.js	Thu May 04 11:01:45 2017 +0200
@@ -44,7 +44,7 @@
         }
         return formData;
 
-    } else if (type === 'object' &&  actualPropertyType === 'object') {
+    } else if (type === 'object' && actualPropertyType === 'object') {
 
         // The data represents an object, remove all the properties which are
         // not present in the schema.
--- a/test/index.js	Thu May 04 11:00:31 2017 +0200
+++ b/test/index.js	Thu May 04 11:01:45 2017 +0200
@@ -308,7 +308,7 @@
     describe('with data containing "created_at" and "updated_at" properties', () => {
 
         it('renders something', () => {
-            const resource =  createResource(dataWithDates, schemaWithoutDates);
+            const resource = createResource(dataWithDates, schemaWithoutDates);
 
             const wrapper = shallow(<EntityMeta data={resource}/>);
             expect(wrapper.html()).to.not.be.equal(null);
@@ -442,7 +442,7 @@
                 } else {
                     merge(resourceOptions, {status: 200, headers: {"Content-Type": "application/json"}});
                 }
-                const response =  new Response(JSON.stringify(data), resourceOptions);
+                const response = new Response(JSON.stringify(data), resourceOptions);
                 return Promise.resolve(response);
             });