[autofix] Add and apply key-spacing eslint rule
authorFrank Bessou <frank.bessou@logilab.fr>
Thu, 04 May 2017 11:07:08 +0200
changeset 177 929a7262c5cc
parent 176 08b0e9890021
child 178 6d904376b32e
[autofix] Add and apply key-spacing eslint rule
.eslintrc.yml
karma.conf.js
test/index.js
--- a/.eslintrc.yml	Thu May 04 11:01:45 2017 +0200
+++ b/.eslintrc.yml	Thu May 04 11:07:08 2017 +0200
@@ -25,7 +25,7 @@
   import/first: "error"
   import/newline-after-import: "error"
   indent: ["error", 4, {"VariableDeclarator": 1, 'SwitchCase': 1}]
-  key-spacing: [0]
+  key-spacing: ["error"]
   new-cap: [0]
   no-console: ["error", {"allow": ["warn", "error"]}]
   no-multiple-empty-lines: ["error", {"max":1, "maxEOF": 0, "maxBOF": 0}]
--- a/karma.conf.js	Thu May 04 11:01:45 2017 +0200
+++ b/karma.conf.js	Thu May 04 11:07:08 2017 +0200
@@ -26,7 +26,7 @@
     // preprocess matching files before serving them to the browser
     // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
         preprocessors: {
-            '**/*.js':['webpack', 'sourcemap'],
+            '**/*.js': ['webpack', 'sourcemap'],
         },
 
         webpack: require("./webpack/test.config"),
--- a/test/index.js	Thu May 04 11:01:45 2017 +0200
+++ b/test/index.js	Thu May 04 11:07:08 2017 +0200
@@ -135,7 +135,7 @@
     };
 
     it('renders a link with title and proper URL', () => {
-        const item = {title: 'bob', id:'123'};
+        const item = {title: 'bob', id: '123'};
         const itemSchema = {links: [{rel: 'item', href: '/user/{id}'}]};
         const wrappedItem = createResource(item, itemSchema);
         const component = <CollectionItemLink item={wrappedItem}/>;
@@ -471,8 +471,8 @@
         it('should fetch schema provided in HTTP "Link" header', done => {
             const config = {
                 resourceRoute: '/users/john',
-                schema : {type: 'object'},
-                schemaRoute : '/schema/any',
+                schema: {type: 'object'},
+                schemaRoute: '/schema/any',
 
             };
             const client = configureBackend(config);
@@ -535,7 +535,7 @@
         const etype = 'foo';
         const eid = 123;
         const route = `/${etype}/${eid}`;
-        const resource = {url: route, route: route, allowedActions:['view'], data: createResource('{}', '{}')};
+        const resource = {url: route, route: route, allowedActions: ['view'], data: createResource('{}', '{}')};
 
         beforeEach(() => {
             sinon.stub(hypermediaClient, 'getResource').resolves(resource);
@@ -614,7 +614,7 @@
         });
 
         it ('should call recursively on nested arrays and object', () => {
-            const schema = {a: '', b: 1, c: null, d: {e: [{f:1}, {g:2}, null]}};
+            const schema = {a: '', b: 1, c: null, d: {e: [{f: 1}, {g: 2}, null]}};
 
             adapterFactory.adaptRecursively(schema);
 
@@ -649,7 +649,7 @@
 
             it ('should not replace oneOf when getEnumFromOneOf throws', () => {
                 adapterFactory.getEnumFromOneOf.throws();
-                const schema = {oneOf:[]};
+                const schema = {oneOf: []};
 
                 const adapter = adapterFactory.adaptRecursively(schema);