Add import rules to elsint
authorFrank Bessou <frank.bessou@logilab.fr>
Mon, 24 Apr 2017 10:53:47 +0200
changeset 129 ce4947aeebc1
parent 128 dc40f95bf0e5
child 130 e0bb0419cbc4
Add import rules to elsint
.eslintrc.yml
package.json
test/index.js
--- a/.eslintrc.yml	Thu Apr 20 09:25:57 2017 +0200
+++ b/.eslintrc.yml	Mon Apr 24 10:53:47 2017 +0200
@@ -22,6 +22,8 @@
   comma-dangle: ["error", "always-multiline"]
   comma-spacing: ["error"]
   eqeqeq: [1]
+  import/first: "error"
+  import/newline-after-import: "error"
   indent: ["off", 4, {"VariableDeclarator": 1}]
   key-spacing: [0]
   new-cap: [0]
@@ -43,3 +45,4 @@
   space-before-function-paren: ["error", "never"]
 plugins:
   - react
+  - import
--- a/package.json	Thu Apr 20 09:25:57 2017 +0200
+++ b/package.json	Mon Apr 24 10:53:47 2017 +0200
@@ -27,6 +27,7 @@
     "diff": "^3.2.0",
     "enzyme": "^2.4.1",
     "eslint": "^3.11.1",
+    "eslint-plugin-import": "^2.2.0",
     "eslint-plugin-react": "^6.7.1",
     "html-webpack-plugin": "^2.28.0",
     "http-link-header": "^0.8.0",
--- a/test/index.js	Thu Apr 20 09:25:57 2017 +0200
+++ b/test/index.js	Mon Apr 24 10:53:47 2017 +0200
@@ -1,11 +1,8 @@
 /* eslint-env mocha */
 /* global describe, it, Jsonary*/
 
-import {expect} from 'chai';
 import chai from 'chai';
 import chaiAsPromised from 'chai-as-promised';
-chai.use(chaiAsPromised);
-
 import {shallow} from 'enzyme';
 import sinon from 'sinon';
 import {assert} from 'sinon';
@@ -19,6 +16,9 @@
 import {wrapEntityData} from "../src/jsonaryutils";
 import {ReactJsonSchemaAdapterFactory} from '../src/components/Form';
 import {HttpHypermediaClient} from '../src/services/hypermedia.js';
+import {expect} from 'chai';
+
+chai.use(chaiAsPromised);
 
 const userEditionSchema = {
     "$ref": "#/definitions/CWUser",