[autofix] Activate and apply eslint indent rule
authorFrank Bessou <frank.bessou@logilab.fr>
Thu, 04 May 2017 10:45:23 +0200
changeset 174 de0bc05b4792
parent 173 965aeaedcde3
child 175 649a158150a5
[autofix] Activate and apply eslint indent rule
.eslintrc.yml
karma.conf.js
src/components/App.js
src/components/Entity.js
src/model.js
test/index.js
--- a/.eslintrc.yml	Wed May 03 11:01:27 2017 +0200
+++ b/.eslintrc.yml	Thu May 04 10:45:23 2017 +0200
@@ -24,7 +24,7 @@
   eqeqeq: [1]
   import/first: "error"
   import/newline-after-import: "error"
-  indent: ["off", 4, {"VariableDeclarator": 1}]
+  indent: ["error", 4, {"VariableDeclarator": 1, 'SwitchCase': 1}]
   key-spacing: [0]
   new-cap: [0]
   no-console: ["error", {"allow": ["warn", "error"]}]
--- a/karma.conf.js	Wed May 03 11:01:27 2017 +0200
+++ b/karma.conf.js	Thu May 04 10:45:23 2017 +0200
@@ -4,70 +4,70 @@
 const path = require('path');
 
 module.exports = function(config) {
-  config.set({
+    config.set({
 
     // base path that will be used to resolve all patterns (eg. files, exclude)
-    basePath: '',
+        basePath: '',
 
     // frameworks to use
     // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
-    frameworks: ['mocha'],
+        frameworks: ['mocha'],
 
     // list of files / patterns to load in the browser
-    files: [
-      'node_modules/babel-polyfill/dist/polyfill.js',
-      path.join(paths.test, '*.js'),
-    ],
+        files: [
+            'node_modules/babel-polyfill/dist/polyfill.js',
+            path.join(paths.test, '*.js'),
+        ],
 
     // list of files to exclude
-    exclude: [
-    ],
+        exclude: [
+        ],
 
     // preprocess matching files before serving them to the browser
     // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
-    preprocessors: {
-        '**/*.js':['webpack', 'sourcemap'],
-    },
+        preprocessors: {
+            '**/*.js':['webpack', 'sourcemap'],
+        },
 
-    webpack: require("./webpack/test.config"),
+        webpack: require("./webpack/test.config"),
     // test results reporter to use
     // possible values: 'dots', 'progress'
     // available reporters: https://npmjs.org/browse/keyword/karma-reporter
-    reporters: ['mocha', 'junit'],
+        reporters: ['mocha', 'junit'],
 
-    junitReporter: {
-        outputDir: 'reports',
-        outputFile: 'karma.junit',
-        useBrowserName: false,
-    },
+        junitReporter: {
+            outputDir: 'reports',
+            outputFile: 'karma.junit',
+            useBrowserName: false,
+        },
 
-    mochaReporter: {
-        showDiff: true,
-    },
+        mochaReporter: {
+            showDiff: true,
+        },
 
     // web server port
-    port: 9876,
+        port: 9876,
 
     // enable / disable colors in the output (reporters and logs)
-    colors: true,
+        colors: true,
 
     // level of logging
     // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
-    logLevel: config.LOG_INFO,
+        logLevel: config.LOG_INFO,
 
     // enable / disable watching file and executing tests whenever any file changes
-    autoWatch: true,
+        autoWatch: true,
 
     // start these browsers
     // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
-    browsers: ['PhantomJS'],
+        browsers: ['PhantomJS'],
 
     // Continuous Integration mode
     // if true, Karma captures browsers, runs the tests and exits
-    singleRun: false,
+        singleRun: false,
 
     // Concurrency level
     // how many browser should be started simultaneous
-    concurrency: Infinity,
-  })
-}
+        concurrency: Infinity,
+    });
+};
--- a/src/components/App.js	Wed May 03 11:01:27 2017 +0200
+++ b/src/components/App.js	Thu May 04 10:45:23 2017 +0200
@@ -31,7 +31,7 @@
                 </div>
             </div>
         </nav>
-   );
+    );
 }
 
 export function NotFound() {
--- a/src/components/Entity.js	Wed May 03 11:01:27 2017 +0200
+++ b/src/components/Entity.js	Thu May 04 10:45:23 2017 +0200
@@ -120,7 +120,7 @@
                     <div className="panel-body text-muted">
                         nothing related yet
                     </div>
-                );
+            );
         } else {
             return <CollectionView collection={this.state.related} />;
         }
--- a/src/model.js	Wed May 03 11:01:27 2017 +0200
+++ b/src/model.js	Thu May 04 10:45:23 2017 +0200
@@ -3,11 +3,11 @@
 import {PropTypeJsonaryWrapper} from './jsonaryutils';
 
 export const PropTypeAction = PropTypes.oneOf([
-        'create',
-        'view',
-        'edit',
-        'delete',
-    ]);
+    'create',
+    'view',
+    'edit',
+    'delete',
+]);
 
 const RESOURCE_PROPERTIES = {
     url: PropTypes.string.isRequired,
--- a/test/index.js	Wed May 03 11:01:27 2017 +0200
+++ b/test/index.js	Thu May 04 10:45:23 2017 +0200
@@ -440,7 +440,7 @@
                 if (noContent) {
                     merge(resourceOptions, {status: 204});
                 } else {
-                     merge(resourceOptions, {status: 200, headers: {"Content-Type": "application/json"}});
+                    merge(resourceOptions, {status: 200, headers: {"Content-Type": "application/json"}});
                 }
                 const response =  new Response(JSON.stringify(data), resourceOptions);
                 return Promise.resolve(response);