Browse Source

#87 - Added eslint

Elisa Cutrin 1 year ago
parent
commit
c96da876bd

+ 35 - 0
apps/credential-issuer/.eslintrc.json

@@ -0,0 +1,35 @@
1
+{
2
+  "parser": "babel-eslint",
3
+  "extends": "airbnb",
4
+  "plugins": [
5
+    "react",
6
+    "jsx-a11y",
7
+    "import"
8
+  ],
9
+  "env": {
10
+    "browser": true,
11
+    "mocha": true,
12
+    "jest": true
13
+  },
14
+  "globals": {
15
+    "browser": true,
16
+    "expect": true,
17
+    "API": true,
18
+    "expoLink": true,
19
+    "$": true,
20
+    "neptuneUrl": true,
21
+    "atlantisUrl": true
22
+  },
23
+  "rules": {
24
+    "react/jsx-filename-extension": [
25
+      "error",
26
+      {
27
+        "extensions": [
28
+          ".js",
29
+          ".jsx"
30
+        ]
31
+      }
32
+    ],
33
+    "no-console": 0
34
+  }
35
+}

File diff suppressed because it is too large
+ 1283 - 3
apps/credential-issuer/package-lock.json


+ 8 - 1
apps/credential-issuer/package.json

@@ -8,7 +8,8 @@
8 8
     "webpack": "./node_modules/.bin/webpack -w",
9 9
     "build:dev": "NODE_ENV='development' webpack",
10 10
     "build:prod": "NODE_ENV='production' webpack",
11
-    "test": "jest"
11
+    "test": "jest",
12
+    "lint": "eslint -c .eslintrc.json ."
12 13
   },
13 14
   "keywords": [],
14 15
   "author": "",
@@ -26,6 +27,7 @@
26 27
   "devDependencies": {
27 28
     "babel": "^6.23.0",
28 29
     "babel-core": "^6.26.3",
30
+    "babel-eslint": "^8.0.3",
29 31
     "babel-jest": "^23.0.1",
30 32
     "babel-loader": "^7.1.2",
31 33
     "babel-preset-env": "^1.7.0",
@@ -36,6 +38,11 @@
36 38
     "css-loader": "^0.28.7",
37 39
     "enzyme": "^3.3.0",
38 40
     "enzyme-adapter-react-16": "^1.1.1",
41
+    "eslint": "^4.19.1",
42
+    "eslint-config-airbnb": "^16.1.0",
43
+    "eslint-plugin-import": "^2.11.0",
44
+    "eslint-plugin-jsx-a11y": "^6.0.3",
45
+    "eslint-plugin-react": "^7.7.0",
39 46
     "html-webpack-plugin": "^2.30.1",
40 47
     "jest": "^23.1.0",
41 48
     "mocha": "^4.0.1",

+ 1 - 3
apps/credential-issuer/test/Verify.test.js

@@ -38,9 +38,7 @@ describe('VerifyComponent', () => {
38 38
 
39 39
   describe('when rendered', () => {
40 40
     it('should match this snapshot', () => {
41
-      const wrapper = shallow(
42
-        <Verify />,
43
-      );
41
+      const wrapper = shallow(<Verify />);
44 42
       expect(wrapper.dive()).toMatchSnapshot();
45 43
     });
46 44
   });