Add and apply eslint's comma-spacing rule
authorFrank Bessou <frank.bessou@logilab.fr>
Tue, 18 Apr 2017 11:17:45 +0200
changeset 118 bdb941dcdd40
parent 117 493b8bda31e8
child 119 a9624f3f086f
Add and apply eslint's comma-spacing rule
.eslintrc.yml
src/components/Entity.js
src/utils.js
test/index.js
webpack.config.js
--- a/.eslintrc.yml	Tue Apr 18 10:30:56 2017 +0200
+++ b/.eslintrc.yml	Tue Apr 18 11:17:45 2017 +0200
@@ -19,6 +19,7 @@
   es6: true
   node: true
 rules:
+  comma-spacing: ["error"]
   react/no-multi-comp: off
   react/jsx-indent-props: [2, 4]
   object-curly-spacing: ["error", "never"]
--- a/src/components/Entity.js	Tue Apr 18 10:30:56 2017 +0200
+++ b/src/components/Entity.js	Tue Apr 18 11:17:45 2017 +0200
@@ -211,7 +211,7 @@
     }
 
     getEditionSchema() {
-        return Api.getSchema(appendPath(this.state.entity.url,'/schema?role=edition'));
+        return Api.getSchema(appendPath(this.state.entity.url, '/schema?role=edition'));
     }
 
     navigateToSelf() {
--- a/src/utils.js	Tue Apr 18 10:30:56 2017 +0200
+++ b/src/utils.js	Tue Apr 18 11:17:45 2017 +0200
@@ -11,7 +11,7 @@
         path = path[0] === '/' ? path : `/${path}`;
     }
     if (url.length > 0) {
-        url = url.slice(-1) === '/' ? url.slice(0,-1) : url;
+        url = url.slice(-1) === '/' ? url.slice(0, -1) : url;
     }
     return url + path;
 }
--- a/test/index.js	Tue Apr 18 10:30:56 2017 +0200
+++ b/test/index.js	Tue Apr 18 11:17:45 2017 +0200
@@ -342,7 +342,7 @@
 });
 describe('Jsonary Extensions', () => {
     describe('mapItems', () => {
-        it('should map items ',() => {
+        it('should map items ', () => {
             const wrappedArray = Jsonary.create(['one', 2, 4]);
 
             const mapped = wrappedArray.mapItems((currentItem, index)=> currentItem.value()+index);
@@ -508,7 +508,7 @@
         const etype = 'foo';
         const eid = 123;
         const route = `/${etype}/${eid}`;
-        const resource = {url: route, route: route, allowedActions:['view'], data: wrapEntityData('{}','{}')};
+        const resource = {url: route, route: route, allowedActions:['view'], data: wrapEntityData('{}', '{}')};
 
         beforeEach(() => {
             sinon.stub(api, 'getResource').resolves(resource);
@@ -610,7 +610,7 @@
 
             it ('should replace oneOf by enumNames/enum', () => {
                 adapterFactory.getEnumFromOneOf.returns({enumNames: ['A'], enumValues: ['a']});
-                const schema = {oneOf: [{},{}], title: 'TITLE'};
+                const schema = {oneOf: [{}, {}], title: 'TITLE'};
 
                 const adapter = adapterFactory.adaptRecursively(schema);
 
@@ -644,7 +644,7 @@
         });
 
         it ('should return as many enum values as the number of alternative schemas', () => {
-            const schema = {oneOf: [{},{},{}]};
+            const schema = {oneOf: [{}, {}, {}]};
             adapterFactory.schemaToConstant.returns({name: 'A', value: 'a'});
             const expectedLength = 3;
 
--- a/webpack.config.js	Tue Apr 18 10:30:56 2017 +0200
+++ b/webpack.config.js	Tue Apr 18 11:17:45 2017 +0200
@@ -29,7 +29,7 @@
     const apiUrl = process.env.API_URL || defaultApiUrl;
     config.plugins.push(
             new HtmlWebpackPlugin({
-                title: "Json Schema React Web Client" ,
+                title: "Json Schema React Web Client",
                 template: path.join(paths.source, "index.ejs"),
             }),
             new webpack.DefinePlugin({